Select to view content in your preferred language

Switch Basemap based upon extent

3066
7
08-10-2011 01:01 PM
JoshJones1
Deactivated User
I know someone asked a similar question last week, but I am interested in having my map switch from the ESRI Topo basemap to the ESRI Streets basemap when the user zooms in past 1:4514 and the "Map Data not yet Available" pops up.  The user last week wanted to know how to do this within the Flex API and I was curious if there was anyway to go about this without knowing how to program FlexBuilder.  Does anyone know if this is possible?


Thanks.


-Josh
Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus
Josh,

   Are you asking if there is a way to do this without code changes? If so than the answer is not that I know of.
0 Kudos
JoshJones1
Deactivated User
Robert,

Yes.  I meant to say without code changes.  I didn't think there was so I just put blank a mask behind my layers that shows up when the user zooms in too far.  Not the greatest fix but it works with my lack of knowledge.


Thanks Robert.
0 Kudos
BjornSvensson
Esri Regular Contributor
If you're OK with not letting the users pick then you could maybe try setting the displaylevels property on those basemaps...
0 Kudos
JoshJones1
Deactivated User
Bjorn,


How would I go about changing the settings on the basemaps?  When publishing .msd's I have to remove the ESRI basemaps to be able to publish, so I wouldn't be able to set the visibility scale in ArcMap first.  Are you able to append display properties for the basemap layers, or only in the operational layers?


Thanks,

-Josh
0 Kudos
BjornSvensson
Esri Regular Contributor
In the main configuration file, when you are adding <layer> and <basemaps>, the <layer> tag have that property.

* displaylevels - To specify which scale levels this layer should be displayed at. Only applies to tiled and bing layers.
http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/The_Layer_tag/01m30000000p000000/
0 Kudos
JoshJones1
Deactivated User
Thanks for the help Bjorn.

I have tried to set the extent that the base maps can be viewed at and I still cannot figure out what format the scales have to be in to  work properly.  The only result that I have received so far is to have all of the basemaps turn off when I try to set the display levels.

Are you supposed to set a range, specify each scale the map should be visible?

I can't find actual documentation on the exact format the that must be used to make this work.


Thanks for the help.


-Josh
0 Kudos
KarlWilson
Frequent Contributor
The format needs to be like so:

<layer label="_layer_name_" type="tiled" visible="true" displaylevels="0,1"
         url="http://_server_/_service_/MapServer"/>


This will then display only the first two Tile LODs from that particular map service. This is not to be confused with the LODs you may have defined in your config.xml.
0 Kudos