Hide Table of Contents
View Tiled map service sample in sandbox
Tiled map service

Description

Example of using an ArcGIS Server tiled map service.

Code

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>Tiled map service</title>
    <link rel="stylesheet" href="https://js.arcgis.com/3.23/esri/css/esri.css">
    <style>
      html, body, #map {
        height: 100%; width: 100%; margin: 0; padding: 0;
      }
    </style>

    <script src="https://js.arcgis.com/3.23/"></script>
    <script>
      var map;

      require(["esri/map", 
        "esri/layers/ArcGISTiledMapServiceLayer", 
        "esri/geometry/Point",
        "esri/SpatialReference",
        "dojo/domReady!"],
        function(Map, ArcGISTiledMapServiceLayer, Point, SpatialReference) {
          map = new Map("map", {
            center: new Point(1714791.187457787, 2194882.166227445, new SpatialReference({ wkid: 5936 }))
          });

          var tiled = new ArcGISTiledMapServiceLayer("https://services.arcgisonline.com/arcgis/rest/services/Polar/Arctic_Imagery/MapServer");
          map.addLayer(tiled);
        }
      );
    </script>
  </head>
  <body>
    <div id="map"></div>
  </body>
</html>