Select to view content in your preferred language

Vector Tile Server World Imagery (WGS84) v2

1405
4
02-22-2022 01:08 AM
AJThomas
Emerging Contributor

Hello, 

I have been tasked with figuring out how to add the new Vector Tile Layers (WGS84 - v2) to our JavaScript API map app.

I cannot figure out how to add the World Imagery vector map.
https://www.arcgis.com/home/item.html?id=898f58f2ee824b3c97bae0698563a4b3

The below works; I was able to load the World_Basemap_GCS_v2 map:

 

var vtlayer = new VectorTileLayer("https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_GCS_v2/VectorTileServer");

 

But I cannot figure out what the magic key word is for the World Imagery basemap?

I cannot find anyway to see what  basemaps are available on the vector tile server either.  Or maybe it is just not possible to load the newer World Imagery WGS84 vector basemap using the JavaScript API??

If anyone can help me find the correct URL or let me know it is just not possible, it would be greatly appreciated.

Thanks,  
~AJ

0 Kudos
4 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

This item is NOT a VectorTileLayer: https://www.arcgis.com/home/item.html?id=898f58f2ee824b3c97bae0698563a4b3

If you scroll down on the description page, you will see the URL to the service: 

Screen Shot 2022-02-22 at 12.02.26 PM.png


As you can see this a cached map service and you need to use TileLayer to add this your map. 

const tiledLayer = new TileLayer({
  url: "https://wi.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"
});

 

0 Kudos
AJThomas
Emerging Contributor

Undral, 

Thanks! I did not realize it was a different type of layer.

Ultimately my goal is to load the World Imagery (WGS84) and add the vector layer Hybrid Reference Layer (WGS84) over the top of it, using the JavaScript API 3.38. 

However, the service links at the bottom of the World Imagery (WGS84) page seem to be broken. They only give me errors. The comments at the bottom of the page suggest that others have had this problem also.

-------------------------
Broken-World-Imagery-Links.png

-------------------------

If possible, can you give me a url that works and the type of layer to use for the JavaScript API 3.38.

I don't have access to the TileLayer type but I have had some success with using the ArcGISTiledMapServiceLayer.  Will this work?

Please let me know if you can help me or if I should open a new question.

Many Thanks,

~AJ

0 Kudos
UndralBatsukh
Esri Regular Contributor

Not sure what you mean by the service url is broken. 

You can do this the following to achieve what you are asking in 3.38

 

var tiled = new ArcGISTiledMapServiceLayer("https://wi.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer");
map.addLayer(tiled);
          
var vtl = new VectorTileLayer("https://www.arcgis.com/sharing/rest/content/items/a70340a048224752915ddbed9d2101a7/resources/styles/root.json");
map.addLayer(vtl);

 

 

AJThomas
Emerging Contributor

Undral, 

Thanks soooo much!  It worked perfectly!

What I meant by url is broken is that when I tried to put the link for World Imagery into the browser it would give me a 404 error,  

"The requested URL /ssldir/rest/services/World_Imagery/MapServer was not found on this server."

I'm all straightened out now, thanks again.

~AJ

 

0 Kudos