question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider support for MapLibreGL

See original GitHub issue

As it sounds like mapbox-gl is no longer open source: https://news.ycombinator.com/item?id=25347310

There’s a free software bazaar-style fork of mapbox-gl, maplibre-gl which I was early-on helping with: https://github.com/maplibre/maplibre-gl-js

NPM: https://www.npmjs.com/package/maplibre-gl

Is there a clean way we can support both with these bindings?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

2reactions
currancommented, Jan 6, 2021

Related (HT @klokan): https://github.com/visgl/react-map-gl/blob/master/docs/get-started/get-started.md#using-with-a-mapbox-gl-fork

From there:

Using with a mapbox-gl Fork

Install your choice of fork along with react-map-gl, for example:

npm i react-map-gl maplibre-gl

In your bundler’s configuration, set the forked library to replace any reference from mapbox-gl. This can be done in Webpack with something like:

// webpack.config.js
module.export = {
  // ...
  resolve: {
    alias: {
      'mapbox-gl': 'maplibre-gl'
    }
  }
}

In rollup:

// rollup.config.js
import alias from '@rollup/plugin-alias';

module.exports = {
  // ...
  plugins: [
    alias({
      entries: [
        { find: 'mapbox-gl', replacement: 'maplibre-gl' },
      ]
    })
  ]
};
0reactions
exaucaecommented, Dec 9, 2021

@jayarjo , have yu added the alias in tsconfig.json?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Check if MapLibre GL JS is supported
Check if MapLibre GL JS is supported. Use supported to check for MapLibre GL browser support, and show an alert if the browser...
Read more >
Check if MapLibre GL JS is supported
This article describes how to check if your browser supports MapLibre GL JS. MapLibre GL JS is based on Mapbox GL JS.
Read more >
Gatsby/Maplibre/Webpack-Error - Stack Overflow
I think your issue appears because of the webpack's transpilation. ... from "maplibre-gl" to import * as maplibregl from "maplibre-gl" .
Read more >
maplibre-gl | Yarn - Package Manager
... height: 300px;'></div> <script> var map = new maplibregl. ... on a free software alternative to mapbox-gl-js , please consider joining our effort!...
Read more >
Add a canvas source | Mapbox GL JS
<canvas id="canvasID" width="400" height="400">Canvas not supported</canvas>. <div id="map"></div>. <script>. // TO MAKE THE MAP APPEAR YOU MUST.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found