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

Meteor 1.3: Can't find variable L #22

Open
jeroenbe opened this issue Jun 10, 2016 · 4 comments
Open

Meteor 1.3: Can't find variable L #22

jeroenbe opened this issue Jun 10, 2016 · 4 comments

Comments

@jeroenbe
Copy link

I'm trying to use this package in Meteor 1.3, yet I can't get it to work. Here is the code as I have it now:

Template.map.onRendered(function(){
    Mapbox.load({
        gl: true
    })

    this.autorun(function (){
        if(Mapbox.loaded()){            
            L.mapbox.accessToken = 'MY_ACCESS_KEY'
            var map = L.mapbox.map('map', 'mapbox://styles/mapbox/outdoors-v9')
        }
    })
})

Since this package is made for Meteor 1.2, I don't seem to need an import statement for the package in this file since Mapbox is defined. Yet L isn't.

@pauloborges
Copy link
Owner

Hi @jeroenbe, unfortunately I've stopped Meteor development for a long time and don't have time to support this package anymore. I'll put a warning on the README.

@jeroenbe
Copy link
Author

@pauloborges that's to bad. Any reason why you stopped?

@guillaume-miara
Copy link

The package works just fine for me on Meteor 1.3
I believe that if L is showing as undefined it is because Mapbox is missing.

Do you load it on startup?

Meteor.startup(function() { Mapbox.load(); });

@nicooprat
Copy link

Mapbox GL doesn't use Leaflet (the L variable). You need to write it like this:

mapboxgl.accessToken = '...';
map = new mapboxgl.Map({
...
});

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

4 participants