Skip to content

Commit

Permalink
Merge branch 'main' into globe
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Jun 17, 2024
2 parents a25074d + ba8015f commit dbf6173
Show file tree
Hide file tree
Showing 29 changed files with 379 additions and 318 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/docs/API
/docs/examples
/docs/example
.cache/
*.es.js
*.js.map
node_modules
Expand Down
4 changes: 1 addition & 3 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"at-rule-no-unknown": [true, {
"ignoreAtRules": ["svg-load"]
}],
"property-no-vendor-prefix": [true, {
"ignoreProperties": ["/user-select/"]
}],
"property-no-vendor-prefix": true,
"function-no-unknown": [true, {
"ignoreFunctions": ["svg-load", "svg-inline"]
}]
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"stylelint.vscode-stylelint"
]
}
}
24 changes: 17 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
## main

### ✨ Features and improvements
- _...Add new stuff here..._

### 🐞 Bug fixes
- Fix `terrain` listener memory leak when adding and removing Marker ([#4284](https://github.com/maplibre/maplibre-gl-js/pull/4284))
- _...Add new stuff here..._

## 4.4.0

### ✨ Features and improvements

- Improve animation curve when easeTo and flyTo with constraints ([#3793](https://github.com/maplibre/maplibre-gl-js/pull/3793))
- For filled extrusions, calculate the elevation per polygon (see issue [#3313](https://github.com/maplibre/maplibre-gl-js/issues/3313))
- For filled extrusions, calculate the elevation per polygon ([#3313](https://github.com/maplibre/maplibre-gl-js/issues/3313))
- Add events to `GeolocateControl` to allow a more granular interaction ([#3847](https://github.com/maplibre/maplibre-gl-js/pull/3847))
- Make `MapOptions.style` optional to be consistent with `Map.setStyle(null)` ([#4151](https://github.com/maplibre/maplibre-gl-js/pull/4151))
- Use Autoprefixer to handle vendor prefixes in CSS ([#4165](https://github.com/maplibre/maplibre-gl-js/pull/4165))
- Make `aria-label` configurable for Map, Marker and Popup [#4147](https://github.com/maplibre/maplibre-gl-js/pull/4147)
- Map `<canvas>` is focusable only when interactive [#4147](https://github.com/maplibre/maplibre-gl-js/pull/4147)
- "Accept" headers set in Request Transformers are not overwritten [#4210](https://github.com/maplibre/maplibre-gl-js/pull/4210)

- _...Add new stuff here..._
- Make `aria-label` configurable for Map, Marker and Popup ([#4147](https://github.com/maplibre/maplibre-gl-js/pull/4147))
- Map `<canvas>` is focusable only when interactive ([#4147](https://github.com/maplibre/maplibre-gl-js/pull/4147))
- "Accept" headers set in Request Transformers are not overwritten ([#4210](https://github.com/maplibre/maplibre-gl-js/pull/4210))
- ⚠️ Rename projMatrix to modelViewProjectionMatrix. Also rename invProjMatrix, alignedProjMatrix accordingly ([#4215](https://github.com/maplibre/maplibre-gl-js/pull/4215))
- Publish an unminified prod build ([#4265](https://github.com/maplibre/maplibre-gl-js/pull/4265))

### 🐞 Bug fixes

- ⚠️ Allow breaking lines in labels before a left parenthesis ([#4138](https://github.com/maplibre/maplibre-gl-js/pull/4138))
- ⚠️ Fix ignoring embedded line breaks when `symbol-placement` is `line` or `line-center` ([#4124](https://github.com/maplibre/maplibre-gl-js/pull/4124))
- _...Add new stuff here..._
- Ensure loseContext exists before calling it ([#4245](https://github.com/maplibre/maplibre-gl-js/pull/4245))
- Update deprecated `-ms-high-contrast` vendor prefix to `(forced-colors: active)` and `(prefers-color-scheme: light)` as appropriate ([#4250](https://github.com/maplibre/maplibre-gl-js/pull/4250))

## 4.3.2

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Install the Xcode Command Line Tools Package
xcode-select --install
```

Install [node.js](https://nodejs.org/) version ^18
Install [node.js](https://nodejs.org/) version in [.nvmrc](.nvmrc)
```bash
brew install node
```
Expand Down Expand Up @@ -138,7 +138,7 @@ Before you can [run the docs](./docs/README.md), you need to ensure Docker is in

Consider using WSL and follow the above Linux guide or follow the next steps

Install [git](https://git-scm.com/), [node.js](https://nodejs.org/) (version ^18), [npm and node-gyp](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules).
Install [git](https://git-scm.com/), [node.js](https://nodejs.org/) (version in [.nvmrc](.nvmrc)), [npm and node-gyp](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules).

Clone the repository
```bash
Expand Down
6 changes: 3 additions & 3 deletions build/generate-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function generateMarkdownIndexFileOfAllExamples(indexArray: HtmlDoc[]): string {
indexMarkdown += `
## [${indexArrayItem.title}](./${indexArrayItem.mdFileName})
![${indexArrayItem.description}](../assets/examples/${indexArrayItem.mdFileName!.replace('.md', '.png')})
![${indexArrayItem.description}](../assets/examples/${indexArrayItem.mdFileName!.replace('.md', '.png')}){ loading=lazy }
${indexArrayItem.description}
`;
Expand Down Expand Up @@ -85,12 +85,12 @@ function generateExamplesFolder() {
fs.mkdirSync(examplesDocsFolder);
const examplesFolder = path.join('test', 'examples');
const files = fs.readdirSync(examplesFolder).filter(f => f.endsWith('html'));
const maplibreUnpgk = `https://unpkg.com/maplibre-gl@${packageJson.version}/`;
const maplibreUnpkg = `https://unpkg.com/maplibre-gl@${packageJson.version}/`;
const indexArray = [] as HtmlDoc[];
for (const file of files) {
const htmlFile = path.join(examplesFolder, file);
let htmlContent = fs.readFileSync(htmlFile, 'utf-8');
htmlContent = htmlContent.replace(/\.\.\/\.\.\//g, maplibreUnpgk);
htmlContent = htmlContent.replace(/\.\.\/\.\.\//g, maplibreUnpkg);
htmlContent = htmlContent.replace(/-dev.js/g, '.js');
const htmlContentLines = htmlContent.split('\n');
const title = htmlContentLines.find(l => l.includes('<title'))?.replace('<title>', '').replace('</title>', '').trim()!;
Expand Down
4 changes: 2 additions & 2 deletions build/rollup_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const nodeResolve = resolve({
preferBuiltins: false
});

export const plugins = (production: boolean): Plugin[] => [
export const plugins = (production: boolean, minified: boolean): Plugin[] => [
json(),
// https://github.com/zaach/jison/issues/351
replace({
Expand All @@ -31,7 +31,7 @@ export const plugins = (production: boolean): Plugin[] => [
sourceMap: true,
functions: ['PerformanceUtils.*']
}),
production && terser({
minified && terser({
compress: {
// eslint-disable-next-line camelcase
pure_getters: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Finally, run:
npm run start-docs
```

Navigate to [http://0.0.0.0:8000/](http://0.0.0.0:8000/) to view the docs. After making changes, run `npm run generate-docs` again to apply them. Some tile service providers of the docs example pages such as MapTiler or Staida Maps might only send you tiles if the host is localhost. In that case, try http://localhost:8000.
Navigate to [http://0.0.0.0:8000/](http://0.0.0.0:8000/) to view the docs. After making changes, run `npm run generate-docs` again to apply them. Some tile service providers of the docs example pages such as MapTiler or Stadia Maps might only send you tiles if the host is localhost. In that case, try http://localhost:8000.

The examples section of the locally run documentation will use the GL JS version released that has the same version as the in the package.json.

Expand Down
1 change: 1 addition & 0 deletions docs/assets/extra.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* see https://github.com/squidfunk/mkdocs-material/issues/4278 */
/* stylelint-disable-next-line selector-class-pattern */
.md-search-result .md-typeset {
display: -webkit-box;
-webkit-line-clamp: 5;
Expand Down
26 changes: 26 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@ Each section describes classes or objects as well as their **properties**, **par

In the examples, we use vector tiles from our [Demo tiles repository](https://github.com/maplibre/demotiles) and from [MapTiler](https://maptiler.com). Get your own API key if you want to use MapTiler data in your project.

## NPM

Install the MapLibre GL JS package via NPM.

```bash
npm install maplibre-gl
```

You can then import the MapLibre GL JS module in your project.

```html
<div id="map"></div>
```

```javascript
import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';

const map = new maplibregl.Map({
container: 'map', // container id
style: 'https://demotiles.maplibre.org/style.json', // style URL
center: [0, 0], // starting position [lng, lat]
zoom: 1 // starting zoom
});
```

## CSP Directives

As a mitigation for Cross-Site Scripting and other types of web security vulnerabilities, you may use a [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/Security/CSP) to specify security policies for your website. If you do, MapLibre GL JS requires the following CSP directives:
Expand Down
4 changes: 4 additions & 0 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ A library for making it easier to use Esri services in MapLibre GL JS. Supports
A library for retrieving tiles from single-file, cloud-storage-optimized PMTiles archives, which don't require running a server or API.
<br/><small>[View on GitHub](https://github.com/protomaps/PMTiles)</small>

#### maplibre-google-maps
A library for integrating Google Maps as raster layers into MapLibre GL JS. It uses the new Google Map Tiles API.
<br/><small>[View on GitHub](https://github.com/traccar/maplibre-google-maps)</small>

## Framework Integrations

#### echartslayer
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ markdown_extensions:
- pymdownx.escapeall:
hardbreak: True
nbsp: True
- attr_list

extra:
social:
Expand Down
Loading

0 comments on commit dbf6173

Please sign in to comment.