On Oct 18, 2010, at 8:37 AM, mjb1999 wrote: > > I am writing a small Mapnik viewer application using c++, much like the > viewer demo application.
Curious, is there a reason you are not using/extending the viewer? Are you using a different GUI framework than QT? > I load a map from an XML file and I display it on > screen. > > In this application, I give the user the option to view the entire map in > the window. I use the zoom_all() function to accomplish this, and it works > fine. However, I also add a point_datasource() layer that dynamically shows > a GPS position. When I do this, the zoom_all() function no longer works as > expected. The map area is much larger than I would expect. > Okay, interesting. Are the point datasource geometries in the same coordinate system as your map? Are you remembering to set the proper srs for the layer you are adding the point datasource to? > I am thinking that my problem is that I do not specify the extent of the > dynamic layer when I create it, but I am not sure how to do this. Point Datasource inherits from the Memory Datasource (which you could use directly). But, either way the extent *should* be calculated for you automatically when the datasource.envelope() is called for the layer. For the memory datasource that happens here: http://trac.mapnik.org/browser/trunk/src/memory_datasource.cpp#L31 The code looks fine to me on first glance, but you may be seeing a bug. Please let me know what you find and if you can narrow it to a small testcase. Dane _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

