Leaflet.label icon indicating copy to clipboard operation
Leaflet.label copied to clipboard

Update npm with the latest Leaflet.label version (fixes Browserify)

Open luqmaan opened this issue 10 years ago • 8 comments

I am including both Leaflet and Leaflet.label through browserify.

But I get this error:

Uncaught TypeError: Cannot set property 'labelVersion' of undefined leaflet.label.js:15

It seems like Leaflet.label is being passed {} instead of window variable.

I added some logging dist/leaflet.label.js:

!function(t){
    console.log('L', window.L);
    console.log('t', t);
    console.log('args', arguments);
    console.log('t.L', t.L);
    console.log('t === window', t === window);
   var e=t.L;e.labelVersion="0.2.2-dev",.....

The console shows the following:

L Object {version: "0.7.2", noConflict: function, Util: Object, extend: function, bind: function…} leaflet.label.js:10
t Object {} leaflet.label.js:11
args [Object, document] leaflet.label.js:12
t.L undefined leaflet.label.js:13
t === window false leaflet.label.js:14
Uncaught TypeError: Cannot set property 'labelVersion' of undefined leaflet.label.js:15

I'm using Leaflet-label here: https://github.com/luqmaan/MetroRappid/commit/d3aa02312b633b75194418cbc45d58dfe505c841

luqmaan avatar Oct 09 '14 15:10 luqmaan

I'm getting this error because the version of Leaflet.label published on npm is out of date.

The npm version (last updated Jul 14 2014) doesn't have the fix from #89 (merged Aug 1 2014).

Can you please update npm with the latest leaflet-label?

luqmaan avatar Oct 15 '14 20:10 luqmaan

Unfortunately I do not own the npm package for leaflet-label. I'll get in contact with the current own and ask if he will transfer it.

jacobtoye avatar Nov 24 '14 01:11 jacobtoye

:koala:

luqmaan avatar Nov 24 '14 01:11 luqmaan

:+1: Have just ran into this issue myself.

optical avatar Feb 11 '15 00:02 optical

i did as well, can someone publish the package to npm? /cc @pitbeast looks like you have ownership

wavded avatar Feb 12 '15 17:02 wavded

Any news on this, @PitBeast ?

pieterjandesmedt avatar Apr 27 '15 07:04 pieterjandesmedt

For the moment you can just install Leaflet.label from GitHub instead of the npm repository with

npm i --save Leaflet/Leaflet.label

then in your javascript

require('leaflet.label');

pieterjandesmedt avatar Apr 27 '15 09:04 pieterjandesmedt

Seems like always pulling npm modules from github would be a smart choice ...

neurosnap avatar Apr 29 '15 13:04 neurosnap