Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (56 sloc) 3.13 KB
<!DOCTYPE html>
<html lang="en">
<head>
<title>Raster Tiles in ArcGIS JS 4.6 - Azure Maps Web SDK Samples</title>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="IE=Edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="This sample shows how to render Azure Maps Raster Tiles in the ArcGIS version 4.6 JavaScript map control." />
<meta name="keywords" content="Microsoft maps, map, gis, API, SDK, tiles, raster, ArcGIS, ESRI" />
<!-- Add references to the ArcGIS map control JavaScript and CSS files. -->
<link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css" type="text/css" />
<script src="https://js.arcgis.com/4.6/"></script>
<script type='text/javascript'>
//Add your Azure Maps subscription key to the map SDK. Get an Azure Maps key at https://azure.com/maps
var subscriptionKey = '<Your Azure Maps Key>';
/*
Tileset ID specifies which data layers to render in the tiles. Can be:
'microsoft.base.road',
'microsoft.base.darkgrey',
'microsoft.imagery',
'microsoft.weather.infrared.main',
'microsoft.weather.radar.main',
'microsoft.base.hybrid.road',
'microsoft.base.labels.road '
*/
var tilesetId = 'microsoft.base.road';
//The language of labels. Supported languages: https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages
var language = 'en-US';
//The regional view of the map. Supported views: https://aka.ms/AzureMapsLocalizationViews
var view = 'Auto';
require(["esri/config", "esri/layers/WebTileLayer", "esri/Map", "esri/views/MapView", "dojo/dom", "dojo/domReady!"],
function (esriConfig, WebTileLayer, Map, MapView, dom) {
//Add the "atlas.microsoft.com" domain to the cors enabled servers list.
esriConfig.request.corsEnabledServers.push("atlas.microsoft.com");
var map = new Map();
var mapView = new MapView({
container: "myMap",
map: map
});
//Create a tile layer that points to the Azure Maps tiles.
var tiledLayer = new WebTileLayer({
urlTemplate: `https://atlas.azure.us/map/tile?subscription-key=${subscriptionKey}&api-version=2.0&tilesetId=${tilesetId}&zoom={level}&x={col}&y={row}&tileSize=256&language=${language}&view=${view}`,
copyright: ${new Date().getFullYear()} TomTom, Microsoft`
});
map.add(tiledLayer);
});
</script>
</head>
<body>
<div id="myMap" style="position:relative;width:100%;min-width:290px;height:600px;"></div>
<fieldset style="width:calc(100% - 30px);min-width:290px;margin-top:10px;">
<legend><h1 style="font-size:16px">Raster Tiles in ArcGIS JS 4.6</h1></legend>
This sample shows how to render Azure Maps Raster Tiles in the ArcGIS version 4.6 JavaScript map control.
</fieldset>
</body>
</html>
You can’t perform that action at this time.