Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (44 sloc) 2.42 KB
<!DOCTYPE html>
<title>Azure Maps Raster Tiles in Leaflet JS - 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 Leaflet JS map control." />
<meta name="keywords" content="map, gis, API, SDK, tiles, raster, leaflet, leaflet.js" />
<meta name="author" content="Microsoft Azure Maps" />
<!-- Add references to the Leaflet JS map control resources. -->
<link rel="stylesheet" href=""
crossorigin="" />
<script src=""
<script type='text/javascript'>
var map;
function GetMap() {
map ='myMap').setView([0, 0], 2);
//Create a tile layer that points to the Azure Maps tiles.
L.tileLayer('{z}&x={x}&y={y}&subscription-key={subscriptionKey}', {
attribution: `© ${new Date().getFullYear()} TomTom, Microsoft`,
maxZoom: 22,
tileSize: 512,
zoomOffset: -1,
id: 'azuremaps.road',
crossOrigin: true,
subscriptionKey: '<Your Azure Maps Key>'
//Add your Azure Maps subscription key to the map SDK. Get an Azure Maps key at
<body onload="GetMap()">
<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>Raster Tiles in Leaflet JS</legend>
This sample shows how to render Azure Maps Raster Tiles in the <a href="">Leaflet JS map control</a>. <br/>
Tip: Use 512 tiles instead of 256 tiles as it generates 1/4th the tile requests.
You can’t perform that action at this time.