AnsweredAssumed Answered

Switching base maps with ArcGISTiledMapServiceLayer

Question asked by TSI-AR on Feb 26, 2015
Latest reply on May 18, 2015 by TSI-AR

I'm developing an app that runs on both Android and iOS.  My base map comes up just fine, but I want to be able to select between several sources and the solution is eluding me.

 

The mainMap function includes:

    Item{
          id: baseMap
         
property string source: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
       
}
    Map {
        id:mainMap
       
anchors.fill: parent
       
wrapAroundEnabled: true
        ArcGISTiledMapServiceLayer {
            url: baseMap.source
        }
    }

Within the main toolBar exists;

 

            ToolButton{
              
iconSource: getlayers_icon()

               onClicked: {

                    launchSelectBaseMapMenu()

                    mainMap.reset

                    mainMap.addLayer(baseMap.source)

                    console.log("Resetting Map")

               }

           }

 

LaunchSelectBaseMapMenu returns an updated baseMap.source, but I cannot identify how to set the TiledMapServiceLayer to the new path.  I've tried doing it directly with ArcGISTiledMapServiceLayer, and moved the reset and other things to various places with no impact.

 

I'm new to Qt/QML and ArcGIS, so I figure it probably is a simple oversight... any help is appreciated!

 

Chuck

Outcomes