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

Use "include" Leaflet API for addind methods to L.Map #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yohanboniface
Copy link
Contributor

Just to stay closer from Leaflet own usages.
Thanks!

Yohan

@calvinmetcalf
Copy link
Contributor

when you do it that way then you can't do

var map = L.map('map').addHash();

because it's not in the prototype chain yet, you can only do

var map = L.map('map');
map.addHash();

@calvinmetcalf
Copy link
Contributor

ignore the previous comment, for both ways you have to set view before you can add the hash

@yohanboniface
Copy link
Contributor Author

We just need to add return this; to make it work.
I'll add it ;)

@calvinmetcalf
Copy link
Contributor

no this turns out to be a different issue, you get an error if you do

var map = L.map('map').addHash();

instead of

var map = L.map('map').setView([42.2, -71], 8).addHash();//or wherever

@calvinmetcalf
Copy link
Contributor

yeah my issue was actually part of #13

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

Successfully merging this pull request may close these issues.

2 participants