Select to view content in your preferred language

Choosing default basemap

2485
3
Jump to solution
12-02-2013 06:21 AM
JamesMitchell_Jr_
Emerging Contributor
I've built a flex application using ArcGIS Viewer for Flex that uses the MapSwitcher widget to display the ESRI basemaps and a custom cached basemap I've published. Everything works well except the application wants to use my custom based map as the default. If I change the visibility of that layer to "false" it turns off the layer at startup but does not display one of the ESRI layers. What I would like to have is the ESRI Topographic Basemap to show up by default? Any ideas?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Honored Contributor
Your best bet is to add the basemaps in individually into the config.xml, that way you have total control over them, do not forget to turn the addarcgisbasemaps tag to false:

<layer label="Imagery" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/86de95d4e0244cba80f0fa2c9403a7b2/info/thumbnail/tempimagery.jpg"/> <layer label="Imagery with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/413fd05bbd7342f5991d5ec96f4f8b18/info/thumbnail/tempimagery_with_labels_ne_usa.png"/> <layer label="Imagery with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/413fd05bbd7342f5991d5ec96f4f8b18/info/thumbnail/tempimagery_with_labels_ne_usa.png"/> <layer label="Oceans" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/48b8cec7ebf04b5fbdcaf70d09daff21/info/thumbnail/tempoceans.jpg"/> <layer label="Topographic" type="tiled" visible="true" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/6e03e8c26aad4b9c92a87c1063ddb0e3/info/thumbnail/topo_map_2.jpg"/> <layer label="Streets" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thumbnail/tempstreets.jpg"/> <layer label="Light Gray Canvas" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/8b3b470883a744aeb60e5fff0a319ce7/info/thumbnail/templight_gray_canvas_with_labels__ne_usa.png"/> <layer label="Light Gray Canvas" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/8b3b470883a744aeb60e5fff0a319ce7/info/thumbnail/templight_gray_canvas_with_labels__ne_usa.png"/> <layer label="Terrain with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/aab054ab883c4a4094c72e949566ad40/info/thumbnail/tempTerrain_with_labels_ne_usa.png"/> <layer label="Terrain with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/aab054ab883c4a4094c72e949566ad40/info/thumbnail/tempTerrain_with_labels_ne_usa.png"/> <layer label="National Geographic" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/509e2d6b034246d692a461724ae2d62c/info/thumbnail/natgeo.jpg"/>


You can then add or remove base maps as you want

regards

Anthony

View solution in original post

3 Replies
AnthonyGiles
Honored Contributor
Your best bet is to add the basemaps in individually into the config.xml, that way you have total control over them, do not forget to turn the addarcgisbasemaps tag to false:

<layer label="Imagery" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/86de95d4e0244cba80f0fa2c9403a7b2/info/thumbnail/tempimagery.jpg"/> <layer label="Imagery with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/413fd05bbd7342f5991d5ec96f4f8b18/info/thumbnail/tempimagery_with_labels_ne_usa.png"/> <layer label="Imagery with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/413fd05bbd7342f5991d5ec96f4f8b18/info/thumbnail/tempimagery_with_labels_ne_usa.png"/> <layer label="Oceans" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/48b8cec7ebf04b5fbdcaf70d09daff21/info/thumbnail/tempoceans.jpg"/> <layer label="Topographic" type="tiled" visible="true" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/6e03e8c26aad4b9c92a87c1063ddb0e3/info/thumbnail/topo_map_2.jpg"/> <layer label="Streets" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thumbnail/tempstreets.jpg"/> <layer label="Light Gray Canvas" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/8b3b470883a744aeb60e5fff0a319ce7/info/thumbnail/templight_gray_canvas_with_labels__ne_usa.png"/> <layer label="Light Gray Canvas" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/8b3b470883a744aeb60e5fff0a319ce7/info/thumbnail/templight_gray_canvas_with_labels__ne_usa.png"/> <layer label="Terrain with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/aab054ab883c4a4094c72e949566ad40/info/thumbnail/tempTerrain_with_labels_ne_usa.png"/> <layer label="Terrain with Labels" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/aab054ab883c4a4094c72e949566ad40/info/thumbnail/tempTerrain_with_labels_ne_usa.png"/> <layer label="National Geographic" type="tiled" visible="false" url="http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer" icon="https://www.arcgis.com/sharing/rest/content/items/509e2d6b034246d692a461724ae2d62c/info/thumbnail/natgeo.jpg"/>


You can then add or remove base maps as you want

regards

Anthony
JamesMitchell_Jr_
Emerging Contributor
Thanks Anthony worked like a charm
0 Kudos
AnthonyGiles
Honored Contributor
James,

Please don't also forget to mark the post as answered by checking the tick on the thread you have marked up.

Thank you

Anthony
0 Kudos