Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thundersnow-spatial opened this issue Feb 3, 2014 · 3 comments

Comments

@thundersnow-spatial
Copy link

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

@jsoma
Copy link
Owner

jsoma commented Feb 6, 2014

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);
}
....

@thundersnow-spatial
Copy link
Author

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!!!

@reyemtm
Copy link

reyemtm commented Feb 25, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants