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

Does not work with latest version of maplibre-gl-js #25

Closed
jimbok8 opened this issue Feb 26, 2022 · 8 comments · Fixed by #35
Closed

Does not work with latest version of maplibre-gl-js #25

jimbok8 opened this issue Feb 26, 2022 · 8 comments · Fixed by #35

Comments

@jimbok8
Copy link

jimbok8 commented Feb 26, 2022

I can get this library working with all versions of maplibre-gl-js upto and including 2.05.
After that I get TypeError error:
Uncaught TypeError: Cannot read properties of undefined (reading 'Map')
leaflet-maplibre-gl.js:128

I am I doing something wrong, or is there a fundamental change in maplibre-gl-js?
Jim

@carlos-mg89
Copy link

@jimbok8 how are you installing / adding Maplibre into your app?

I've simply executed npm i maplibre-gl@2.1.9 which got me this output:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: undefined@undefined
npm WARN Found: maplibre-gl@2.1.0
npm WARN node_modules/maplibre-gl
npm WARN   maplibre-gl@"2.1.9" from the root project
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer maplibre-gl@"^1.14.0" from @maplibre/maplibre-gl-leaflet@0.0.16
npm WARN node_modules/@maplibre/maplibre-gl-leaflet
npm WARN   @maplibre/maplibre-gl-leaflet@"^0.0.16" from the root project

added 4 packages, changed 1 package, and audited 1009 packages in 3s

16 packages are looking for funding
  run `npm fund` for details

1 high severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

The output made me think at first that I had the same issue as you experience. However, after compiling my code, it's running smoothly.

Perhaps you have misspelled the package version? I see you wrote 2.05, and not 2.0.5.

For me, this library is working fine with the following Maplibre-gl-js versions: 1.15.2, 2.0.5, 2.0.0 and 2.0.9

@ma7moudat
Copy link
Contributor

ma7moudat commented Nov 21, 2022

I'm facing a compilation issue trying to use the plugin with maplibre-gl@2.1.9 due the plugin trying to import MapboxOptions, which maplibre-gl no longer exports:

import { Map, MapboxOptions } from 'maplibre-gl';

Any plans to update the plugin?

@wipfli
Copy link
Contributor

wipfli commented Nov 21, 2022

It would be great if we could update the plugin. Are you interested in looking into this, @ma7moudat?

@ma7moudat
Copy link
Contributor

I had a quick go at it. Please have a look at #35

As far as I understood, I just needed to pump up the maplibre-gl version and fix the import, but I took the liberty to update leaflet and the examples as well. Everything seemed to still work while I tested.

I did everything as stated in the contribution guide, but unfortunately, running gh-release errors on my side and I don't have time to investigate that.

@ma7moudat
Copy link
Contributor

ma7moudat commented Nov 24, 2022

@lseelenbinder could you please make sure the fix is available on npm as 0.0.18? I pumped up the version number in package.json, but gh-release errored as I've mentioned before

@lseelenbinder
Copy link
Member

@ma7moudat I need to figure out who's responsible for this repository's releases. I haven't ever run the process, so I'm not sure. 😄

@lseelenbinder
Copy link
Member

@ma7moudat I think this is published now!

@ma7moudat
Copy link
Contributor

@ma7moudat I think this is published now!

It is; thank you :)

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 a pull request may close this issue.

5 participants