diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index e383b053ee..0000000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,231 +0,0 @@
-version: 2.1
-orbs:
- aws-cli: circleci/aws-cli@0.1.16
-
-workflows:
- version: 2
- default:
- jobs:
- - prepare:
- filters:
- tags:
- only: /.*/
- - lint:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - build:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - check-size:
- requires:
- - build
- filters:
- tags:
- only: /.*/
- - collect-stats:
- requires:
- - build
- filters:
- tags:
- ignore: /.*/
- branches:
- only: main
- - test-flow:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - test-unit:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - test-render:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - test-query:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - test-expressions:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
- - test-browser:
- requires:
- - prepare
- filters:
- tags:
- only: /.*/
-
-defaults: &defaults
- docker:
- - image: circleci/node:10.16-browsers
- working_directory: ~/mapbox-gl-js
-
-jobs:
- prepare:
- <<: *defaults
- steps:
- - checkout
- - restore_cache:
- keys:
- - v3-yarn-{{ checksum "yarn.lock" }}
- - run: yarn
- - save_cache:
- key: v3-yarn-{{ checksum "yarn.lock" }}
- paths:
- - '~/.yarn'
- - 'node_modules'
- - persist_to_workspace:
- root: .
- paths:
- - .
-
- lint:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - restore_cache:
- keys:
- - v2-lint-{{ .Branch }}
- - v2-lint
- - run: yarn run lint
- - run: yarn run lint-docs
- - run: yarn run lint-css
- - save_cache:
- key: v2-lint-{{ .Branch }}-{{ .Revision }}
- paths:
- - '.eslintcache'
-
- build:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run build-prod-min
- - run: yarn run build-prod
- - run: yarn run build-csp
- - run: yarn run build-dev
- - run: yarn run build-css
- - run: yarn run build-style-spec
- - run: yarn run build-flow-types
- - run: yarn run test-build
- - deploy:
- name: Trigger memory metrics when merging to main
- command: |
- if [ -n "${WEB_METRICS_TOKEN}" ]; then
- if [[ $CIRCLE_BRANCH == main ]]; then
- curl -X POST https://circleci.com/api/v1.1/project/github/mapbox/web-metrics/build?circle-token=${WEB_METRICS_TOKEN}
- fi
- fi
- - store_artifacts:
- path: "dist"
- - store_artifacts:
- path: "test/release"
- - persist_to_workspace:
- root: .
- paths:
- - dist
-
- check-size:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run:
- name: Check bundle size
- command: |
- node build/check-bundle-size.js "dist/mapbox-gl.js" "JS"
- node build/check-bundle-size.js "dist/mapbox-gl.css" "CSS"
-
- collect-stats:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run:
- name: Collect performance stats
- command: node bench/gl-stats.js
- - aws-cli/install
- - run:
- name: Upload performance stats
- command: aws s3 cp data.json.gz s3://mapbox-loading-dock/raw/gl_js.perf_metrics_staging/ci/`git show -s --date=short --format=%cd-%h HEAD`.json.gz
-
- test-flow:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run test-flow
-
- test-unit:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run test-unit
-
- test-render:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run test-render
- - store_artifacts:
- path: "test/integration/render-tests/index.html"
-
- test-query:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run test-query
- - store_test_results:
- path: test/integration/query-tests
- - store_artifacts:
- path: "test/integration/query-tests/index.html"
-
- test-browser:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run build-dev
- - run: yarn run build-token
- - run:
- name: Test Chrome
- environment:
- SELENIUM_BROWSER: chrome
- TAP_COLORS: 1
- command: yarn run test-browser
- - run:
- name: Test Firefox
- environment:
- SELENIUM_BROWSER: firefox
- TAP_COLORS: 1
- command: yarn run test-browser
-
- test-expressions:
- <<: *defaults
- steps:
- - attach_workspace:
- at: .
- - run: yarn run test-expressions
-
diff --git a/.eslintrc b/.eslintrc
index b17f3bafc2..8a01d2b260 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,19 +1,29 @@
{
"extends": [
"mourner",
- "plugin:flowtype/recommended",
- "plugin:import/recommended"
+ "plugin:import/recommended",
+ "plugin:import/typescript"
],
- "parser": "babel-eslint",
+ "parser": "@typescript-eslint/parser",
"parserOptions": {
- "sourceType": "module"
+ "sourceType": "module",
+ "createDefaultProgram": true
},
"plugins": [
- "flowtype",
+ "@typescript-eslint",
"import",
"jsdoc"
],
"rules": {
+ "no-dupe-class-members": "off",
+ "@typescript-eslint/no-dupe-class-members": ["error"],
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ { "argsIgnorePattern": "^_" }
+ ],
+ "@typescript-eslint/member-delimiter-style": ["error"],
+ // Disable no-undef. It's covered by @typescript-eslint
+ "no-undef": "off",
// temporarily disabled due to https://github.com/babel/babel-eslint/issues/485
"no-use-before-define": "off",
@@ -33,13 +43,6 @@
"array-bracket-spacing": "off",
"consistent-return": "off",
- "flowtype/define-flow-type": 1,
- "flowtype/require-valid-file-annotation": [
- 2,
- "always", {
- "annotationStyle": "line"
- }
- ],
"global-require": "off",
"import/no-commonjs": "error",
"key-spacing": "off",
@@ -50,13 +53,15 @@
"object": "Object",
"property": "assign"
}],
- "no-unused-vars": ["error", {"argsIgnorePattern": "^_$"}],
+ "no-unused-vars": "off",
"no-warning-comments": "error",
"object-curly-spacing": ["error", "never"],
"prefer-arrow-callback": "error",
"prefer-const": ["error", {"destructuring": "all"}],
"prefer-template": "error",
+ // @typescript-eslint/quotes requires standard quotes rule to be turned off
"quotes": "off",
+ "@typescript-eslint/quotes": ["error", "single"],
"space-before-function-paren": "off",
"template-curly-spacing": "error",
"no-useless-escape": "off",
@@ -72,7 +77,7 @@
"parameters": "off"
}
}],
- "no-multiple-empty-lines": [ "error", {
+ "no-multiple-empty-lines": [ "error", {
"max": 1
}],
"jsdoc/check-param-names": "warn",
@@ -87,6 +92,7 @@
"ignorePrivate": true
}
},
+ "ignorePatterns": ["build/*.js", "*.json"],
"overrides": [
{
"files": ["debug/**", "bench/**", "test/**", "src/style-spec/**"],
diff --git a/.flowconfig b/.flowconfig
deleted file mode 100644
index 5eac8c94d0..0000000000
--- a/.flowconfig
+++ /dev/null
@@ -1,61 +0,0 @@
-[ignore]
-.*\.svg
-.*\.png
-.*/\.nyc_output/.*
-.*/docs/.*
-.*/node_modules/.cache/.*
-.*/node_modules/.*/tests?/.*
-.*/node_modules/@mapbox/jsonlint-lines-primitives/.*
-.*/node_modules/@mapbox/mvt-fixtures/.*
-.*/node_modules/@mapbox/geojson-types/fixtures/.*
-.*/node_modules/@mapbox/mr-ui/.*
-.*/node_modules/@mapbox/dr-ui/.*
-.*/node_modules/@mapbox/batfish/.*
-.*/node_modules/browserify/.*
-.*/node_modules/browser-sync.*/.*
-.*/node_modules/nyc/.*
-.*/node_modules/fbjs/.*
-.*/node_modules/es5-ext/.*
-.*/node_modules/jsdom/.*
-.*/node_modules/eslint.*/.*
-.*/node_modules/highlight.*/.*
-.*/node_modules/rxjs/.*
-.*/node_modules/@?babel.*/.*
-.*/node_modules/react.*/.*
-.*/node_modules/svgo/.*
-.*/node_modules/moment/.*
-.*/node_modules/regenerate-unicode-properties/.*
-.*/node_modules/remark.*/.*
-.*/node_modules/webpack/.*
-.*/node_modules/caniuse-lite/.*
-.*/node_modules/d3.*/.*
-.*/node_modules/css-tree/.*
-.*/node_modules/lodash/.*
-.*/node_modules/fsevents/.*
-.*/node_modules/browser-sync-client/.*
-.*/node_modules/core-js.*/.*
-.*/node_modules/stylelint/.*
-.*/node_modules/postcss.*/.*
-.*/node_modules/prismjs.*/.*
-.*/node_modules/documentation/.*
-.*/node_modules/module-deps/.*
-.*/test/unit/style-spec/fixture/invalidjson.input.json
-.*/render-tests/.*
-.*/query-tests/.*
-.*/expression-tests/.*
-.*/test/build/downstream-flow-fixture/.*
-.*/_batfish_tmp/.*
-.*/_site/.*
-
-[version]
-0.100.0
-
-[options]
-server.max_workers=4
-
-[strict]
-nonstrict-import
-unclear-type
-untyped-import
-untyped-type-import
-sketchy-null
diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml
index 84109b095b..39cdb778cf 100644
--- a/.github/workflows/analyze.yml
+++ b/.github/workflows/analyze.yml
@@ -18,12 +18,12 @@ jobs:
# report status back to pull request
- uses: haya14busa/action-workflow_run-status@v1
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
+ - run: npm ci
- name: Download branch artifact
uses: dawidd6/action-download-artifact@v2
with:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 11d6a1c85d..d27df0ac64 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,9 +2,8 @@ name: Build
on:
push:
- branches: [1.x]
+ branches: [main]
pull_request:
- branches: [1.x]
jobs:
build:
@@ -12,20 +11,19 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
- - run: yarn run build-prod-min
- - run: yarn run build-prod
- - run: yarn run build-csp
- - run: yarn run build-dev
- - run: yarn run build-css
- - run: yarn run build-style-spec
- - run: yarn run build-flow-types
- - run: yarn run test-build
+ - run: npm ci
+ - run: npm run build-prod-min
+ - run: npm run build-prod
+ - run: npm run build-csp
+ - run: npm run build-dev
+ - run: npm run build-css
+ - run: npm run build-style-spec
+ - run: npm run test-build
- run: find dist
- run: mkdir build-info
- name: Store build info
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0b6578107b..da4877c608 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,9 +4,8 @@ name: CI
on:
push:
- branches: [1.x]
+ branches: [main]
pull_request:
- branches: [1.x]
jobs:
lint_build_test:
@@ -17,7 +16,7 @@ jobs:
- macos-latest
- windows-latest
node_version:
- - 10
+ - 14
architecture:
- x64
@@ -31,66 +30,55 @@ jobs:
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- - run: yarn install --frozen-lockfile
+ - run: npm ci
- - run: yarn run lint
- - run: yarn run build-dev
- - run: yarn test-unit
+ - run: npm run lint
+ - run: npm run build-dev
+ - run: npm run test-unit
lint:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
- - run: yarn run lint
- - run: yarn run lint-docs
- - run: yarn run lint-css
-
- test-flow:
- runs-on: ubuntu-latest
- timeout-minutes: 20
- steps:
- - uses: actions/checkout@v2
- - name: Use Node.js 10 x64
- uses: actions/setup-node@v2-beta
- with:
- node-version: 10
- architecture: x64
- - run: yarn install --frozen-lockfile
- - run: yarn run test-flow
+ - run: npm ci
+ - run: npm run lint
+ - run: npm run lint-docs
+ - run: npm run lint-css
test-unit:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
+ - run: npm ci
+ - run: npm run build-dev
# see: https://github.com/stackgl/headless-gl#how-can-headless-gl-be-used-on-a-headless-linux-machine
- - run: xvfb-run -s "-ac -screen 0 1280x1024x24" yarn run test-unit
+ - run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-unit
test-query:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
- - run: yarn run test-query
+ - run: npm ci
+ - run: npm run build-dev
+ - run: npm run test-query
- uses: actions/upload-artifact@v2
with:
path: ./test/integration/query-tests
@@ -105,13 +93,14 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
- - run: yarn run test-expressions
+ - run: npm ci
+ - run: npm run build-dev
+ - run: npm run test-expressions
test-browser:
timeout-minutes: 20
@@ -120,25 +109,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2-beta
with:
- node-version: 10
+ node-version: 14
architecture: x64
- - run: yarn install --frozen-lockfile
- - run: yarn run build-dev
- - run: DETECT_CHROMEDRIVER_VERSION=true yarn global add chromedriver
- - run: yarn global add geckodriver@^1.22.3
+ - run: npm ci
+ - run: npm run build-dev
+ - run: DETECT_CHROMEDRIVER_VERSION=true npm install -g chromedriver
+ - run: npm install -g geckodriver@^1.22.3
- name: Test Chrome
env:
SELENIUM_BROWSER: chrome
TAP_COLORS: 1
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" yarn run test-browser
+ run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-browser
- name: Test Firefox
env:
SELENIUM_BROWSER: firefox
TAP_COLORS: 1
- run: xvfb-run -s "-ac -screen 0 1280x1024x24" yarn run test-browser
+ run: xvfb-run -s "-ac -screen 0 1280x1024x24" npm run test-browser
# TODO need a data provider for these:
# collect-stats:
@@ -146,12 +135,12 @@ jobs:
# needs: [build]
# steps:
# - uses: actions/checkout@v2
- # - name: Use Node.js 10 x64
+ # - name: Use Node.js 14 x64
# uses: actions/setup-node@v2-beta
# with:
- # node-version: 10
+ # node-version: 14
# architecture: x64
- # - run: yarn install --frozen-lockfile
+ # - run: npm ci
# - uses: actions/download-artifact@v2
# with:
# name: dist
@@ -166,13 +155,13 @@ jobs:
# test-render:
# runs-on: ubuntu-latest
# steps:
- # - name: Use Node.js 10 x64
+ # - name: Use Node.js 14 x64
# uses: actions/setup-node@v2-beta
# with:
- # node-version: 10
+ # node-version: 14
# architecture: x64
- # - run: yarn install --frozen-lockfile
- # - run: yarn run test-render
+ # - run: npm ci
+ # - run: npm run test-render
# - uses: actions/upload-artifact@v2
# with:
# path: test/integration/render-tests/index.html
diff --git a/.github/workflows/publish-style-spec.yml b/.github/workflows/publish-style-spec.yml
new file mode 100644
index 0000000000..b22abcaf5a
--- /dev/null
+++ b/.github/workflows/publish-style-spec.yml
@@ -0,0 +1,41 @@
+name: publish-style-spec
+
+on:
+ workflow_dispatch
+
+jobs:
+ build_publish:
+ name: Build, publish
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Use Node.js 14 x64
+ uses: actions/setup-node@v2
+ with:
+ node-version: 14
+ architecture: x64
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Install GL JS
+ run: npm ci
+
+ - name: Build GL JS
+ run: |
+ npm run build-prod-min
+ npm run build-css
+
+ - name: Build style spec
+ run: |
+ npm run build-style-spec
+ cp -r dist/style-spec/ src/style-spec/dist
+
+ - name: Check version and publish
+ run: |
+ cd src/style-spec
+ node -e "if(require('./package').version.includes('dev')) { process.exit(1) }"
+ npm publish --access=public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b210a124ac..4b5284e7ec 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -18,15 +18,15 @@ jobs:
with:
fetch-depth: 0
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2
with:
- node-version: 10
+ node-version: 14
architecture: x64
registry-url: 'https://registry.npmjs.org'
- name: Install
- run: yarn install --frozen-lockfile
+ run: npm ci
- name: Validate version tag
run: |
@@ -45,17 +45,16 @@ jobs:
- name: Lint
run: |
- yarn run lint
- yarn run lint-docs
- yarn run lint-css
+ npm run lint
+ npm run lint-docs
+ npm run lint-css
- name: Test
run: |
- yarn run test-flow
- yarn run test-unit
- yarn run test-render
- yarn run test-query
- yarn run test-expressions
+ npm run test-unit
+ npm run test-render
+ npm run test-query
+ npm run test-expressions
release:
name: Release
@@ -70,15 +69,15 @@ jobs:
with:
fetch-depth: 0
- - name: Use Node.js 10 x64
+ - name: Use Node.js 14 x64
uses: actions/setup-node@v2
with:
- node-version: 10
+ node-version: 14
architecture: x64
registry-url: 'https://registry.npmjs.org'
- name: Install
- run: yarn install --frozen-lockfile
+ run: npm ci
- name: Validate version tag
run: |
@@ -97,8 +96,8 @@ jobs:
- name: Build
run: |
- yarn run build-prod-min
- yarn run build-css
+ npm run build-prod-min
+ npm run build-css
- name: Create Archive
run: |
diff --git a/.gitignore b/.gitignore
index 9dc10d318f..715d1ee3fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,12 @@
/rollup/build/
+/types/
/dist/
+/dist_type/
*.es.js
*.js.map
node_modules
-package-lock.json
*.sublime-*
coverage
-flow-coverage
.DS_Store
.nyc_output
*_generated.js
diff --git a/.nvmrc b/.nvmrc
index dc08cc7bd0..0627d197d0 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-10.24.1
+14.17.4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index df54342dc1..fe0aaf4216 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,18 @@
### Features and improvements
+- *...Add new stuff here...*
+### 🐞 Bug fixes
+
+- *...Add new stuff here...*
+
+## 2.0.0
+
+### Features and improvements
+
+- Migrated the production code to typescript
+- ** Breaking Change ** removed `version` from the public API
+- ** Breaking Change ** stopped supporting IE (internet explorer)
- *...Add new stuff here...*
### 🐞 Bug fixes
diff --git a/bench/benchmarks/worker_transfer.js b/bench/benchmarks/worker_transfer.js
index de08471e28..791d13c88e 100644
--- a/bench/benchmarks/worker_transfer.js
+++ b/bench/benchmarks/worker_transfer.js
@@ -6,7 +6,6 @@ import fetchStyle from '../lib/fetch_style';
import TileParser from '../lib/tile_parser';
import {OverscaledTileID} from '../../src/source/tile_id';
import {serialize, deserialize} from '../../src/util/web_worker_transfer';
-import {values} from '../../src/util/util';
export default class WorkerTransfer extends Benchmark {
parser: TileParser;
@@ -48,8 +47,8 @@ export default class WorkerTransfer extends Benchmark {
return Promise.all(tiles.map(tile => this.parser.parseTile(tile)));
}).then((tileResults) => {
const payload = tileResults
- .concat(values(this.parser.icons))
- .concat(values(this.parser.glyphs)).map((obj) => serialize(obj, []));
+ .concat(Object.values(this.parser.icons))
+ .concat(Object.values(this.parser.glyphs)).map((obj) => serialize(obj, []));
this.payloadJSON = payload.map(barePayload);
this.payloadTiles = payload.slice(0, tileResults.length);
});
diff --git a/bench/rollup_config_benchmarks.js b/bench/rollup_config_benchmarks.js
index 063dff6675..919b139094 100644
--- a/bench/rollup_config_benchmarks.js
+++ b/bench/rollup_config_benchmarks.js
@@ -2,7 +2,6 @@ import fs from 'fs';
import sourcemaps from 'rollup-plugin-sourcemaps';
import replace from 'rollup-plugin-replace';
import {plugins} from '../build/rollup_plugins';
-import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
@@ -56,7 +55,6 @@ const viewConfig = {
sourcemap: false
},
plugins: [
- buble({transforms: {dangerousForOf: true}, objectAssign: true}),
resolve({browser: true, preferBuiltins: false}),
commonjs(),
replace(replaceConfig)
diff --git a/build/maplibre-gl-js.dockerfile b/build/maplibre-gl-js.dockerfile
index 91eeea66ca..33f45e69dc 100644
--- a/build/maplibre-gl-js.dockerfile
+++ b/build/maplibre-gl-js.dockerfile
@@ -1,6 +1,6 @@
# see: publish-release.sh to build/run this
-FROM node:10
+FROM node:14
ENV DEBIAN_FRONTEND=noninteractive
diff --git a/build/rollup_plugins.js b/build/rollup_plugins.js
index 156ac68176..664ad1c672 100644
--- a/build/rollup_plugins.js
+++ b/build/rollup_plugins.js
@@ -1,28 +1,31 @@
-import flowRemoveTypes from '@mapbox/flow-remove-types';
-import buble from 'rollup-plugin-buble';
-import resolve from 'rollup-plugin-node-resolve';
-import commonjs from 'rollup-plugin-commonjs';
+import resolve from '@rollup/plugin-node-resolve';
+import replace from '@rollup/plugin-replace';
+import commonjs from '@rollup/plugin-commonjs';
import unassert from 'rollup-plugin-unassert';
-import json from 'rollup-plugin-json';
+import json from '@rollup/plugin-json';
import {terser} from 'rollup-plugin-terser';
-import minifyStyleSpec from './rollup_plugin_minify_style_spec';
-import {createFilter} from 'rollup-pluginutils';
+import minifyStyleSpec from './rollup_plugin_minify_style_spec.js';
import strip from '@rollup/plugin-strip';
// Common set of plugins/transformations shared across different rollup
// builds (main maplibre bundle, style-spec package, benchmarks bundle)
export const plugins = (minified, production) => [
- flow(),
minifyStyleSpec(),
json(),
+ // https://github.com/zaach/jison/issues/351
+ replace({
+ include: /\/jsonlint-lines-primitives\/lib\/jsonlint.js/,
+ delimiters: ['', ''],
+ values: {
+ '_token_stack:': ''
+ }
+ }),
production ? strip({
sourceMap: true,
functions: ['PerformanceUtils.*', 'Debug.*']
}) : false,
- glsl('./src/shaders/*.glsl', production),
- buble({transforms: {dangerousForOf: true}, objectAssign: "Object.assign"}),
minified ? terser({
compress: {
pure_getters: true,
@@ -40,41 +43,3 @@ export const plugins = (minified, production) => [
ignoreGlobal: true
})
].filter(Boolean);
-
-// Using this instead of rollup-plugin-flow due to
-// https://github.com/leebyron/rollup-plugin-flow/issues/5
-export function flow() {
- return {
- name: 'flow-remove-types',
- transform: (code) => ({
- code: flowRemoveTypes(code).toString(),
- map: null
- })
- };
-}
-
-// Using this instead of rollup-plugin-string to add minification
-function glsl(include, minify) {
- const filter = createFilter(include);
- return {
- name: 'glsl',
- transform(code, id) {
- if (!filter(id)) return;
-
- // barebones GLSL minification
- 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 {
- code: `export default ${JSON.stringify(code)};`,
- map: {mappings: ''}
- };
- }
- };
-}
diff --git a/build/run-tap b/build/run-tap
deleted file mode 100755
index e5b300cfed..0000000000
--- a/build/run-tap
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-if [ "$#" == 5 ]; then
- arg="${@:1:3} ${4}/${5}"
-else
- arg="${@}"
-fi
-
-node_modules/.bin/tap --node-arg -r --node-arg @mapbox/flow-remove-types/register --node-arg -r --node-arg esm $arg --node-arg
diff --git a/build/test/build-tape.js b/build/test/build-tape.js
index 78f11d8d1e..d32bdf2b2e 100644
--- a/build/test/build-tape.js
+++ b/build/test/build-tape.js
@@ -1,12 +1,10 @@
-/* eslint-disable import/no-commonjs */
-/* eslint-disable flowtype/require-valid-file-annotation */
-const browserify = require('browserify');
-const fs = require('fs');
+import browserify from 'browserify';
+import fs from 'fs';
-module.exports = function() {
+export default function() {
return new Promise((resolve, reject) => {
- browserify(require.resolve('../../test/util/tape_config.js'), { standalone: 'tape' })
- .transform("babelify", {presets: ["@babel/preset-env"], global: true})
+ browserify('./test/util/tape_config.js', { standalone: 'tape' })
+ .transform('babelify', {presets: ['@babel/preset-env'], global: true})
.bundle((err, buff) => {
if (err) { throw err; }
@@ -16,4 +14,4 @@ module.exports = function() {
});
});
});
-};
+}
diff --git a/build/web_worker_replacement.js b/build/web_worker_replacement.js
new file mode 100644
index 0000000000..a8775b89bd
--- /dev/null
+++ b/build/web_worker_replacement.js
@@ -0,0 +1,5 @@
+import maplibregl from '../rollup/build/tsc/index'
+
+export default function () {
+ return new Worker(maplibregl.workerUrl);
+}
\ No newline at end of file
diff --git a/debug/.eslintrc b/debug/.eslintrc
index 62ffd8a1f1..ab4c19add0 100644
--- a/debug/.eslintrc
+++ b/debug/.eslintrc
@@ -15,6 +15,7 @@
"strict": "off",
"no-restricted-properties": "off",
"no-unused-vars": "off",
+ "@typescript-eslint/no-unused-vars": "off",
"prefer-template": "off"
},
"env": {
diff --git a/debug/2762.html b/debug/2762.html
index d2dd80e153..5ffff0b9a4 100644
--- a/debug/2762.html
+++ b/debug/2762.html
@@ -20,35 +20,35 @@
var map = new maplibregl.Map({
container: 'map',
style: {
- "version": 8,
- "sources": {
- "geojson": {
- "type": "geojson",
- "data": {
- "type": "Point",
- "coordinates": [0, 0]
+ 'version': 8,
+ 'sources': {
+ 'geojson': {
+ 'type': 'geojson',
+ 'data': {
+ 'type': 'Point',
+ 'coordinates': [0, 0]
}
}
},
- "transition": {
- "duration": 1000
+ 'transition': {
+ 'duration': 1000
},
- "layers": [
+ 'layers': [
{
- "id": "circle",
- "type": "circle",
- "source": "geojson",
- "paint": {
- "circle-translate": [-50, -50]
+ 'id': 'circle',
+ 'type': 'circle',
+ 'source': 'geojson',
+ 'paint': {
+ 'circle-translate': [-50, -50]
}
}
]
}
});
-map.on('click', function(e) {
- map.setPaintProperty("circle", "circle-color", "red");
- map.setPaintProperty("circle", "circle-translate", [50, 50]);
+map.on('click', function(_) {
+ map.setPaintProperty('circle', 'circle-color', 'red');
+ map.setPaintProperty('circle', 'circle-translate', [50, 50]);
});
diff --git a/debug/7517.html b/debug/7517.html
index 3e3ecbdcff..59deded219 100644
--- a/debug/7517.html
+++ b/debug/7517.html
@@ -62,11 +62,11 @@
];
const maineBBoxPolygon = {
- "type": "Feature",
- "properties": {},
- "geometry": {
- "type": "Polygon",
- "coordinates": [
+ 'type': 'Feature',
+ 'properties': {},
+ 'geometry': {
+ 'type': 'Polygon',
+ 'coordinates': [
[
[-71.08482, 43.08003225358635],
[-66.96466, 43.08003225358635],
diff --git a/debug/animate.html b/debug/animate.html
index 71b558ed2a..e74d952774 100644
--- a/debug/animate.html
+++ b/debug/animate.html
@@ -27,10 +27,10 @@
function line(angle, radius) {
return {
- "type": "Feature",
- "geometry": {
- "type": "LineString",
- "coordinates": [
+ 'type': 'Feature',
+ 'geometry': {
+ 'type': 'LineString',
+ 'coordinates': [
[-Math.cos(angle) * radius, -Math.sin(angle) * radius + 1],
[Math.cos(angle) * radius, Math.sin(angle) * radius + 1],
]
@@ -40,8 +40,8 @@
function crossWithAngle(angle) {
return {
- "type": "FeatureCollection",
- "features": [
+ 'type': 'FeatureCollection',
+ 'features': [
line(angle - Math.PI / 4, radius),
line(angle + Math.PI / 4, radius)
]
@@ -51,27 +51,27 @@
map.on('load', function () {
// Add a source and layer displaying a point which will be animated in a circle.
map.addSource('lines', {
- "type": "geojson",
- "data": crossWithAngle(0)
+ 'type': 'geojson',
+ 'data': crossWithAngle(0)
});
map.addLayer({
- "id": "lines",
- "source": "lines",
- "type": "line",
- "paint": {
- "line-width": 4,
- "line-color": "#007cbf"
+ 'id': 'lines',
+ 'source': 'lines',
+ 'type': 'line',
+ 'paint': {
+ 'line-width': 4,
+ 'line-color': '#007cbf'
}
});
map.addLayer({
- "id": "dot",
- "source": "lines",
- "type": "circle",
- "paint": {
- "circle-radius": 10,
- "circle-color": "#007cbf"
+ 'id': 'dot',
+ 'source': 'lines',
+ 'type': 'circle',
+ 'paint': {
+ 'circle-radius': 10,
+ 'circle-color': '#007cbf'
}
});
diff --git a/debug/bounds.html b/debug/bounds.html
index a99fb2d50c..c7ab8a6272 100644
--- a/debug/bounds.html
+++ b/debug/bounds.html
@@ -49,7 +49,7 @@
type: 'fill',
source: 'bounds',
paint: {
- 'fill-color': "rgba(255,0,0,0.2)"
+ 'fill-color': 'rgba(255,0,0,0.2)'
}
});
diff --git a/debug/cache_api.html b/debug/cache_api.html
index 591ca44818..d68818d587 100644
--- a/debug/cache_api.html
+++ b/debug/cache_api.html
@@ -111,38 +111,38 @@
map.on('style.load', function() {
// add traffic layer that shouldn't be cached because of short expiry
map.addLayer({
- "id": "traffic",
- "source": {
- "url": "mapbox://mapbox.mapbox-traffic-v1",
- "type": "vector"
+ 'id': 'traffic',
+ 'source': {
+ 'url': 'mapbox://mapbox.mapbox-traffic-v1',
+ 'type': 'vector'
},
- "source-layer": "traffic",
- "type": "line",
- "paint": {
- "line-width": 1.5,
- "line-color": "red"
+ 'source-layer': 'traffic',
+ 'type': 'line',
+ 'paint': {
+ 'line-width': 1.5,
+ 'line-color': 'red'
}
});
// add third party source that shouldn't be cached
map.addLayer({
- "id": "mapillary",
- "type": "line",
- "source": {
- "type": "vector",
- "tiles": ["https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt"],
- "minzoom": 6,
- "maxzoom": 14
+ 'id': 'mapillary',
+ 'type': 'line',
+ 'source': {
+ 'type': 'vector',
+ 'tiles': ['https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt'],
+ 'minzoom': 6,
+ 'maxzoom': 14
},
- "source-layer": "mapillary-sequences",
- "layout": {
- "line-cap": "round",
- "line-join": "round"
+ 'source-layer': 'mapillary-sequences',
+ 'layout': {
+ 'line-cap': 'round',
+ 'line-join': 'round'
},
- "paint": {
- "line-opacity": 0.6,
- "line-color": "rgb(53, 175, 109)",
- "line-width": 2
+ 'paint': {
+ 'line-opacity': 0.6,
+ 'line-color': 'rgb(53, 175, 109)',
+ 'line-width': 2
}
});
@@ -155,25 +155,25 @@
const dontCache = ['traffic', 'style', 'fonts', 'd25uarhxywzl1j.cloudfront.net'];
for (const urlSubstring of dontCache) {
- log(!matchURL(keys, urlSubstring), "Does not cache wrong resource: " + urlSubstring);
+ log(!matchURL(keys, urlSubstring), 'Does not cache wrong resource: ' + urlSubstring);
}
}
function testFirstView(done) {
cache.keys().catch(catchError).then(keys => {
- log(keys.length === 4, "keys.length = 4");
+ log(keys.length === 4, 'keys.length = 4');
// check for expected cache entries
const expected = [
- "mapbox.mapbox-streets-v7/12/1171/1566.vector.pbf",
- "mapbox.mapbox-streets-v7/12/1171/1567.vector.pbf",
- "mapbox.mapbox-streets-v7/12/1172/1566.vector.pbf",
- "mapbox.mapbox-streets-v7/12/1172/1567.vector.pbf",
+ 'mapbox.mapbox-streets-v7/12/1171/1566.vector.pbf',
+ 'mapbox.mapbox-streets-v7/12/1171/1567.vector.pbf',
+ 'mapbox.mapbox-streets-v7/12/1172/1566.vector.pbf',
+ 'mapbox.mapbox-streets-v7/12/1172/1567.vector.pbf',
];
for (const expect of expected) {
- log(matchURL(keys, expect), "Caches correct resource: " + expect);
+ log(matchURL(keys, expect), 'Caches correct resource: ' + expect);
}
checkNotCached(keys);
@@ -191,18 +191,18 @@
cache.keys().catch(catchError).then(keys => {
// some tiles were evicted!
- log(keys.length === 6, "Enforces cache size limit: keys.length = 6");
+ log(keys.length === 6, 'Enforces cache size limit: keys.length = 6');
// all the most recent tiles are in the cache
const expected = [
- "mapbox.mapbox-streets-v7/13/2342/3133.vector.pbf",
- "mapbox.mapbox-streets-v7/13/2342/3134.vector.pbf",
- "mapbox.mapbox-streets-v7/13/2343/3133.vector.pbf",
- "mapbox.mapbox-streets-v7/13/2343/3134.vector.pbf",
+ 'mapbox.mapbox-streets-v7/13/2342/3133.vector.pbf',
+ 'mapbox.mapbox-streets-v7/13/2342/3134.vector.pbf',
+ 'mapbox.mapbox-streets-v7/13/2343/3133.vector.pbf',
+ 'mapbox.mapbox-streets-v7/13/2343/3134.vector.pbf',
];
for (const expect of expected) {
- log(matchURL(keys, expect), "Evicts correct tiles: still has " + expect);
+ log(matchURL(keys, expect), 'Evicts correct tiles: still has ' + expect);
}
checkNotCached(keys);
@@ -220,7 +220,7 @@
cache.keys().catch(catchError).then(keys => {
// some tiles were evicted!
- log(keys.length === 6, "Enforces cache size limit: keys.length = 6");
+ log(keys.length === 6, 'Enforces cache size limit: keys.length = 6');
// check that the cache entries are ordered in order of most least use
@@ -231,14 +231,14 @@
// all the most recent tiles are in the cache
const expected = [
- "mapbox.mapbox-streets-v7/12/1171/1566.vector.pbf",
- "mapbox.mapbox-streets-v7/12/1171/1567.vector.pbf",
- "mapbox.mapbox-streets-v7/12/1172/1566.vector.pbf",
- "mapbox.mapbox-streets-v7/12/1172/1567.vector.pbf",
+ 'mapbox.mapbox-streets-v7/12/1171/1566.vector.pbf',
+ 'mapbox.mapbox-streets-v7/12/1171/1567.vector.pbf',
+ 'mapbox.mapbox-streets-v7/12/1172/1566.vector.pbf',
+ 'mapbox.mapbox-streets-v7/12/1172/1567.vector.pbf',
];
for (const expect of expected) {
- log(matchURL(keys, expect), "Evicts correct tiles: still has " + expect);
+ log(matchURL(keys, expect), 'Evicts correct tiles: still has ' + expect);
}
checkNotCached(keys);
diff --git a/debug/canvas.html b/debug/canvas.html
index 461593bdfa..e22544c5c6 100644
--- a/debug/canvas.html
+++ b/debug/canvas.html
@@ -34,13 +34,13 @@
}
var canvasStyle = {
- "version": 8,
- "sources": {
- "canvas": {
- "type": "canvas",
- "canvas": "testCanvasID",
- "animate": false,
- "coordinates": [
+ 'version': 8,
+ 'sources': {
+ 'canvas': {
+ 'type': 'canvas',
+ 'canvas': 'testCanvasID',
+ 'animate': false,
+ 'coordinates': [
[-122.51596391201019, 37.56238816766053],
[-122.51467645168304, 37.56410183312965],
[-122.51309394836426, 37.563391708549425],
@@ -48,20 +48,20 @@
]
}
},
- "layers": [{
- "id": "background",
- "type": "background",
- "paint": {
- "background-color": "rgb(4,7,14)"
+ 'layers': [{
+ 'id': 'background',
+ 'type': 'background',
+ 'paint': {
+ 'background-color': 'rgb(4,7,14)'
}
}, {
- "id": "canvas",
- "type": "raster",
- "source": "canvas"
+ 'id': 'canvas',
+ 'type': 'raster',
+ 'source': 'canvas'
}]
};
-var map = new maplibregl.Map({
+new maplibregl.Map({
container: 'map',
minZoom: 14,
zoom: 17,
diff --git a/debug/chinese.html b/debug/chinese.html
index f971e7880c..c7e664d3cb 100644
--- a/debug/chinese.html
+++ b/debug/chinese.html
@@ -38,23 +38,23 @@
map.addControl(new maplibregl.NavigationControl());
map.on('load', function () {
- map.addSource("points", {
- "type": "geojson",
- "data": '/test/integration/data/chinese.geojson'
+ map.addSource('points', {
+ 'type': 'geojson',
+ 'data': '/test/integration/data/chinese.geojson'
});
map.addLayer({
- "id": "points",
- "type": "symbol",
- "source": "points",
- "layout": {
- "icon-image": "{icon}-15",
- "text-field": "{name}",
- "text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"],
- "text-offset": [0, 0.6],
- "text-anchor": "top",
- "text-allow-overlap": true,
- "icon-allow-overlap": true
+ 'id': 'points',
+ 'type': 'symbol',
+ 'source': 'points',
+ 'layout': {
+ 'icon-image': '{icon}-15',
+ 'text-field': '{name}',
+ 'text-font': ['Open Sans Semibold', 'Arial Unicode MS Bold'],
+ 'text-offset': [0, 0.6],
+ 'text-anchor': 'top',
+ 'text-allow-overlap': true,
+ 'icon-allow-overlap': true
}
});
});
diff --git a/debug/circles.html b/debug/circles.html
index b74cefc70b..90e0a0bd34 100644
--- a/debug/circles.html
+++ b/debug/circles.html
@@ -31,53 +31,53 @@
map.on('load', function() {
map.addSource('circles', {
- "type": "geojson",
- "data": "/test/integration/data/places.geojson"
+ 'type': 'geojson',
+ 'data': '/test/integration/data/places.geojson'
});
map.addLayer({
- "id": "circles",
- "type": "circle",
- "source": "circles",
- "paint": {
- "circle-radius": [
- "interpolate",
- ["exponential", 2.0],
- ["zoom"],
+ 'id': 'circles',
+ 'type': 'circle',
+ 'source': 'circles',
+ 'paint': {
+ 'circle-radius': [
+ 'interpolate',
+ ['exponential', 2.0],
+ ['zoom'],
0, 5,
- 5, ['*', ["get", "scalerank"], 20],
+ 5, ['*', ['get', 'scalerank'], 20],
],
- "circle-color": [
- "match",
- ["get", "featureclass"],
- "cape", "orange",
- "island", "#0088ff",
- "plain", "yellow",
- "pole", "white",
- "waterfall", "blue",
- "red"
+ 'circle-color': [
+ 'match',
+ ['get', 'featureclass'],
+ 'cape', 'orange',
+ 'island', '#0088ff',
+ 'plain', 'yellow',
+ 'pole', 'white',
+ 'waterfall', 'blue',
+ 'red'
],
- "circle-pitch-scale": "map",
- "circle-pitch-alignment": "map"
+ 'circle-pitch-scale': 'map',
+ 'circle-pitch-alignment': 'map'
}
});
map.addLayer({
- "id": "labels",
- "type": "symbol",
- "source": "circles",
- "minzoom": 1,
- "layout": {
- "text-field": [
- "concat",
- ["get", "name"],
- " (",
+ 'id': 'labels',
+ 'type': 'symbol',
+ 'source': 'circles',
+ 'minzoom': 1,
+ 'layout': {
+ 'text-field': [
+ 'concat',
+ ['get', 'name'],
+ ' (',
[
- "coalesce",
- ["get", "subregion"],
- ["get", "region"]
+ 'coalesce',
+ ['get', 'subregion'],
+ ['get', 'region']
],
- ")"
+ ')'
]
}
});
diff --git a/debug/cluster.html b/debug/cluster.html
index 4fa5f8b5ca..a5eb315f72 100644
--- a/debug/cluster.html
+++ b/debug/cluster.html
@@ -27,67 +27,67 @@
map.on('load', () => {
map.addSource('geojson', {
- "type": "geojson",
- "data": "/test/integration/data/places.geojson",
- "cluster": true,
- "clusterRadius": 50,
- "clusterProperties": {
- "max": ["max", ["get", "scalerank"]],
- "sum": ["+", ["get", "scalerank"]],
- "has_island": ["any", ["==", ["get", "featureclass"], "island"]]
+ 'type': 'geojson',
+ 'data': '/test/integration/data/places.geojson',
+ 'cluster': true,
+ 'clusterRadius': 50,
+ 'clusterProperties': {
+ 'max': ['max', ['get', 'scalerank']],
+ 'sum': ['+', ['get', 'scalerank']],
+ 'has_island': ['any', ['==', ['get', 'featureclass'], 'island']]
}
});
map.addLayer({
- "id": "cluster",
- "type": "circle",
- "source": "geojson",
- "filter": ["==", "cluster", true],
- "paint": {
- "circle-color": ["case", ["get", "has_island"], "orange", "rgba(0, 200, 0, 1)"],
- "circle-radius": 20
+ 'id': 'cluster',
+ 'type': 'circle',
+ 'source': 'geojson',
+ 'filter': ['==', 'cluster', true],
+ 'paint': {
+ 'circle-color': ['case', ['get', 'has_island'], 'orange', 'rgba(0, 200, 0, 1)'],
+ 'circle-radius': 20
}
});
map.addLayer({
- "id": "cluster_label",
- "type": "symbol",
- "source": "geojson",
- "filter": ["==", "cluster", true],
- "layout": {
- "text-field": "{point_count} ({max})",
- "text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"],
- "text-size": 12,
- "text-allow-overlap": true,
- "text-ignore-placement": true
+ 'id': 'cluster_label',
+ 'type': 'symbol',
+ 'source': 'geojson',
+ 'filter': ['==', 'cluster', true],
+ 'layout': {
+ 'text-field': '{point_count} ({max})',
+ 'text-font': ['Open Sans Semibold', 'Arial Unicode MS Bold'],
+ 'text-size': 12,
+ 'text-allow-overlap': true,
+ 'text-ignore-placement': true
}
});
map.addLayer({
- "id": "unclustered_point",
- "type": "circle",
- "source": "geojson",
- "filter": ["!=", "cluster", true],
- "paint": {
- "circle-color": "rgb(0, 0, 200)",
- "circle-radius": 10
+ 'id': 'unclustered_point',
+ 'type': 'circle',
+ 'source': 'geojson',
+ 'filter': ['!=', 'cluster', true],
+ 'paint': {
+ 'circle-color': 'rgb(0, 0, 200)',
+ 'circle-radius': 10
}
});
var hoverData = {
- "type": "FeatureCollection",
- "features": []
+ 'type': 'FeatureCollection',
+ 'features': []
};
map.addSource('cluster_children', {
- "type": "geojson",
- "data": hoverData
+ 'type': 'geojson',
+ 'data': hoverData
});
map.addLayer({
- "id": "cluster_children",
- "type": "circle",
- "source": "cluster_children",
- "paint": {
- "circle-color": "rgb(0, 150, 0)",
- "circle-radius": 7
+ 'id': 'cluster_children',
+ 'type': 'circle',
+ 'source': 'cluster_children',
+ 'paint': {
+ 'circle-color': 'rgb(0, 150, 0)',
+ 'circle-radius': 7
}
});
@@ -117,7 +117,7 @@
});
});
- map.on('mouseleave', 'cluster', (e) => {
+ map.on('mouseleave', 'cluster', (_) => {
map.getCanvas().style.cursor = '';
updateHover([]);
});
diff --git a/debug/color_spaces.html b/debug/color_spaces.html
index 466ab836dc..c9fc0df5aa 100644
--- a/debug/color_spaces.html
+++ b/debug/color_spaces.html
@@ -46,19 +46,19 @@
map.on('load', function() {
map.addSource('geojson', {
- "type": "geojson",
- "data": "https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_admin_0_countries.geojson"
+ 'type': 'geojson',
+ 'data': 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_admin_0_countries.geojson'
});
map.addLayer({
- "id": "countries",
- "type": "fill",
- "source": "geojson",
- "paint": {
- "fill-color": {
- "property": "pop_est",
- "colorSpace": "lab",
- "stops": [
+ 'id': 'countries',
+ 'type': 'fill',
+ 'source': 'geojson',
+ 'paint': {
+ 'fill-color': {
+ 'property': 'pop_est',
+ 'colorSpace': 'lab',
+ 'stops': [
[0, 'blue'],
[140041247, 'red']
]
@@ -69,9 +69,9 @@
function pickInterpolation(input) {
map.setPaintProperty('countries', 'fill-color', {
- "property": "pop_est",
- "colorSpace": input.value,
- "stops": [
+ 'property': 'pop_est',
+ 'colorSpace': input.value,
+ 'stops': [
[0, 'blue'],
[140041247, 'red']
]
diff --git a/debug/csp-static.html b/debug/csp-static.html
index 6db7070814..26b27d4e1f 100644
--- a/debug/csp-static.html
+++ b/debug/csp-static.html
@@ -22,7 +22,7 @@
maplibregl.workerUrl = '/dist/maplibre-gl-csp-worker.js';
-var map = window.map = new maplibregl.Map({
+new maplibregl.Map({
container: 'map',
zoom: 12.5,
center: [-77.01866, 38.888],
diff --git a/debug/csp.html b/debug/csp.html
index 80e56c1772..bc2457c462 100644
--- a/debug/csp.html
+++ b/debug/csp.html
@@ -18,7 +18,7 @@