I've found an issue where the map scale returned by function map.getScale() is incorrect. Take a look at the screenshot of debug code below:
You can see that I set the scale to a round number of 10,000,000, then in the next line I read the scale back from the map. The scale returned is 9,633,193.199... Any idea why this is happening?
Solved! Go to Solution.
Vygintas,
When you use a cached base map there are predefined scales that the map services is cached at and thus when you set the scale to 10000000 it looks for the closest LOD scale for the base map you are using and uses that scale.
Vygintas,
When you use a cached base map there are predefined scales that the map services is cached at and thus when you set the scale to 10000000 it looks for the closest LOD scale for the base map you are using and uses that scale.
Hi Robert,
Thanks for the explanation. The problem is that this is causing issues with map layer visibility. When user selects a scale of 10,000, LOD scale gets set at 10,001 and there is a layer with min scale set at 10,000, this layer will not show up. Hence this being reported as a bug on our side.
Are you aware of any workarounds for this?
Vygintas,
No Sorry, I have never ran into that situation.
The only work around for this I know of, is to not use Tiled Map Services, meaning no basemaps. I've done it before using only a Dynamic service as my basemap. It's not ideal, but part of how LODs and tiles work.
If you initialize a map without a basemap and then add a Dynamic Map Service, then you're map is not limited to and LODs.
Thanks Rene, It's good to know that there are options available to get around this issue. For now we will be slightly increasing/decreasing the min/max scales of our data layers to stop them from being hidden.