nzjrs/osm-gps-map — pull request #32 by smartyg (2014-08-23 15:30:24+00:00)
Title: zoom and center to fit coordinates

Hello,

I have made a function to zoom and center around four coordinates. In my opinion this is a feature that is currently missing.

The function is currently called `osm_gps_map_zoom_fit_bbox(OsmGpsMap *map, float latitude1, float latitude2, float longitude1, float longitude2);`. The 2 latitudes and longitude define a box which must fit on the screen. The calculation of the correct zoom level is placed in `converter.c`. The calculation uses a macro called `LOG2` which definition depends on the value of FLT_RADIX and is either ilogb(x) or (floor(log2(x)). A small background about (i)logb: http://www.gnu.org/software/libc/manual/html_node/Exponents-and-Logarithms.html#index-logb-2196

If there are any questions or anything else, let me know.

with kind regards,
Martijn