[FOSS-GPS] Auto-zoom with osm-gps-map?

Joshua Judson Rosen rozzin at geekspace.com
Sun Feb 5 09:27:49 EST 2012

Joshua Judson Rosen <rozzin at geekspace.com> writes:
> In FoxtrotGPS, we have a function, get_zoom_covering(), which determines
> the zoom at which a given area (defined in terms of lat/lon ranges)
> will fit onscreen; this is used for autzooming when a track is loaded,
> for example. The calculations for this involve lat->pixel and lon->pixel
> logic, which exist in libosmgpsmap... but only as private/internal functions
> (they're declared in any public header, just in converter.h).
> Is there a recommended way of auto-zooming to a fit a particular region
> onto the display, in osm-gps-map? Should I just assume projection-type,
> tile-size, etc., and implement my own lat2pixel()/lon2pixel() routines
> (breaking that abstraction)? Or write my own declarations and use
> osm-gps-map's private API (breaking *that* abstraction)? Or...,
> something else?

Would a new `osm_gps_map_set_bbox' function for osm-gps-map
(counterpart to osm_gps_map_get_bbox()) be the right solution?

"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."

More information about the FOSS-GPS mailing list