Select to view content in your preferred language

Flex V3.6 - customizing individual basemap zoom levels

2376
3
Jump to solution
01-31-2014 04:50 AM
SamKrueger1
Deactivated User
I have a flex app where I've customized the <basemap> tags in my config.xml file to only include the light gray canvas, aerial, topo and street basemaps from ESRI.

When I test the app live to see the maximum zoom scale of each basemap, it seems the aerial, topo and streets are limited to the smaller zoom scale of the light gray canvas (I know at a certain zoom scale the light gray canvas will not draw). Another flex app I created uses JUST the aerial basemap and I can zoom to a much greater scale. It seem the other 3 basemaps get stuck using the zoom scale of the light gray canvas if they are all used together in the basemap switcher?

My question is can I customize each of my four individual basemap layers within the <basemap> tags to zoom to a certain scale? Ideally I'd like to keep the light gray canvas map as is, but then when a user switches to the aerial, street or topo basemap they can extend the zoom level further (or to the max level for those three).

Thanks for any help/tips.

 
 
<basemaps>

<layer type="tiled" label="Light Gray" icon="https://www.arcgis.com/sharing/rest/content/items/8b3b470883a744aeb60e5fff0a319ce7/info/thumbnail/templight_gray_canvas_with_labels__ne_usa.png" url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" visible="true"/>

<layer type="tiled" label="Light Gray" url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer" visible="false" reference="true"/>
 
<layer label="Aerial" type="tiled" visible="false" alpha="1"icon="http://farm8.staticflickr.com/7327/12196738736_abeeda671c_q.jpg" url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>

<layer label="Topo" type="tiled" visible="false" alpha="1"icon="http://farm8.staticflickr.com/7352/12196378733_3fd16ec153_q.jpg" url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>

<layer label="Streets" type="tiled" visible="false" alpha="1" icon="http://farm6.staticflickr.com/5508/12196539864_9fe1d98c46_q.jpg" url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>

</basemaps>
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Honored Contributor
Sam,

The zoom levels of your application are set from the first basemap added so if you swap the order of your base maps so that your imagery is loaded first you will get all your zoom levels.

Regards

Anthony

View solution in original post

0 Kudos
3 Replies
AnthonyGiles
Honored Contributor
Sam,

The zoom levels of your application are set from the first basemap added so if you swap the order of your base maps so that your imagery is loaded first you will get all your zoom levels.

Regards

Anthony
0 Kudos
SamKrueger1
Deactivated User
Thanks, that's easy enough.

Also, Is there a workflow you can recommend if I want to prevent a user from being able to zoom/pan to far away from the content of my app. I'm basically looking for a way to fix the extent.
0 Kudos
AnthonyGiles
Honored Contributor
Sam,

There is nothing you can do with the configuration files, but if you have the ability to amend the source code then this thread will help you:

http://forums.arcgis.com/threads/20799-Restrict-View-Port-Bounds-in-Flex-Viewer-2.x?highlight=constr...

Regards

Anthony
0 Kudos