2

I'm following this example from the esri-leaflet docs.

I have an ArcGIS Tiled MapService in ESRI:102696. So I'm trying to use Proj4Leaflet to project the service and use it in my application.

I found some proj4defs here and here. They do differ slightly, but neither seems to work.

This is the Map Service I am trying to use.

I put together a JSBIN example with the code below.

  // The two proj4defs I found
  //var crs = new L.Proj.CRS('ESRI:102696', '+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192  no_defs', {
  var crs = new L.Proj.CRS('ESRI:102696', '+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.9999333333333333 +x_0=250000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs', {
    transformation: new L.Transformation(1, 17627100, -1, 19798600),
    resolutions: [
      303.8194444444444,
      217.01388888888889,
      86.80555555555556,
      65.10416666666666,
      43.40277777777778,
      20.833333333333332,
      8.680555555555555,
      4.166666666666666,
      2.083333333333333,
      1.0416666666666665,
      0.5208333333333333
    ]
  });
  // pass crs into map constructor
  var map = new L.Map('map', {
    crs: crs
  }).setView([38.5432816667, -90.2688116667], 5);  L.esri.tiledMapLayer('http://maps.stlouisco.com/ArcGIS/rest/services/Maps/PublicBase/MapServer', {
    maxZoom: 10,
    minZoom: 0,
    continuousWorld: true
  }).addTo(map);

I'm not sure if the transformation is off or what.

1

Rene,

there could be something else going on here as well, but its a problem that the service you are attempting to display has 512 pixel tiles (instead of 256).

Proj4Leaflet has a constructor option for L.Proj.CRS.TMS service providers to let you set tileSize explicitly, but not for L.Proj.CRS. Since ArcGIS Server is not a 'TMS' tile server it appears that the irregular size tiles chosen for that service are going to be problematic.

https://github.com/kartena/Proj4Leaflet#lprojcrstms

Also, i find it a lot more straightforward to set origin using the values exposed by ArcGIS Server than it is to muck about w/ transformations so i'm going to submit a PR to our repo to update the sample.

//transformation: new L.Transformation(1, 5120900, -1, 9998100),
origin: [-5120900, 9998100],  //same correct output
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.