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

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
from

Conversation

Projects
None yet
2 participants
Contributor

yohanboniface commented Jan 15, 2013

Just to stay closer from Leaflet own usages.
Thanks!

Yohan

Contributor

calvinmetcalf commented Jan 15, 2013

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();
Contributor

calvinmetcalf commented Jan 15, 2013

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

Contributor

yohanboniface commented Jan 15, 2013

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

Contributor

calvinmetcalf commented Jan 15, 2013

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
Contributor

calvinmetcalf commented Jan 15, 2013

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