AnsweredAssumed Answered

ArcGIS API for JavaScript 4.0 - Problem viewing ArcGISTiledLayer

Question asked by j_kelly5 on Jan 8, 2016
Latest reply on Jan 8, 2016 by rscheitlin

Here is my code:

 

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">

<title>Get started with MapView - Create a 2D map</title></p>

<style>

  html, body {

    padding: 0;

    margin: 0;

  }

</style>

<link rel="stylesheet" href="https://js.arcgis.com/4.0beta3/esri/css/main.css">

<script src="https://js.arcgis.com/4.0beta3/"></script>

<script>

require([

  "esri/Map",

  "esri/views/MapView",

  "esri/layers/ArcGISTiledLayer",

  "dojo/domReady!"

], function(Map, MapView, ArcGISTiledLayer){

  var tiled = new ArcGISTiledLayer({ 

    url: "http://map.stjohns.ca/mapsrv/rest/services/Mapcentre/STJ_MC_Ortho_2013_MapService/MapServer",

    resampling: false

  });

  var map = new Map({

    //basemap: "streets",

    layers: [tiled]

  });

  var view = new MapView({

    container: "viewDiv",  //reference to the scene div created in step 5

    map: map,  //reference to the map object created before the scene

    zoom: 4,  //sets the zoom level based on level of detail (LOD)

    center: [-52.75, 47.6]  //sets the center point of view in lon/lat

  });

});

</script>

</head>

<body>

  <div id="viewDiv"></div>

</body>

</html>

 

It is almost directly from the ESRI sample pages.  I'm trying to show our local tiled map service layer in a map view.  I've set resampling to false because I was getting 404: file not found errors when tiles were being retrieved.  I've set a center lon/lat close to my area of interest.  I cannot see any tiles from the map service.  What am I doing wrong?

 

Thanks,

 

Jamie Kelly

Outcomes