Thursday, 10 October 2019

mobile - Zoom to see entire MapLayer in Bing Maps


If I have a MapLayer that I'm applying to Bing Maps where I have a list of coordinates, how can I zoom to see the full MapLayer (dynamically zoom to the proper size) and toggle between seeing the starting point and ending point?



Answer



Use setView(LocationRect rect) in the Map to zoom. I would guess that MapLayer.GetPositionRectangle(layer) would give the full extent of the layer but I'm not sure. Otherwise loop through the list and create the LocationRect. For panning to different locations use the SetView(GeoCoordinate center, double zoomLevel) using the map ZoomLevel


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...