pauloborges / meteor-mapbox

Mapbox.js for Meteor apps
43 stars 34 forks source link

Mapbox GL directions plugin not working #20

Open mahmoudkm opened 8 years ago

mahmoudkm commented 8 years ago

I am trying to load Mapbox GL with directions plugin support as shown below, yet I am always getting following errors. Also code I am using shown below. Thanks

  TypeError: mapboxgl.Directions is not a function
    at app.js:113
    at Tracker.Computation._compute (tracker.js:331)
    at Tracker.Computation._recompute (tracker.js:350)
    at Object.Tracker._runFlush (tracker.js:489)
    at onGlobalMessage (setimmediate.js:102)

 Uncaught ReferenceError: L is not defined    index.js:3 

Line 112 in app.js contains

map.addControl(new mapboxgl.Directions());

   Meteor.startup(function() {
     Mapbox.debug = true;
     Mapbox.load({
        gl: true,
        plugins: ['directions']
     });
   });
mahmoudkm commented 8 years ago

Update: Removing version constrain from the pauloborges:mapbox as shown below removed the Uncaught ReferenceError error, yet I still get

TypeError: mapboxgl.Directions is not a function

on the line

map.addControl(new mapboxgl.Directions());

any thoughts? Thanks


Removing version constraint:

Was using pauloborges:mapbox@2.2.3_2

now

pauloborges:mapbox