I am currently using ZoomLevelScales to set my zoom levels and I see that it is deprecated in 5.0. I tried changing my code to ZoomLevelSet.ZoomLevel01.Scale = aDouble (for all zoom levels) but the PanZoomBar does not reflect the new scales. I set the scales for every zoom level for every layer but I still cannot get it working. Setting the MaximumScale to the same scale as ZoomLevel01 puts the PanZoomBar at around 50% zoomed out, rather than the 100% I would expect (because I set the MaximumScale at 500000). How do I sync the PanZoomBar's scales with ZoomLevel's scale?
Old Code:
double maxScale = 5000000; for (int i = 0; i < 20; i++) { Map.ZoomLevelScales.Add(maxScale); maxScale = maxScale / 2; }
Sorry we changed that up on you, we wanted to standardize the experience across all the products. The experieince was supposed to be be a good one though! Can you try this method instead. I wonder if just setting the scales was not causing th sync to happen. If you still have an issues let us know ASAP and we will dig in deeper.
David
ZoomLevelSet newZoomLevelSet = new ZoomLevelSet(); double maxScale = 5000000; for (int i = 0; i < 20; i++) { newZoomLevelSet.CustomZoomLevels.Add(new ZoomLevel(maxScale)); maxScale = maxScale / 2; }
Good to know that worked. My suspicion is that the sync is triggered on the setter of the property. This of course is not a good idea as people can simply change the values without changing the property. We will log this as a bug and get it fixed.
Is there a way to add more zoomlevels to the predefined ones without having to add every one of them? Previously I would just say Map.ZoomLevelScales.Add(scale) and it would work, but if I say Map.ZoomLevelSet.CustomZoomLevels.Add(zoomLevel), only the ones I added to the custom zoom levels are used? And if we have to add each on the CustomZoomLevels, will my rendering logic referenceing the predefined zoom levels still work (I’m guessing everything is based off zoomlevel scale and so that it would)?