Skip to content

Instantly share code, notes, and snippets.

@klokan
Last active September 3, 2016 06:58
Show Gist options
  • Save klokan/9835621 to your computer and use it in GitHub Desktop.
Save klokan/9835621 to your computer and use it in GitHub Desktop.
ArcGIS MapTiler
<!DOCTYPE html>
<html>
<head>
<title>ArcGIS JavaScript API viewer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<style>
html, body, #map {width:100%; height:100%; margin:0; padding:0; }
</style>
<script src="http://js.arcgis.com/3.8/"></script>
<script>
var map;
require([
"esri/map", "esri/geometry/Extent", "esri/layers/WebTiledLayer"
], function(
Map, Extent, WebTiledLayer
) {
var mapBounds = new esri.geometry.Extent({
xmin: -112.26379395, ymin: 35.98245136,
xmax: -112.10998535, ymax: 36.13343831,
spatialReference:{wkid:4326} });
var mapMinZoom = 10;
var mapMaxZoom = 16;
map = new Map("map", {
basemap: "national-geographic", // streets | satellite | hybrid | topo | gray | oceans | national-geographic | osm
smartNavigation: false,
extent:mapBounds,
fitExtent:true
});
var maptiler = new WebTiledLayer("http://tileserver.maptiler.com/grandcanyon/${level}/${col}/${row}.png", {
copyright: "Tiles by <a href='http://www.maptiler.com'>MapTiler</a>",
id: "MapTiler",
opacity: 0.8
});
map.addLayer(maptiler);
});
</script>
</head>
<body>
<div id="map">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment