ArcGISTiledLayer will not load

540
2
Jump to solution
09-21-2017 08:11 AM
NicholasLiccini
New Contributor II

Hi!

I am trying to use the following URL to create an instance of ArcGISTiledLayer but the map will not load. I think it has to do with needing credentials to use this particular URL, but even passing a Credential object does not fix the issue.

Maybe I am approaching this in the wrong way, but it seems like this should work:

serviceUrl_ = QUrl("https://tiledbasemaps.arcgis.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer");
Credential* creds = new Credential(username, password, this);
ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(serviceUrl_, creds, this);
Basemap* basemap = new Basemap(tiledLayer, this);
p_Map_ = new Map(basemap, this);
p_MapView_->setMap(p_Map_);
0 Kudos
1 Solution

Accepted Solutions
KoushikHajra
Esri Contributor

Hi,

The url you provided is not for viewing.  Here's the correct one: Canvas/World_Light_Gray_Base (MapServer) .  Also, there is an issue with authentication and we have it logged in our system to take a look.  

Thank you!

View solution in original post

2 Replies
KoushikHajra
Esri Contributor

Hi,

The url you provided is not for viewing.  Here's the correct one: Canvas/World_Light_Gray_Base (MapServer) .  Also, there is an issue with authentication and we have it logged in our system to take a look.  

Thank you!

NicholasLiccini
New Contributor II

That URL works for viewing like you said, and now I have another issue with this. I would like to create an ExportTileCacheTask using this URL but it gives me an error message saying that this map is not for export. I had thought that the one in my original post supported export (I don't need to use that link for viewing if I am able to to export it as a .tpk file), but it keeps giving me errors saying that it was unable to generate a token from my credentials.

Is this a server problem with ArcGIS or is this part of my code that is causing the issue?

0 Kudos