Hello Everyone,
I am new to the ArcGIS community, I Need Help!
How we can load web map using Web Map Specification or how we can initialize web map using JSON in the new ArcGIS 100.10 framework.
Do you need to load the JSON, or do you just need top open a web map?
If you just need to open a web map, you can see this tutorial: https://developers.arcgis.com/ios/maps-2d/tutorials/display-a-web-map/
If you need to take web map JSON and work with that directly, you can also use AGSMap.fromJSON().
Thanks for the response.
While using AGSMap.fromJSON(), unable to open map in mobile.
maybe this is occurring due to credentials, if yes then could you please share some samples how we can set credentials to the map.
attaching sample code:
do {
let test = try AGSMap.fromJSON(self.mapJSON!["itemData"] as Any)
print(test)
self.mapView.map = test as? AGSMap
} catch {
print(error)
}
It's hard to know without understanding how you are getting the JSON. Can you explain a little about that please? Where is the JSON coming from? How are you reading it?
But you could try a couple of things:
However, I would still like to understand how you are getting the JSON and whether you can just create an AGSPortalItem and construct the AGSMap from that.
Thank you so much, this works for me.