mapsheet icon indicating copy to clipboard operation
mapsheet copied to clipboard

How do you add a Mapsheet layer to an existing Leaflet project?

Open thundersnow-spatial opened this issue 11 years ago • 3 comments

Hi,

Love this project, but am wondering how to add a Mapsheet layer to an existing leaflet project I have going (using CartoDB, Mapbox, etc.).

I'm looking at the code, but wondering if there's an easy way to take the layer you're creating and add it as I do other leaflet layers, for example:

L.tileLayer('http://a.tiles.mapbox.com/v3/openingofdetroit.map-jnh32hc9/{z}/{x}/{y}.png').addTo(map);

Any thoughts appreciated, and I realize this isn't an issue, but don't know where else to post...

Thank you!!!

-m

thundersnow-spatial avatar Feb 03 '14 22:02 thundersnow-spatial

You can use mapsheet.renderer.map to get the rendered map after it draws - if you pass a callback to a new Mapsheet object you should be good to go

....
provider: Mapsheet.Providers.Leaflet,
callback: function(mapsheet, tabletop) {
  L.tileLayer('http://a.tiles.mapbox.com/v3/openingofdetroit.map-jnh32hc9/{z}/{x}/{y}.png').addTo(mapsheet.renderer.map);
}
....

jsoma avatar Feb 06 '14 14:02 jsoma

Hey Jonathan, I'm not the most savvy programmer, and as a result can't really get this going. If you have a spare moment and can post a sample of this solution, I would greatly appreciate... thank you very much!!!

thundersnow-spatial avatar Feb 07 '14 17:02 thundersnow-spatial

Same question...I just want to add points from a google spreadsheet as one of the many layers in a leaflet map...it looks like this was possible with the old google spreasheets through the use of xml feeds but not anymore? so I was looking to mapsheet/tabletop to create the layer...but I cannot figure out how to just get the geojson layer only and not a whole map via mapsheet - maybe I am missing something simple - thanks

reyemtm avatar Feb 25 '15 18:02 reyemtm