Reputation: 89
I am trying to show a map that I published using ArcGIS Server within a Leaflet map. I first tried to show the map as a basemap and creating a simple Leaflet TileLayer:
var aLayerSix = L.tileLayer('http://seasnail.csun.edu/ArcGIS/rest/services/GIS/Campus_Base/MapServer/tile/{z}/{y}/{x}.png', {
attribution: 'Map Tile © CSUN Geography'
});
I couldn't get the map. Then I tried to use Leaflet ESRI plugin:
var aLayerSix = L.esri.tiledMapLayer("http://seasnail.csun.edu/ArcGIS/rest/services/GIS/Campus_Base/MapServer/");
Still I cannot get the Leaflet to show the map. Here is the center of the map:
var centerlatlng = L.latLng(34.238716626866484, -118.52985978131983);
Cheers,
Upvotes: 2
Views: 2792
Reputation: 589
Looks like your service is in WGS84 (EPSG 4326); it must be in Web Mercator (EPSG 3857) to show up in Leaflet.
Upvotes: 1