How can I construct a map object from a web map in Kotlin?

554
0
01-29-2018 09:10 AM
Oliver_Burdekin
Occasional Contributor II

I'd like to use a web map in an Android app built with Runtime SDK Android. I've followed the Kotlin tutorial for getting started which has worked. I've removed the "developer use only" tag by getting a license key (lite). From the docs I see it's possible to add web map (which I've created using ArcPro, shared to AGOL and made sure all data and the web map itself are public.

Runtime SDK Android docs state it's possible to add a web map URL using the following code:

ArcGISMap map = new ArcGISMap("URL/to/webmap");

To keep it Kotlin I've instead tried to do the following:

val map = ArcGISMap("https://burdgis-esri.maps.arcgis.com/home/item.html?id=9f65c604ad514295838b94d42911ae2a")
mapView.map = map

However, this is not working. No map is shown, only a blank space where it should be. Android studio is showing no errors in the build.

No doubt it's something very simple as I'm very new to Kotlin.

Update

Figured it out. I just needed to replace the burdgis-esri with www in the URL as the map is public.

0 Kudos
0 Replies