Select to view content in your preferred language

Using AGOL organisational basemaps - Issue in Viewer - Bjorn HELP!

2803
5
10-09-2012 05:17 PM
FraserHand
Frequent Contributor
Hi There,

We have discovered an issue in the Flex Viewer - v 3.0.

Basic version - we cannot display webmaps from an AGOL organisational account in the viewer in the basemap gallery - where you have changed the basemap group from the default Esri ones. Can we use our own webmaps from our AGOL account?

Long version
If you want to consume a web map from your AGOL organisational account, if you choose to add arcgisonline basemaps you only get the basemaps from the Esri group - not from any customised basemap groups you may have set. The issue is in protected function portal_loadedHandler(event:PortalEvent):void in PortalBasemapAppender.as where it sets the query to title:"ArcGIS Online Basemaps" AND owner:esri_en and there is no option to set this to your own organisation or groups. If you change this to be your organisation you can get your basemaps (which may or may not be webmaps) back, but then there is an issue with private function createBasemapLayerObject(itemData:Object, item:PortalItem):void - this method creates xml for comparison to add to the basemaps on the map. However it compares the Portal Item title with the basemap in the item title - which may be 2 different things. This means that the nested for loop in private function addBasemapsInOrder():void is never true and the maps don't get added to the basemaps collection; as the portal item title may never be the first basemap title. Now we can change all this by resetting the query and then changing how the layer xml is created, and this will add our organisations basemaps into the viewer. But then this breaks all the AGOL default ones as the control doesn't know how to handle them.

Thanks,
Fraser
Tags (2)
0 Kudos
5 Replies
MarcinDruzgala
Frequent Contributor
If I understand you correctly you want to add your own basemaps to your MapSwitcher Widget, yes? Check here: http://resources.arcgis.com/en/help/flex-viewer/concepts/#/Main_configuration_file/01m30000001800000...

I faced similar problem but making changes in PortalBasemapAppender.as is not necessary. Just set the addarcgisbasemaps="false" in config.xml and then use basemaps tags to add your basemaps and any other basemap layer you want(for example ESRI basemaps, Bing basemaps or OSM). In config.xml is should look like this:
<map  wraparound180="true" top="40" initialextent="your init extent" addarcgisbasemaps="false">
  <basemaps>
     <layer label="Aerial" type="tiled" visible="true" alpha="1"
                  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
     <layer label="Topo" type="tiled" visible="false" alpha="1"
                  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
            <layer label="Streets" type="tiled" visible="false" alpha="1"
                  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
            <layer label="Your_lay_name_1" type="tiled" visible="false" alpha="1"
                  url="your_URL_1"/>
             .....
            <layer label="Your_lay_name_N" type="tiled" visible="false" alpha="1"
                  url="your_URL_N"/>
                </basemaps>       

This should populate the MapSwitcher with your basemaps and ESRI basemaps. As I said, i'm not completely sure if this is what you are asking for but hope this helps. If not just ignore my post : ))

Cheers,
MDruzgala
0 Kudos
FraserHand
Frequent Contributor
Hi MDruzgala,
Thanks for the reply, I appreciate your thoughts. Yes I had seen that, but in this case it won't work for us. We don't want to manage the content through the Viewer configuration. We want it managed through AGOL - so the guys can make changes to the basemap gallery, and the main content webmap and see these in the viewer without having to manage configuration file changes. Once the viewer is deployed there will be no changes without a change control process which is lengthy and difficult. We also want to use the Esri map gallery and have the same Viewer populate with different webmaps in the long run.

Cheers,
Fraser
0 Kudos
Juan_CarlosFranco
Esri Contributor
Thank you for reporting this bug. Currently, the PortalBasemapAppender only supports ArcGIS Online basemaps, but we're looking into supporting alternate basemap sources for a future release.
0 Kudos
AnnieMayfield
Emerging Contributor
I do not have a portal, is there a way to add basemaps from ArcGISServer?
Thanks,
0 Kudos
AnthonyGiles
Honored Contributor
Annie,

If you want to add data from your own arcgis server add the following attribute to your map tag:

addarcgisbasemaps="false"

This will stop the online services being added. Then specify each layer you want to use from your server:

<layer label="layer name" type="dynamic" visible="true" alpha="1" url="http://yourserver/ArcGIS/rest/services/service_name/MapServer" icon="URL to icon" />

See:

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

Regards

Anthony
0 Kudos