Select to view content in your preferred language

Map Switcher Widget 101

2641
6
Jump to solution
10-11-2012 02:47 PM
by Anonymous User
Not applicable
This is probably elemental but I couldn't find any mention of this in the tag reference (http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#//01m300000026000000) and digging through the code/configuration files only got me so far.  Basically I'm just looking for a way to change the default basemap when the 3.0 viewer comes up.  I was able to add back the tag

    <basemaps>
      <layer label="Streets" type="tiled" visible="true"  alpha="1"
            url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
    </basemaps>

to the main config.xml file to get Streets to come up by default but that had the side effect of doing away with the Streets thumbnail in the basemap switcher widget (possibly because I was using the wrong service?) ... Anyway, looking at the code itself I get the impression that if one were to explicitly list all of the desired basemaps in the config.xml or the MapSwitcherWidget.xml then one could get it to work as desired but details on this in the tag reference were pretty much non-existent and the sample application completely useless, so, can anybody tell me how this can (easily) be done?  Thanks in advance!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Bob,

   Well the reason that your streetmap that you manually specify is missing the thumbnail preview is the fact that you are not specifying the icon attribute of the basemaps layer tag.

Documentation here:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_tag/01m30000000p000000/

icon???Applicable for basemap layers. Specifies the location of the  icon displayed for this layer in the basemap gallery.  For example, the  "Streets" ArcGIS Online basemap icon's property reads as:
https://www.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thumbnail/te...



Hope this helps.

BTW: all widget and or Flex Viewer questions belong in the Flex Viewer forum not here in the Flex API Forum: http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Bob,

   Well the reason that your streetmap that you manually specify is missing the thumbnail preview is the fact that you are not specifying the icon attribute of the basemaps layer tag.

Documentation here:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_tag/01m30000000p000000/

icon???Applicable for basemap layers. Specifies the location of the  icon displayed for this layer in the basemap gallery.  For example, the  "Streets" ArcGIS Online basemap icon's property reads as:
https://www.arcgis.com/sharing/rest/content/items/d8855ee4d3d74413babfb0f41203b168/info/thumbnail/te...



Hope this helps.

BTW: all widget and or Flex Viewer questions belong in the Flex Viewer forum not here in the Flex API Forum: http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

0 Kudos
by Anonymous User
Not applicable
Well the reason that your streetmap that you manually specify is missing the thumbnail preview is the fact that you are not specifying the icon attribute of the basemaps layer tag ... Hope this helps.


Robert -

    That did the trick! Thanks for the quick reply. Just a couple quick follow-up questions if you don't mind: First, I went to see if I could directory browse where the one sample icon they gave lived (coincidentally the one I needed!) but it was disallowed - do you know where they have those resources available so that I don't have to screen grab the icons that are included with the application? Also, I played around with the <excludelayer> tag in the MapSwitcherWidget.xml (e.g. <excludelayer>Topographic</excludelayer>) and it didn't seem to work. Anything you can suggest about that? Thanks again! I'll go ahead and mark this answered and post following questions in the Viewer forum as per your recommendation but will check back to see if you had answers to these follow-up questions. Thanks again!

   - Bob
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bob,

   Sure, here is a post were I provide a zip of all the thumbnails:

http://forums.arcgis.com/threads/57890-MapSwitcher-Thumbnails-for-Streets-amp-Imagery?p=237142&viewf...

As far as the excludelayer that is only for operational layers.
0 Kudos
by Anonymous User
Not applicable
Thanks again Robert!  I still don't see why they would have exclude operational layers in the BaseMapSwitcher widget config file but I'm not going to get bogged down by details ....
0 Kudos
RhettZufelt
MVP Notable Contributor
Bob,

That is because the MapSwitcher also has the <layerlist visible=" "> tag.  If set to "true", you will get the "More" button with control over visibility of the operational layers, and you can "exclude" which of these show up under the "More" button. 

If you want to "exclude" basemaps, you can set addarcgisbasemaps="false" in the map tag, and just manually code the basemaps you want just like you did with the Streets basemap.

R_

the info can be found here: http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Map_Switcher_widget_tags/01m300...
0 Kudos
BjornSvensson
Esri Regular Contributor
I still don't see why they would have exclude operational layers in the BaseMapSwitcher widget config file but I'm not going to get bogged down by details ....


Just FYI about those details... that is because the Map Switcher Widget (despite its name) control both the basemaps and the operational layer (the "More..." is part of the Map Switcher widget).
0 Kudos