質問

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,

役に立ちましたか?

解決

Looks like your service is in WGS84 (EPSG 4326); it must be in Web Mercator (EPSG 3857) to show up in Leaflet.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top