Hi,
I have succeeded in adding a web map in App studio but when I replace the code with my company web map it doesn't work.
I'm completely new to this. How do I change the code to get organisational web maps to load?
Thanks in advance
App {
id: app
width: 414
height: 736
property real scaleFactor: AppFramework.displayScaleFactor
property string portalUrl: "https://myorganisation.maps.arcgis.com";
property string trailheadsItemID: "mycompanywebmapid"
Portal {
id: arcgisOnline
url: portalUrl
loginRequired: false
}
Solved! Go to Solution.
I think this sample would help you, https://community.esri.com/message/908251-re-simple-app-with-private-webmap?commentID=908251&et=watc...
Craig,
What sample or template in AppStudio are you using?
Erwin
I've tried a few. I just created this map : Add layers to a map | ArcGIS for Developers
If I substitute the feature layer and URL for my organisations then it doesn't show up. I'm just not sure how to get access to them. I registered and generated a client ID in settings>licencing>ArcGIS Client ID but do I have to do something else?
Are there any worked examples of this with screenshots?
I see, are you still using the item in ArcGIS Online or ArcGIS Enterprise? if you are using ArcGIS Online, keep the portalUrl the way it was,
property string portalUrl: "https://arcgis.com";
Is the item private or shared publicly? You would only need ArcGIS Client ID, if the item is private. If you are using ArcGIS Online, you can easily get the ArcGIS Client ID by going to Setting of the app > Licensing > ArcGIS Client ID > Register > Apply. Make sure the app is uploaded first.
Hi Erwin. It is shared privately. So here I added in my private URL (ArcGIS client ID is registered as above) in the exercise Add layers to a map | ArcGIS for Developers but only the public maps show.
property string parksURL: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space/FeatureServer/0"
property string trailsURL: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trails/FeatureServer/0"
property string parksURL: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Parks_and_Open_Space/FeatureServer/0"
ADDED IN (From URL link in AGOL) property string myfeaturelayernameURL: "https://services9.arcgis.com/my feature layer id/arcgis/rest/services/myfeaturelayername/FeatureServer"
Map{
id:map
BasemapImagery {}
FeatureLayer {
ServiceFeatureTable {
url: trailheadsURL
}
}
FeatureLayer {
ServiceFeatureTable {
url: parksURL
}
}
FeatureLayer {
ServiceFeatureTable {
url: trailsURL
}
}
FeatureLayer {
ServiceFeatureTable {
url:myfeaturelayernameURL
}
}
Sharing option is set as:
My organization NOT Not shared (private)
I think this sample would help you, https://community.esri.com/message/908251-re-simple-app-with-private-webmap?commentID=908251&et=watc...