Export Tiles from built-in basemap in ArcGIS Runtime

2142
27
Jump to solution
09-19-2017 10:10 AM
NicholasLiccini
New Contributor II

Hi!

I would like to save a predefined area of interest of a MapView that can be loaded when there is no network connection. I tried following the ArcGIS Samples for "ExportTiles" but it keeps failing. I am not sure what the correct solution would be, but perhaps someone could provide the steps I should follow to export the map tiles.

Thank you!

Nick

0 Kudos
1 Solution

Accepted Solutions
LukeSmallwood
Esri Contributor

Hi Nicholas - which online basemap are you trying to export with? If you are using the standard base maps you will find that they do not support exporting tile packages. However, you can use the maps defined in this group instead: 

http://www.arcgis.com/home/group.html?id=3a890be7a4b046c7840dc4a0446c5b31#overview 

I hope that helps,

Luke

View solution in original post

0 Kudos
27 Replies
LukeSmallwood
Esri Contributor

Hi Nicholas - which online basemap are you trying to export with? If you are using the standard base maps you will find that they do not support exporting tile packages. However, you can use the maps defined in this group instead: 

http://www.arcgis.com/home/group.html?id=3a890be7a4b046c7840dc4a0446c5b31#overview 

I hope that helps,

Luke

0 Kudos
NicholasLiccini
New Contributor II

Okay I will use those. How do I access them from within the Runtime? I've tried copying the given URL and I keep getting an error message saying that there was an invalid token or unable to generate token

0 Kudos
LukeSmallwood
Esri Contributor

Hi Nicholas,

For exporting tiles from these services you will need to authenticate with an arcgisonline account.

This guide topic Access the ArcGIS platform—ArcGIS Runtime SDK for Qt | ArcGIS for Developers should give you some idea of how to go about authenticating your app. You probably want to look at the AuthenticationManager section. The API reference for that type (AuthenticationManager Class | ArcGIS for Developers ) also has some useful information.

Basically, you need to respond to the request for a token with some credentials - using the AuthenticationManager (singleton) with an AuthenticationView qml component will give you a sign in experience.

Does that make sense?

One question I had is whether this is a one time export (e.g. to prepare the data) or if this is something you would like your app to do ever time it runs?

I hope that helps,

Luke

0 Kudos
NicholasLiccini
New Contributor II

Thank you! I will look into this and try to get it working. 

To answer your question, I would like users to have the option to save the current view of the map for offline use at any time. For example, say you wanted to use the application in an area without network connection. The user could find that area and export it sometime before travelling to the area without internet. Does that make sense?

0 Kudos
LukeSmallwood
Esri Contributor

Hi Nicholas, that makes sense to me. You may also want to check out the OfflineMapTask (OfflineMapTask Class | ArcGIS for Developers ) for that workflow.

0 Kudos
NicholasLiccini
New Contributor II

Will do, I will let you know how this works out

Thanks!

0 Kudos
NicholasLiccini
New Contributor II

Hi again Luke,

I followed the guide for Authentication Manager and Authentication View setup in both the C++ and QML, but now I keep getting a strange error:

file:///C:/Program Files (x86)/ArcGIS SDKs/Qt100.1/sdk/toolkit/Import/Esri/ArcGISRuntime/Toolkit/Dia...: QML Connections: Cannot assign to non-existent property "onAuthenticationChallenge"

which is then followed by

file:///C:/Program Files (x86)/ArcGIS SDKs/Qt100.1/sdk/toolkit/Import/Esri/ArcGISRuntime/Toolkit/Dia...: Unable to assign [undefined] to QObject*

These both take me to the ArcGIS defined AuthenticationView QML file, and I can't seem to figure out why the signal does not properly display the view. I'm fairly sure that it is receiving the correct signal for a username/password. Am I missing some steps to handle the signal? I have registered the AuthenticationView and set it up following the sample on the ArcGIS Github

0 Kudos
LukeSmallwood
Esri Contributor

Hi Nicholas, have you registered the `AuthenticationManager` as a singleton and exposed it as a property from C++?

If you are able to share some of your code I may be able to see if there is a problem

0 Kudos
NicholasLiccini
New Contributor II

How do you register it as a singleton? I have declared it as a property from C++ following the example in ArcGISSamples->Cloud and Portal->Token Authentication

As of now the code is large and complex, but the part that deals with this topic is almost identical to that of the sample I mentioned above, save for a few variable names. 

0 Kudos