forked from maplibre/maplibre-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pluggable-render
* main: (98 commits) [Jest] Migrate `geojson_worker_source.test.js` (maplibre#731) Fix events being fired after Map#remove has been called when the WebGL context is lost and restored (maplibre#726) (maplibre#727) Define return type of getSource as possibly undefined (maplibre#724) Fix attibution controll (maplibre#668) Fix start-debug to watch ts files (maplibre#704) [Jest] Migrate `touch_zoom_rotate.test.js` (maplibre#721) [Jest] Migrate `requestRenderFrame.test.js` (maplibre#722) [Jest] Migrate `scroll_zoom.test.js` (maplibre#712) [Jest] Migrate `marker.test.js` (maplibre#696) [Jest] Migrate `mouse_rotate.test.js` (maplibre#711) [Jest] Migrate `keyboard.test.js` (maplibre#707) [Jest] Migrate `map_event.test.js` (maplibre#710) [Jest] Migrate `drag_rotate.test.js` (maplibre#709) Handle spies and call counts (maplibre#708) [Jest] Migrate `drag_pan.test.js` (maplibre#702) Add type for styleimagemissing event (maplibre#703) Fix MapDataEvent#isSourceLoaded being true in GeoJSONSource "dataloading" event handlers (maplibre#694) (maplibre#695) [Jest] Migrate `dblclick_zoom.test.js` (maplibre#697) [Jest] Migrate `popup.test.js` (maplibre#687) Fixed typo (maplibre#698) ...
- Loading branch information
Showing
178 changed files
with
13,302 additions
and
11,434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,16 @@ about: Report a bug | |
<!-- | ||
Hello! Thanks for contributing. For the fastest response and resolution, please: | ||
- Make the issue title a succinct but specific description of the unexpected behavior. Bad: "Map rotation is broken". Good: "map.setBearing(...) throws a TypeError for negative values" | ||
- Include a link to a minimal demonstration of the bug. We recommend using https://jsbin.com. | ||
- Make the issue title a succinct but specific description of the unexpected behavior. | ||
Bad: "Map rotation is broken". | ||
Good: "map.setBearing(...) throws a TypeError for negative values" | ||
- Include a link to a minimal demonstration of the bug – more below … | ||
- Ensure you can reproduce the bug using the latest release. | ||
- Check the console for relevant errors and warnings | ||
- Only post to report a bug. For feature requests, please use https://github.com/maplibre/maplibre-gl-js/issues/new?template=Feature_request.md instead. Direct all other questions to https://stackoverflow.com/questions/tagged/maplibre-gl-js | ||
--> | ||
|
@@ -28,10 +34,15 @@ Hello! Thanks for contributing. For the fastest response and resolution, please | |
### Link to Demonstration | ||
|
||
<!-- | ||
Providing a minimal, complete, verifiable demonstration *dramatically* improves maintainers' and other community members' ability to understand and address the problem you're reporting. (See https://stackoverflow.com/help/mcve for guidelines on creating an effective example.) | ||
--> | ||
Providing a minimal, complete, verifiable demonstration *dramatically* improves maintainers' and other community members' ability to understand and address the problem you're reporting. | ||
We recommend using https://jsbin.com. | ||
https://jsbin.com/ | ||
Consider using the non-minified version for this demo to create better error messages. | ||
E.g. `<script src='https://unpkg.com/[email protected]/dist/maplibre-gl-dev.js'></script><link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' />` | ||
See https://stackoverflow.com/help/mcve for guidelines on creating an effective example. | ||
--> | ||
|
||
### Expected Behavior | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,75 @@ | ||
# MapLibre GL | ||
|
||
**MapLibre GL** is a community led fork derived from [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) prior to their switch to a non-OSS license. | ||
**MapLibre GL** is a community-led fork derived from [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) before their switch to a non-OSS license. | ||
|
||
### Migrating from mapbox-gl | ||
|
||
If you depend on mapbox-gl directly, simply replace `mapbox-gl` with `maplibre-gl` in `package.json`: | ||
|
||
Use | ||
|
||
```diff | ||
"dependencies": { | ||
- "mapbox-gl": "^1.13.0" | ||
+ "maplibre-gl": ">=1.14.0" | ||
+ "maplibre-gl": ">=1.15.2" | ||
} | ||
``` | ||
|
||
And replace ```mapboxgl``` with ```maplibregl``` in your JavaScript and optionally in your HTML/CSS code: | ||
if it is important to you that the behaviour is similar to `mapbox-gl` version 1.x. | ||
|
||
And replace `mapboxgl` with `maplibregl` in your JavaScript and optionally in your HTML/CSS code: | ||
|
||
> MapLibre GL JS is distributed via [unpkg.com](https://unpkg.com). For more informations please see [MapLibre GL is on unpkg.com](./docs/README-unpkg.md#maplibre-gl-on-unpkgcom). | ||
```diff | ||
- <script src="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.js"></script> | ||
- <link | ||
- href="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.css" | ||
- rel="stylesheet" | ||
- /> | ||
|
||
<!-- Use maplibre-gl version 1.15.2 for backwards compatibility with mapbox-gl version 1.x. --> | ||
+ <script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script> | ||
+ <link | ||
+ href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" | ||
+ rel="stylesheet" | ||
+ /> | ||
|
||
- var map = new mapboxgl.Map({ | ||
+ var map = new maplibregl.Map({ | ||
|
||
- <button class="mapboxgl-ctrl"> | ||
+ <button class="maplibregl-ctrl"> | ||
``` | ||
|
||
Want an example? Have a look at the official [MapLibre GL JS Documentation](https://maplibre.org/maplibre-gl-js-docs/example/). | ||
Want an example? Have a look at the official [MapLibre GL JS Documentation](https://maplibre.org/maplibre-gl-js-docs/example/). | ||
|
||
Use MapLibre GL JS bindings for React (https://visgl.github.io/react-map-gl/docs/get-started/get-started#using-with-a-mapbox-gl-fork) and Angular (https://github.com/maplibre/ngx-maplibre-gl). Find more at [awesome-maplibre](https://github.com/maplibre/awesome-maplibre). | ||
|
||
### Roadmap | ||
|
||
This project's initial plans are outlined in the [Roadmap](https://github.com/maplibre/maplibre-gl-js/projects/2) project. The primary goal is consistency and backwards-compatability with previous releases and continued bug-fixes and maintenance going forward. | ||
This project's initial plans are outlined in the [Roadmap](https://github.com/maplibre/maplibre-gl-js/projects/2) project. The primary goal is consistency and continued bug fixes and maintenance as we advance. | ||
|
||
> **MapLibre GL** is developed following [Semantic Versioning (2.0.0)](http://semver.org/spec/v2.0.0.html). | ||
### Getting Involved | ||
|
||
Join the #maplibre slack channel at OSMUS: get an invite at https://osmus-slack.herokuapp.com/ | ||
|
||
### Community Leadership | ||
|
||
The official status of the backing community and steering committee can be found in the [COMMUNITY.md](COMMUNITY.md) document. | ||
You can find the official status of the backing community and steering committee in the [COMMUNITY.md](COMMUNITY.md) document. | ||
|
||
### Avoid Fragmentation | ||
|
||
If you depend on a free software alternative to `mapbox-gl-js`, please consider joining our effort! Anyone with a stake in a healthy community led fork is welcome to help us figure out our next steps. We welcome contributors and leaders! MapLibre GL already represents the combined efforts of a few early fork efforts, and we all benefit from "one project" rather than "our way". If you know of other forks, please reach out to them and direct them here. | ||
If you depend on a free software alternative to `mapbox-gl-js`, please consider joining our effort! Anyone with a stake in a healthy community-led fork is welcome to help us figure out our next steps. We welcome contributors and leaders! MapLibre GL already represents the combined efforts of a few early fork efforts, and we all benefit from "one project" rather than "our way". If you know of other forks, please reach out to them and direct them here. | ||
|
||
### Thank you Mapbox 🙏🏽 | ||
|
||
We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source achievment which now lives on as `maplibre-gl`. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽♀️. | ||
We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source achievement which now lives on as `maplibre-gl`. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽♀️. | ||
|
||
Please keep in mind: Unauthorized backports are the biggest threat to the MapLibre project. It is unacceptable to backport code from mapbox-gl-js, which is not covered by the former BSD-3 license. If you are unsure about this issue, [please ask](https://github.com/maplibre/maplibre-gl-js/discussions)! | ||
|
||
## License | ||
|
||
MapLibre GL is licensed under the [3-Clause BSD license](./LICENSE.txt). | ||
**MapLibre GL** is licensed under the [3-Clause BSD license](./LICENSE.txt). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default function glsl_to_js(code, minify) { | ||
if (minify) { | ||
code = code.trim() // strip whitespace at the start/end | ||
.replace(/\s*\/\/[^\n]*\n/g, '\n') // strip double-slash comments | ||
.replace(/\n+/g, '\n') // collapse multi line breaks | ||
.replace(/\n\s+/g, '\n') // strip identation | ||
.replace(/\s?([+-\/*=,])\s?/g, '$1') // strip whitespace around operators | ||
.replace(/([;\(\),\{\}])\n(?=[^#])/g, '$1'); // strip more line breaks | ||
|
||
} | ||
return `export default ${JSON.stringify(code)};`; | ||
} |
Oops, something went wrong.