|     Documentation    |     Premium Support

Zooming with Map in Meters


I am working on projections with my map application.
Now that I know how to convert to the correct Lat/Lon coordinates when in meters for map units things are getting closer.

However I am still having issues when zooming in (always zooms in to 0,0 no matter where I want to zoom in.

I do not have this issue when the map is in degrees, and as far as I can tell none of the zooming happens in my code. I do have some extra custom zoom levels setup.

Here is my code for when I enable zoom mode:
Map.ExtentOverlay.DoubleLeftClickMode = MapDoubleClickMode.ZoomIn;
OnyxMap.ExtentOverlay.TrackZoomInKey = (Key)MapMouseButton.Left;

Map panning also has some issues where I cannot pan the map either, maybe my restrict extent is the cause since I set it in degrees? Should I reset to Meters values in this case and flip everytime the projection changes or is there an easier way?

Could you attach a simple sample for this issue. This will be very helpful for me to understand the issue. I don’t think you need the code. By default the map is double click zoom in and the track zoom in is on the left button.




Here are some screenshots.
In Mercator Projection I am zoomed out:

If I double click the Map it always zooms in on 0,0 no matter where I click (I clicked in north america)

In longlat projection (4326) everything works fine. (zooms in where I double click and panning works)


If your data is 4326 you need do the project conversion to 3857. Then it could display on the map correct.

I created a demo for you.

  1. If the data is 4326. You need use the degree map to display the data
  2. If the data is 3857. You need use the Meter map to display the data.
  3. If you want the 4326 data display on the Meter map. You need convert the project to the 3857.

Let me know if this is help.



I got it to work.
I had RestrictExtent set in degrees. Needed to convert and set this value in Meters after the projection swap.

Thanks Chris,
Good to know it works. Let us know if you have any more questions.