I am trying my first attempt at adding an (in-house published) ArcGIS basemap to a Leaflet based web application, using Proj4Leaflet and esri-leaflet.
Here is my js:
var crs = new L.Proj.CRS('EPSG: 2263', '+proj=lcc +lat_1=40 +lat_2=41 +lat_0=40 +lon_0=-74 +x_0=984250 +y_0=0 +datum=NAD83 +units=us-ft +no_defs', { origin: [-120039300, 145506800], resolutions: [ 295.138888888889, 217.013888888889, 108.506944444444, 55.5555555555556, 27.7777777777778, 13.8888888888889, 6.94444444444444, 3.47222222222222, 1.73611111111111, 0.8671875]});var map = L.map('map',{ crs: crs }).setView([40.721, -73.994], 12);L.esri.tiledMapLayer('http://devserver/ArcGIS/rest/services/basemap/MapServer',{ maxZoom: 9, minZoom: 0}).addTo(map);All of the projections parameters came from the properties of the source mxd of the tiled map service. I tried integer-only values only because all the examples I found used integer values as well.I was not able to find definitive documentation on how to define the properties for different projections in an L.Proj.CRDS object, so I tried following examples I found online.
This code results in a blank page, and I receive the error 'Cannot read property 'divideBy' of undefined'. I am assuming something is missing or wrong in my reprojection parameters, but I haven't had any luck yet. Thanks for any help.
أكثر...
Here is my js:
var crs = new L.Proj.CRS('EPSG: 2263', '+proj=lcc +lat_1=40 +lat_2=41 +lat_0=40 +lon_0=-74 +x_0=984250 +y_0=0 +datum=NAD83 +units=us-ft +no_defs', { origin: [-120039300, 145506800], resolutions: [ 295.138888888889, 217.013888888889, 108.506944444444, 55.5555555555556, 27.7777777777778, 13.8888888888889, 6.94444444444444, 3.47222222222222, 1.73611111111111, 0.8671875]});var map = L.map('map',{ crs: crs }).setView([40.721, -73.994], 12);L.esri.tiledMapLayer('http://devserver/ArcGIS/rest/services/basemap/MapServer',{ maxZoom: 9, minZoom: 0}).addTo(map);All of the projections parameters came from the properties of the source mxd of the tiled map service. I tried integer-only values only because all the examples I found used integer values as well.I was not able to find definitive documentation on how to define the properties for different projections in an L.Proj.CRDS object, so I tried following examples I found online.
This code results in a blank page, and I receive the error 'Cannot read property 'divideBy' of undefined'. I am assuming something is missing or wrong in my reprojection parameters, but I haven't had any luck yet. Thanks for any help.
أكثر...