I have a custom WMS tileset generated using ESRI ArcGIS Server.

I have successfully configured an OpenLayers page to display this basemap. The code is as follows:

var map = new OpenLayers.Map('map', {
    projection : "EPSG:3857",
    resolutions : [ 132.29193125052919, 92.604351875370426, 67.733468800270941, 33.866734400135471, 16.933367200067735, 8.4666836000338677, 4.2333418000169338, 2.1166709000084669, 1.0583354500042335, 0.52916772500211673, 0.26458386250105836 ],
    maxExtent : new OpenLayers.Bounds(-8352920.48698, 4887220.912586, -8082558.309632, 5067712.988343)

var basemap = new OpenLayers.Layer.WMS("basic_wm", "http://myhostname/geowebcache/service/wms/", {
    layers : 'basic_wm',
    format : 'image/jpeg'
    }, {
    tileOrigin : new OpenLayers.LonLat(-20037700, 30241100)

I am trying to reproduce the equivalent in Leaflet, but have so far been unsuccessful. I see that I can override the scale function and set a max zoom, but I am not certain how to override the scale function. I'm also wondering if I shouldn't be able to provide my DPI, tile origin, max extent, etc?

Here is what I have so far in Leaflet:

var map = new L.Map('map', {
     center: new L.LatLng(40.693726386087945, -73.9856945509795),
     zoom: 1

var basemap = new L.TileLayer.WMS("http://myhostname/geowebcache/service/wms/", 
        layers: 'basic_wm',
        attribution: "Copyright 2012 The City of New York",
        maxZoom: 10

As far as i see, there is no resolution, tile origin, max extent definition in mapOptions. i think they want to create an easy library for web mapping world. They already state that Leaflet is lightweight open-source JavaScript library....

I think it would be useful if you write needs here. - Ideas and Suggestions for Leaflet...

you should be content with this method now:


i hope it helps you...

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.