Select to view content in your preferred language

Reverse the order of display of basemaps

2324
6
Jump to solution
02-08-2012 09:17 AM
LefterisKoumis
Frequent Contributor
In another forum question (http://forums.arcgis.com/threads/49443-Basemap-own-and-esri-can-be-posted-together) it was determined that the easier way to display your own basemap along the esri basemaps is to place your basemap last, so that the LODs of the esri basemaps are set first. However, for display purposes on the map switcher, is there any way to reverse the way that the basemaps are displayed to show their labels in reverse order? To be clear, I am asking not to reverse the order of the basemaps in the config.xml file but the basemap labels in map switcher display, so my basemap is shown on left side of it.

Thank you.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

  So do you see anything displayed in your problems window in Flash Builder? I tested this on my end and it works fine...

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

  Do you have the ability to change code in the Viewer?
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

  Do you have the ability to change code in the Viewer?


Yes I do. I loaded up the source code of flexviewer in the adobe flash builder.

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   Than the cahnge is a simple as this, In the MapSwitcherWidget.mxml change this function as indicated below:

            private function initBasemapButtonBar():void
            {
                basemapList = new ArrayList();
                var labels:Array = [];
                for each (var basemap:Object in configData.basemaps.reverse())
                {
                    var label:String = basemap.label;
                    if (labels.indexOf(label) == -1) // avoid duplicates using the labels
                    {
                        labels.push(label);
                        basemapList.addItem(basemap);
                    }
                }

                if (basemapList.length <= 1)
                {
                    this.currentState = "noBasemaps";
                }
                else
                {
                    setBasemapButtonBarIndexToTopmostVisibleBasemap();
                }
            }


Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   Than the cahnge is a simple as this, In the MapSwitcherWidget.mxml change this function as indicated below:

            private function initBasemapButtonBar():void
            {
                basemapList = new ArrayList();
                var labels:Array = [];
                for each (var basemap:Object in configData.basemaps.reverse())
                {
                    var label:String = basemap.label;
                    if (labels.indexOf(label) == -1) // avoid duplicates using the labels
                    {
                        labels.push(label);
                        basemapList.addItem(basemap);
                    }
                }

                if (basemapList.length <= 1)
                {
                    this.currentState = "noBasemaps";
                }
                else
                {
                    setBasemapButtonBarIndexToTopmostVisibleBasemap();
                }
            }


Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:


I did just that and recompiled the website and now the map switcher is not displayed at all.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

  So do you see anything displayed in your problems window in Flash Builder? I tested this on my end and it works fine...
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

  So do you see anything displayed in your problems window in Flash Builder? I tested this on my end and it works fine...



THANK YOU. Yes, it does work! Sorry. I changed the source code of other mxml earlier trying to increase the width of the icon of only one widget and apparently the map switcher dissapeared as well. I will post the question for the icon width in another post. Thank you again.
0 Kudos