AnsweredAssumed Answered

set extent while adding dynamic layer to base map

Question asked by bforbhavin on Mar 3, 2015
Latest reply on Mar 26, 2015 by bforbhavin

I am trying to add published map service as a dynamic layer on the base map. If I give extent: fullextent or initialExtent available on mapservice then the map is not displayed at sufficient zoom level.

 

For example, I am trying to add following mapservice as a dynamic layer to the base map. But the output is not shown at sufficient zoom level.

RoadsHighways/NewYorkRoads (MapServer)

 

Let's say if you try to open this mapservice in ArcGIS Javascript Viewer (available on the given link) then it shows proper zoom level. But if you use ArcGIS.com map viewer, then it shows it at different zoom level.

 

It looks like bbox values are calculated when ArcGIS Javascript Viewer is used. Is there any way to calculate it dynamically?

 

In my case, I can't hardcode extent values when I instantiate map object. Because my customers can provide any mapservice in my code and accordingly I need to show it on the map. My design decision is - whatever extent customer has set it up in ArcMap before publishing the map service, I will use that to show the map.

 

Any suggestions to show dynamic layer at sufficient zoomed level when added to the basemap? Also, suggest if there is a better design decision.

Outcomes