diff --git a/.circleci/config.yml b/.circleci/config.yml index 76b8b071300..ae559eb988a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,6 @@ -version: 2 +version: 2.1 +orbs: + aws-cli: circleci/aws-cli@0.1.16 workflows: version: 2 @@ -26,6 +28,14 @@ workflows: filters: tags: only: /.*/ + - collect-stats: + requires: + - build + filters: + tags: + ignore: /.*/ + branches: + only: master - test-flow: requires: - prepare @@ -56,6 +66,12 @@ workflows: filters: tags: only: /.*/ + - test-browser: + requires: + - prepare + filters: + tags: + only: /.*/ - deploy-benchmarks: requires: - lint @@ -89,7 +105,7 @@ workflows: defaults: &defaults docker: - - image: mbgl/80dbb7f452:linux + - image: circleci/node:10.16-browsers working_directory: ~/mapbox-gl-js jobs: @@ -99,10 +115,10 @@ jobs: - checkout - restore_cache: keys: - - v2-yarn-{{ checksum "yarn.lock" }} + - v3-yarn-{{ checksum "yarn.lock" }} - run: yarn - save_cache: - key: v2-yarn-{{ checksum "yarn.lock" }} + key: v3-yarn-{{ checksum "yarn.lock" }} paths: - '~/.yarn' - 'node_modules' @@ -118,13 +134,13 @@ jobs: at: . - restore_cache: keys: - - v1-lint-{{ .Branch }} - - v1-lint + - v2-lint-{{ .Branch }} + - v2-lint - run: yarn run lint - run: yarn run lint-docs - run: yarn run lint-css - save_cache: - key: v1-lint-{{ .Branch }}-{{ .Revision }} + key: v2-lint-{{ .Branch }}-{{ .Revision }} paths: - '.eslintcache' @@ -134,11 +150,25 @@ jobs: - 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 master + command: | + if [ -n "${WEB_METRICS_TOKEN}" ]; then + if [[ $CIRCLE_BRANCH == master ]]; 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: @@ -149,7 +179,24 @@ jobs: steps: - attach_workspace: at: . - - run: node build/check-bundle-size.js "dist/mapbox-gl.js" "GL JS - Minified" + - 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 @@ -163,14 +210,14 @@ jobs: steps: - attach_workspace: at: . - - run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test-unit + - run: yarn run test-unit test-render: <<: *defaults steps: - attach_workspace: at: . - - run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test-render + - run: yarn run test-render - store_artifacts: path: "test/integration/render-tests/index.html" @@ -179,10 +226,32 @@ jobs: steps: - attach_workspace: at: . - - run: xvfb-run --server-args="-screen 0 1024x768x24" npm run test-query + - 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: @@ -198,6 +267,7 @@ jobs: - run: name: Build command: BENCHMARK_VERSION="${CIRCLE_TAG:-$CIRCLE_BRANCH} $(git rev-parse --short=7 HEAD)" yarn run build-benchmarks + - aws-cli/install - run: name: Upload benchmark command: aws s3 cp --acl public-read --content-type application/javascript bench/versions/benchmarks_generated.js s3://mapbox-gl-js/${CIRCLE_TAG:-$CIRCLE_BRANCH}/benchmarks.js @@ -210,18 +280,22 @@ jobs: steps: - attach_workspace: at: . + - aws-cli/install - run: name: Deploy release command: | function upload { aws s3 cp --acl public-read --content-type $2 dist/$1 s3://mapbox-gl-js/$CIRCLE_TAG/$1 - - AWS_ACCESS_KEY_ID=$AWSCN_ACCESS_KEY_ID \ - AWS_SECRET_ACCESS_KEY=$AWSCN_SECRET_ACCESS_KEY \ - aws s3 cp --region cn-north-1 --acl public-read --content-type $2 dist/$1 s3://mapbox-gl-js-cn-north-1/$CIRCLE_TAG/$1 } upload mapbox-gl.js application/javascript upload mapbox-gl.js.map application/octet-stream upload mapbox-gl-dev.js application/javascript upload mapbox-gl.css text/css + + upload mapbox-gl-unminified.js application/javascript + upload mapbox-gl-unminified.js.map application/octet-stream + upload mapbox-gl-csp.js application/javascript + upload mapbox-gl-csp.js.map application/octet-stream + upload mapbox-gl-csp-worker.js application/javascript + upload mapbox-gl-csp-worker.js.map application/octet-stream diff --git a/.eslintrc b/.eslintrc index efa361ace23..b17f3bafc21 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,7 +10,8 @@ }, "plugins": [ "flowtype", - "import" + "import", + "jsdoc" ], "rules": { // temporarily disabled due to https://github.com/babel/babel-eslint/issues/485 @@ -51,7 +52,7 @@ }], "no-unused-vars": ["error", {"argsIgnorePattern": "^_$"}], "no-warning-comments": "error", - "object-curly-spacing": "off", + "object-curly-spacing": ["error", "never"], "prefer-arrow-callback": "error", "prefer-const": ["error", {"destructuring": "all"}], "prefer-template": "error", @@ -73,8 +74,32 @@ }], "no-multiple-empty-lines": [ "error", { "max": 1 - }] + }], + "jsdoc/check-param-names": "warn", + "jsdoc/require-param": "warn", + "jsdoc/require-param-description": "warn", + "jsdoc/require-param-name": "warn", + "jsdoc/require-returns": "warn", + "jsdoc/require-returns-description": "warn" + }, + "settings": { + "jsdoc":{ + "ignorePrivate": true + } }, + "overrides": [ + { + "files": ["debug/**", "bench/**", "test/**", "src/style-spec/**"], + "rules": { + "jsdoc/check-param-names": "off", + "jsdoc/require-param": "off", + "jsdoc/require-param-description": "off", + "jsdoc/require-param-name": "off", + "jsdoc/require-returns": "off", + "jsdoc/require-returns-description": "off" + } + } + ], "globals": { "performance": true }, diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2f3c8886fbf..9aebed38055 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,9 +3,12 @@ - [ ] briefly describe the changes in this PR + - [ ] include before/after visuals or gifs if this PR includes visual changes - [ ] write tests for all new functionality - [ ] document any changes to public APIs - [ ] post benchmark scores - [ ] manually test the debug page - - [ ] tagged `@mapbox/studio` and/or `@mapbox/maps-design` if this PR includes style spec changes + - [ ] tagged `@mapbox/map-design-team` `@mapbox/static-apis` if this PR includes style spec API or visual changes - [ ] tagged `@mapbox/gl-native` if this PR includes shader changes or needs a native port + - [ ] apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog' + - [ ] add an entry inside this element for inclusion in the `mapbox-gl-js` changelog: `` diff --git a/.gitignore b/.gitignore index 24de88105db..cd01db1f6e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ /rollup/build/ -/docs/components/api.json /dist/ -/docs/pages/dist/ -/docs/img/dist/ +*.es.js *.js.map node_modules package-lock.json @@ -17,6 +15,9 @@ test/integration/**/index*.html test/integration/**/actual.png test/integration/**/actual.json test/integration/**/diff.png +test/integration/**/test-results.xml +test/integration/dist/**/*.js +test/integration/dist/**/*.json .eslintcache src/style-spec/dist/index.js _batfish_site @@ -25,3 +26,4 @@ _site yarn-error.log yarn-debug.log npm-debug.log +.idea diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000000..e43b0f98895 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +.DS_Store diff --git a/.stylelintrc b/.stylelintrc index a1c8ca89778..ed957aa8af0 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -5,6 +5,9 @@ "declaration-block-semicolon-newline-after": "always-multi-line", "block-opening-brace-space-before": "always-multi-line", "declaration-block-single-line-max-declarations": 3, - "selector-class-pattern": "mapboxgl-[a-z-]+" + "selector-class-pattern": "mapboxgl-[a-z-]+", + "at-rule-no-unknown": [true, { + "ignoreAtRules": ["svg-load"] + }] } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 93470adc10d..1adef5386dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,271 @@ +## 1.10.0 + +### ✨ Features +* Add `mapboxgl.prewarm()` and `mapboxgl.clearPrewarmedResources()` methods to allow developers to optimize load times for their maps ([#9391](https://github.com/mapbox/mapbox-gl-js/pull/9391)) +* Add `index-of` and `slice` expressions to search arrays and strings for the first occurrence of a specified value and return a section of the original array or string ([#9450](https://github.com/mapbox/mapbox-gl-js/pull/9450)) (h/t [lbutler](https://github.com/lbutler)) +* Correctly set RTL text plugin status if the plugin URL could not be loaded. This allows developers to add retry logic on network errors when loading the plugin ([#9489](https://github.com/mapbox/mapbox-gl-js/pull/9489)) + +### 🍏 Gestures +This release significantly refactors and improves gesture handling on desktop and mobile. Three new touch gestures have been added: `two-finger swipe` to adjust pitch, `two-finger double tap` to zoom out, and `tap then drag` to adjust zoom with one finger ([#9365](https://github.com/mapbox/mapbox-gl-js/pull/9365)). In addition, this release brings the following changes and bug fixes: + +- It's now possible to interact with multiple maps on the same page at the same time ([#9365](https://github.com/mapbox/mapbox-gl-js/pull/9365)) +- Fix map jump when releasing one finger after pinch zoom ([#9136](https://github.com/mapbox/mapbox-gl-js/issues/9136)) +- Stop mousedown and touchstart from interrupting `easeTo` animations when interaction handlers are disabled ([#8725](https://github.com/mapbox/mapbox-gl-js/issues/8725)) +- Stop mouse wheel from interrupting animations when `map.scrollZoom` is disabled ([#9230](https://github.com/mapbox/mapbox-gl-js/issues/9230)) +- A camera change can no longer be prevented by disabling the interaction handler within the camera change event. Selectively prevent camera changes by listening to the `mousedown` or `touchstart` map event and calling [.preventDefault()](https://docs.mapbox.com/mapbox-gl-js/api/#mapmouseevent#preventdefault) ([#9365](https://github.com/mapbox/mapbox-gl-js/pull/9365)) +- Undocumented properties on the camera change events fired by the doubleClickZoom handler have been removed ([#9365](https://github.com/mapbox/mapbox-gl-js/pull/9365)) + +### 🐞 Improvements and bug fixes +* Line labels now have improved collision detection, with greater precision in placement, reduced memory footprint, better placement under pitched camera orientations ([#9219](https://github.com/mapbox/mapbox-gl-js/pull/9219)) +* Fix `GlyphManager` continually re-requesting missing glyph ranges ([#8027](https://github.com/mapbox/mapbox-gl-js/issues/8027), fixed by [#9375](https://github.com/mapbox/mapbox-gl-js/pull/9375)) (h/t [oterral](https://github.com/oterral)) +* Avoid throwing errors when calling certain popup methods before the popup element is created ([#9433](https://github.com/mapbox/mapbox-gl-js/pull/9433)) +* Fix a bug where fill-extrusion features with colinear points were not returned by `map.queryRenderedFeatures(...)` ([#9454](https://github.com/mapbox/mapbox-gl-js/pull/9454)) +* Fix a bug where using feature state on a large input could cause a stack overflow error ([#9463](https://github.com/mapbox/mapbox-gl-js/pull/9463)) +* Fix exception when using `background-pattern` with data driven expressions ([#9518](https://github.com/mapbox/mapbox-gl-js/issues/9518), fixed by [#9520](https://github.com/mapbox/mapbox-gl-js/pull/9520)) +* Fix a bug where UI popups were potentially leaking event listeners ([#9498](https://github.com/mapbox/mapbox-gl-js/pull/9498)) (h/t [mbell697](https://github.com/mbell697)) +* Fix a bug where the `within` expression would return inconsistent values for points on tile boundaries ([#9411](https://github.com/mapbox/mapbox-gl-js/issues/9411), [#9428](https://github.com/mapbox/mapbox-gl-js/pull/9428)) +* Fix a bug where the `within` expression would incorrectly evaluate geometries that cross the antimeridian ([#9440](https://github.com/mapbox/mapbox-gl-js/pull/9440)) +* Fix possible undefined exception on paint variable of style layer ([#9437](https://github.com/mapbox/mapbox-gl-js/pull/9437)) (h/t [mannnick24](https://github.com/mannnick24)) +* Upgrade minimist to ^1.2.5 to get fix for security issue [CVE-2020-7598](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7598) upstream ([#9425](https://github.com/mapbox/mapbox-gl-js/issues/9431), fixed by [#9425](https://github.com/mapbox/mapbox-gl-js/pull/9425)) (h/t [watson](https://github.com/watson)) + +## 1.9.1 + +### 🐞 Bug fixes +* Fix a bug [#9477](https://github.com/mapbox/mapbox-gl-js/issues/9477) in `Map#fitBounds(..)` wherein the `padding` passed to options would get applied twice. +* Fix rendering bug [#9479](https://github.com/mapbox/mapbox-gl-js/issues/9479) caused when data-driven `*-pattern` properties reference images added with `Map#addImage(..)`. +* Fix a bug [#9468](https://github.com/mapbox/mapbox-gl-js/issues/9468) in which an exception would get thrown when updating symbol layer paint property using `setPaintProperty`. + +## 1.9.0 +With this release, we're adding [a new changelog policy](https://github.com/mapbox/mapbox-gl-js/blob/master/CONTRIBUTING.md#changelog-conventions) to our contribution guidelines. + +This release also fixes several long-standing bugs and unintentional rendering behavior with `line-pattern`. The fixes come with a visual change to how patterns added with `line-pattern` scale. Previously, patterns that became larger than the line would be clipped, sometimes distorting the pattern, particularly on mobile and retina devices. Now the pattern will be scaled to fit under all circumstances. [#9266](https://github.com/mapbox/mapbox-gl-js/pull/9266) showcases examples of the visual differences. For more information and to provide feedback on this change, see [#9394](https://github.com/mapbox/mapbox-gl-js/pull/9394). + +### ✨ Features +* Add `within` expression for testing whether an evaluated feature lies within a given GeoJSON object ([#9352](https://github.com/mapbox/mapbox-gl-js/pull/9352)). + - We are aware of an edge case in which points with wrapped coordinates (e.g. longitude -185) are not evaluated properly. See ([#9442](https://github.com/mapbox/mapbox-gl-js/issues/9442)) for more information. + - An example of the `within` expression:
+`"icon-opacity": ["case", ["==", ["within", "some-polygon"], true], 1, +["==", ["within", "some-polygon"], false], 0]` +* Map API functions such as `easeTo` and `flyTo` now support `padding: PaddingOptions` which lets developers shift a map's center of perspective when building floating sidebars ([#8638](https://github.com/mapbox/mapbox-gl-js/pull/8638)) + +### 🍏 Improvements +* Results from `queryRenderedFeatures` now have evaluated property values rather than raw expressions ([#9198](https://github.com/mapbox/mapbox-gl-js/pull/9198)) +* Improve scaling of patterns used in `line-pattern` on all device resolutions and pixel ratios ([#9266](https://github.com/mapbox/mapbox-gl-js/pull/9266)) +* Slightly improve GPU memory footprint ([#9377](https://github.com/mapbox/mapbox-gl-js/pull/9377)) +* `LngLatBounds.extend` is more flexible because it now accepts objects with `lat` and `lon` properties as well as arrays of coordinates ([#9293](https://github.com/mapbox/mapbox-gl-js/pull/9293)) +* Reduce bundle size and improve visual quality of `showTileBoundaries` debug text ([#9267](https://github.com/mapbox/mapbox-gl-js/pull/9267)) + +### 🐞 Bug fixes +* Correctly adjust patterns added with `addImage(id, image, pixelRatio)` by the asset pixel ratio, not the device pixel ratio ([#9372](https://github.com/mapbox/mapbox-gl-js/pull/9372)) +* Allow needle argument to `in` expression to be false ([#9295](https://github.com/mapbox/mapbox-gl-js/pull/9295)) +* Fix exception thrown when trying to set `feature-state` for a layer that has been removed, fixes [#8634](https://github.com/mapbox/mapbox-gl-js/issues/8634) ([#9305](https://github.com/mapbox/mapbox-gl-js/pull/9305)) +* Fix a bug where maps were not displaying inside elements with `dir=rtl` ([#9332](https://github.com/mapbox/mapbox-gl-js/pull/9332)) +* Fix a rendering error for very old versions of Chrome (ca. 2016) where text would appear much bigger than intended ([#9349](https://github.com/mapbox/mapbox-gl-js/pull/9349)) +* Prevent exception resulting from `line-dash-array` of empty length ([#9385](https://github.com/mapbox/mapbox-gl-js/pull/9385)) +* Fix a bug where `icon-image` expression that evaluates to an empty string (`''`) produced a warning ([#9380](https://github.com/mapbox/mapbox-gl-js/pull/9380)) +* Fix a bug where certain `popup` methods threw errors when accessing the container element before it was created, fixes [#9429](https://github.com/mapbox/mapbox-gl-js/issues/9429)([#9433](https://github.com/mapbox/mapbox-gl-js/pull/9433)) + +## 1.8.1 + +* Fixed a bug where all labels showed up on a diagonal line on Windows when using an integrated Intel GPU from the Haswell generation ([#9327](https://github.com/mapbox/mapbox-gl-js/issues/9327), fixed by reverting [#9229](https://github.com/mapbox/mapbox-gl-js/pull/9229)) + +## 1.8.0 + +### ✨ Features and improvements +* Reduce size of line atlas by removing unused channels ([#9232](https://github.com/mapbox/mapbox-gl-js/pull/9232)) +* Prevent empty buffers from being created for debug data when unused ([#9237](https://github.com/mapbox/mapbox-gl-js/pull/9237)) +* Add space between distance and unit in scale control ([#9276](https://github.com/mapbox/mapbox-gl-js/pull/9276)) (h/t [gely](https://api.github.com/users/gely)) and ([#9284](https://github.com/mapbox/mapbox-gl-js/pull/9284)) (h/t [pakastin](https://api.github.com/users/pakastin)) +* Add a `showAccuracyCircle` option to GeolocateControl that shows the accuracy of the user's location as a transparent circle. Mapbox GL JS will show this circle by default. ([#9253](https://github.com/mapbox/mapbox-gl-js/pull/9253)) (h/t [Meekohi](https://api.github.com/users/Meekohi)) +* Implemented a new tile coverage algorithm to enable level-of-detail support in a future release ([#8975](https://github.com/mapbox/mapbox-gl-js/pull/8975)) + +### 🐞 Bug fixes +* `line-dasharray` is now ignored correctly when `line-pattern` is set ([#9189](https://github.com/mapbox/mapbox-gl-js/pull/9189)) +* Fix line distances breaking gradient across tile boundaries ([#9220](https://github.com/mapbox/mapbox-gl-js/pull/9220)) +* Fix a bug where lines with duplicate endpoints could disappear at zoom 18+ ([#9218](https://github.com/mapbox/mapbox-gl-js/pull/9218)) +* Fix a bug where Ctrl-click to drag rotate the map was disabled if the Alt, Cmd or Windows key is also pressed ([#9203](https://github.com/mapbox/mapbox-gl-js/pull/9203)) +* Pass errors to `getClusterExpansionZoom`, `getClusterChildren`, and `getClusterLeaves` callbacks ([#9251](https://github.com/mapbox/mapbox-gl-js/pull/9251)) +* Fix a rendering performance regression ([#9261](https://github.com/mapbox/mapbox-gl-js/pull/9261)) +* Fix visual artifact for `line-dasharray` ([#9246](https://github.com/mapbox/mapbox-gl-js/pull/9246)) +* Fixed a bug in the GeolocateControl which resulted in an error when `trackUserLocation` was `false` and the control was removed before the Geolocation API had returned a location ([#9291](https://github.com/mapbox/mapbox-gl-js/pull/9291)) +* Fix `promoteId` for line layers ([#9210](https://github.com/mapbox/mapbox-gl-js/pull/9210)) +* Improve accuracy of distance calculations ([#9202](https://github.com/mapbox/mapbox-gl-js/pull/9202)) (h/t [Meekohi](https://api.github.com/users/Meekohi)) + + +## 1.7.0 + +### ✨ Features +* Add `promoteId` option to use a feature property as ID for feature state ([#8987](https://github.com/mapbox/mapbox-gl-js/pull/8987)) +* Add a new constructor option to `mapboxgl.Popup`, `closeOnMove`, that closes the popup when the map's position changes ([#9163](https://github.com/mapbox/mapbox-gl-js/pull/9163)) +* Allow creating a map without a style (an empty one will be created automatically) ( h/t @stepankuzmin ) ([#8924](https://github.com/mapbox/mapbox-gl-js/pull/8924)) +* `map.once()` now allows specifying a layer id as a third parameter making it consistent with `map.on()` ([#8875](https://github.com/mapbox/mapbox-gl-js/pull/8875)) + +### 🍏 Improvements +* Improve performance of raster layers on large screens ([#9050](https://github.com/mapbox/mapbox-gl-js/pull/9050)) +* Improve performance for hillshade and raster layers by implementing a progressive enhancement that utilizes `ImageBitmap` and `OffscreenCanvas` ([#8845](https://github.com/mapbox/mapbox-gl-js/pull/8845)) +* Improve performance for raster tile rendering by using the stencil buffer ([#9012](https://github.com/mapbox/mapbox-gl-js/pull/9012)) +* Update `symbol-avoid-edges` documentation to acknowledge the existence of global collision detection ([#9157](https://github.com/mapbox/mapbox-gl-js/pull/9157)) +* Remove reference to `in` function which has been replaced by the `in` expression ([#9102](https://github.com/mapbox/mapbox-gl-js/pull/9102)) + +### 🐞 Bug Fixes +* Change the type of tile id key to string to prevent hash collisions ([#8979](https://github.com/mapbox/mapbox-gl-js/pull/8979)) +* Prevent changing bearing via URL hash when rotation is disabled ([#9156](https://github.com/mapbox/mapbox-gl-js/pull/9156)) +* Fix URL hash with no bearing causing map to fail to load ([#9170](https://github.com/mapbox/mapbox-gl-js/pull/9170)) +* Fix bug in `GeolocateControl` where multiple instances of the control on one page may result in the user location not being updated ([#9092](https://github.com/mapbox/mapbox-gl-js/pull/9092)) +* Fix query `fill-extrusions` made from polygons with coincident points and polygons with less than four points ([#9138](https://github.com/mapbox/mapbox-gl-js/pull/9138)) +* Fix bug where `symbol-sort-key` was not used for collisions that crossed tile boundaries ([#9054](https://github.com/mapbox/mapbox-gl-js/pull/9054)) +* Fix bug in `DragRotateHandler._onMouseUp` getting stuck in drag/rotate ([#9137](https://github.com/mapbox/mapbox-gl-js/pull/9137)) +* Fix "Click on Compass" on some mobile devices (add `clickTolerance` to `DragRotateHandler`) ([#9015](https://github.com/mapbox/mapbox-gl-js/pull/9015)) (h/t [Yanonix](https://github.com/Yanonix)) + +## 1.6.1 + +### 🐞 Bug Fixes +* Fix style validation error messages not being displayed ([#9073](https://github.com/mapbox/mapbox-gl-js/pull/9073)) +* Fix deferred loading of rtl-text-plugin not working for labels created from GeoJSON sources ([#9091](https://github.com/mapbox/mapbox-gl-js/pull/9091)) +* Fix RTL text not being rendered with the rtl-text-plugin on pages that don't allow `script-src: blob:` in their CSP.([#9122](https://github.com/mapbox/mapbox-gl-js/pull/9122)) + +## 1.6.0 + +### ✨ Features +* Add ability to insert images into text labels using an `image` expression within a `format` expression: `"text-field": ["format", "Some text", ["image", "my-image"], "some more text"]` ([#8904](https://github.com/mapbox/mapbox-gl-js/pull/8904)) +* Add support for stretchable images (aka nine-part or nine-patch images). Stretchable images can be used with `icon-text-fit` to draw resized images with unstretched corners and borders. ([#8997](https://github.com/mapbox/mapbox-gl-js/pull/8997)) +* Add `in` expression. It can check if a value is in an array (`["in", value, array]`) or a substring is in a string (`["in", substring, string]`) ([#8876](https://github.com/mapbox/mapbox-gl-js/pull/8876)) +* Add `minPitch` and `maxPitch` map options ([#8834](https://github.com/mapbox/mapbox-gl-js/pull/8834)) +* Add `rotation`, `rotationAlignment` and `pitchAlignment` options to markers ([#8836](https://github.com/mapbox/mapbox-gl-js/pull/8836)) (h/t [dburnsii](https://github.com/dburnsii)) +* Add methods to Popup to manipulate container class names ([#8759](https://github.com/mapbox/mapbox-gl-js/pull/8759)) (h/t [Ashot-KR](https://github.com/Ashot-KR)) +* Add configurable inertia settings for panning (h/t @aMoniker) ([#8887](https://github.com/mapbox/mapbox-gl-js/pull/8887)) +* Add ability to localize UI controls ([#8095](https://github.com/mapbox/mapbox-gl-js/pull/8095)) (h/t [dmytro-gokun](https://github.com/dmytro-gokun)) +* Add LatLngBounds.contains() method ([#7512](https://github.com/mapbox/mapbox-gl-js/issues/7512), fixed by [#8200](https://github.com/mapbox/mapbox-gl-js/pull/8200)) +* Add option to load rtl-text-plugin lazily ([#8865](https://github.com/mapbox/mapbox-gl-js/pull/8865)) +* Add `essential` parameter to AnimationOptions that can override `prefers-reduced-motion: reduce` ([#8743](https://github.com/mapbox/mapbox-gl-js/issues/8743), fixed by [#8883](https://github.com/mapbox/mapbox-gl-js/pull/8883)) + +### 🍏 Improvements +* Allow rendering full world smaller than 512px. To restore the previous limit call `map.setMinZoom(0)` ([#9028](https://github.com/mapbox/mapbox-gl-js/pull/9028)) +* Add an es modules build for mapbox-gl-style-spec in dist/ ([#8247](https://github.com/mapbox/mapbox-gl-js/pull/8247)) (h/t [ahocevar](https://github.com/ahocevar)) +* Add 'image/webp,*/*' accept header to fetch/ajax image requests when webp supported ([#8262](https://github.com/mapbox/mapbox-gl-js/pull/8262)) +* Improve documentation for setStyle, getStyle, and isStyleLoaded ([#8807](https://github.com/mapbox/mapbox-gl-js/pull/8807)) + +### 🐞 Bug Fixes +* Fix map rendering after addImage and removeImage are used to change a used image ([#9016](https://github.com/mapbox/mapbox-gl-js/pull/9016)) +* Fix visibility of controls in High Contrast mode in IE ([#8874](https://github.com/mapbox/mapbox-gl-js/pull/8874)) +* Fix customizable url hash string in IE 11 ([#8990](https://github.com/mapbox/mapbox-gl-js/pull/8990)) (h/t [pakastin](https://github.com/pakastin)) +* Allow expression stops up to zoom 24 instead of 22 ([#8908](https://github.com/mapbox/mapbox-gl-js/pull/8908)) (h/t [nicholas-l](https://github.com/nicholas-l)) +* Fix alignment of lines in really overscaled tiles ([#9024](https://github.com/mapbox/mapbox-gl-js/pull/9024)) +* Fix `Failed to execute 'shaderSource' on 'WebGLRenderingContext'` errors ([#9017](https://github.com/mapbox/mapbox-gl-js/pull/9017)) +* Make expression validation fail on NaN ([#8615](https://github.com/mapbox/mapbox-gl-js/pull/8615)) +* Fix setLayerZoomRange bug that caused tiles to be re-requested ([#7865](https://github.com/mapbox/mapbox-gl-js/issues/7865), fixed by [#8854](https://github.com/mapbox/mapbox-gl-js/pull/8854)) +* Fix `map.showTileBoundaries` rendering ([#7314](https://github.com/mapbox/mapbox-gl-js/pull/7314)) +* Fix using `generateId` in conjunction with `cluster` in a GeoJSONSource ([#8223](https://github.com/mapbox/mapbox-gl-js/issues/8223), fixed by [#8945](https://github.com/mapbox/mapbox-gl-js/pull/8945)) +* Fix opening popup on a marker from keyboard ([#6835](https://github.com/mapbox/mapbox-gl-js/pull/6835)) +* Fix error thrown when request aborted ([#7614](https://github.com/mapbox/mapbox-gl-js/issues/7614), fixed by [#9021](https://github.com/mapbox/mapbox-gl-js/pull/9021)) +* Fix attribution control when repeatedly removing and adding it ([#9052](https://github.com/mapbox/mapbox-gl-js/pull/9052)) + +## 1.5.1 +This patch introduces two workarounds that address longstanding issues related to unbounded memory growth in Safari, including [#8771](https://github.com/mapbox/mapbox-gl-js/issues/8771) and [#4695](https://github.com/mapbox/mapbox-gl-js/issues/4695). We’ve identified two memory leaks in Safari: one in the [CacheStorage](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) API, addressed by [#8956](https://github.com/mapbox/mapbox-gl-js/pull/8956), and one in transferring data between web workers through [Transferables](https://developer.mozilla.org/en-US/docs/Web/API/Transferable), addressed by [#9003](https://github.com/mapbox/mapbox-gl-js/pull/9003). + +### 🍏 Improvements +* Implement workaround for memory leak in Safari when using the `CacheStorage` API. ( [#8856](https://github.com/mapbox/mapbox-gl-js/pull/8956)) +* Implement workaround for memory leak in Safari when using `Transferable` objects to transfer `ArrayBuffers` to WebWorkers. If GL-JS detetcts that it is running in Safari, the use of `Transferables` to transfer data to WebWorkers is disabled. ( [#9003](https://github.com/mapbox/mapbox-gl-js/pull/9003)) +* Improve animation performance when using `map.setData`. ([#8913](https://github.com/mapbox/mapbox-gl-js/pull/8913)) (h/t [msbarry](https://github.com/msbarry)) + +## 1.5.0 + +### ✨ Features +* Add disabled icon to GeolocateControl if user denies geolocation permission. [#8871](https://github.com/mapbox/mapbox-gl-js/pull/8871)) +* Add `outofmaxbounds` event to GeolocateControl, which is emitted when the user is outside of `map.maxBounds` ([#8756](https://github.com/mapbox/mapbox-gl-js/pull/8756)) (h/t [MoradiDavijani](https://github.com/MoradiDavijani)) +* Add `mapboxgl.getRTLTextPluginStatus()` to query the current status of the `rtl-text-plugin` to make it easier to allow clearing the plugin when necessary. (ref. [#7869](https://github.com/mapbox/mapbox-gl-js/issues/7869)) ([#8864](https://github.com/mapbox/mapbox-gl-js/pull/8864)) +* Allow `hash` Map option to be set as a string, which sets the map hash in the url to a custom query parameter. ([#8603](https://github.com/mapbox/mapbox-gl-js/pull/8603)) (h/t [SebCorbin](https://github.com/SebCorbin)) + +### 🍏 Improvements +* Fade symbols faster when zooming out quickly, reducing overlap. ([#8628](https://github.com/mapbox/mapbox-gl-js/pull/8628)) +* Reduce memory usage for vector tiles that contain long strings in feature properties. ( [#8863](https://github.com/mapbox/mapbox-gl-js/pull/8863)) + +### 🐞 Bug Fixes +* Fix `text-variable-anchor` not trying multiple placements during collision with icons when `icon-text-fit` is enabled. ([#8803](https://github.com/mapbox/mapbox-gl-js/pull/8803)) +* Fix `icon-text-fit` not properly respecting vertical labels. ([#8835](https://github.com/mapbox/mapbox-gl-js/pull/8835)) +* Fix opacity interpolation for composition expressions. ([#8818](https://github.com/mapbox/mapbox-gl-js/pull/8818)) +* Fix rotate and pitch events being fired at the same time. ([#8872](https://github.com/mapbox/mapbox-gl-js/pull/8872)) +* Fix memory leaks that occured during tile loading and map removal.([#8813](https://github.com/mapbox/mapbox-gl-js/pull/8813) and [#8850](https://github.com/mapbox/mapbox-gl-js/pull/8850)) +* Fix web-worker transfer of `ArrayBuffers` in environments where `instanceof ArrayBuffer` fails.(e.g `cypress`) ([#8868](https://github.com/mapbox/mapbox-gl-js/pull/8868)) + +## 1.4.1 + +### 🐞 Bug Fixes +* Fix the way that `coalesce` handles the `image` operator so available images are rendered properly ([#8839](https://github.com/mapbox/mapbox-gl-js/pull/8839)) +* Do not emit the `styleimagemissing` event for an empty string value ([#8840](https://github.com/mapbox/mapbox-gl-js/pull/8840)) +* Fix serialization of `ResolvedImage` type so `*-pattern` properties work properly ([#8833](https://github.com/mapbox/mapbox-gl-js/pull/8833)) + +## 1.4.0 + +### ✨ Features +* Add `image` expression operator to determine image availability ([#8684](https://github.com/mapbox/mapbox-gl-js/pull/8684)) +* Enable `text-offset` with variable label placement ([#8642](https://github.com/mapbox/mapbox-gl-js/pull/8642)) + +### 🍏 Improvements +* Faster loading and better look of raster terrain ([#8694](https://github.com/mapbox/mapbox-gl-js/pull/8694)) +* Improved code documentation around resizing and {get/set}RenderedWorldCopies and more ([#8748](https://github.com/mapbox/mapbox-gl-js/pull/8748), [#8754](https://github.com/mapbox/mapbox-gl-js/pull/8754)) +* Improve single vs. multi-touch zoom & pan interaction (#7196) ([#8100](https://github.com/mapbox/mapbox-gl-js/pull/8100)) + +### 🐞 Bug fixes +* Fix rendering of `collisionBox` when `text-translate` or `icon-translate` is enabled ([#8659](https://github.com/mapbox/mapbox-gl-js/pull/8659)) +* Fix `TypeError` when reloading a source and immediately removing the map ([#8711](https://github.com/mapbox/mapbox-gl-js/pull/8711)) +* Adding tooltip to the geolocation control button ([#8735](https://github.com/mapbox/mapbox-gl-js/pull/8735)) (h/t [BAByrne](https://github.com/BAByrne)) +* Add `originalEvent` property to NavigationControl events ([#8693](https://github.com/mapbox/mapbox-gl-js/pull/8693)) (h/t [stepankuzmin](https://github.com/stepankuzmin)) +* Don't cancel follow mode in the GeolocateControl when resizing the map or rotating the screen ([#8736](https://github.com/mapbox/mapbox-gl-js/pull/8736)) +* Fix error when calling `Popup#trackPointer` before setting its content or location ([#8757](https://github.com/mapbox/mapbox-gl-js/pull/8757)) (h/t [zxwandrew](https://github.com/zxwandrew)) +* Respect newline characters when text-max-width is set to zero ([#8706](https://github.com/mapbox/mapbox-gl-js/pull/8706)) +* Update earcut to v2.2.0 to fix polygon tesselation errors ([#8772](https://github.com/mapbox/mapbox-gl-js/pull/8772)) +* Fix icon-fit with variable label placement ([#8755](https://github.com/mapbox/mapbox-gl-js/pull/8755)) +* Icons stretched with `icon-text-fit` are now sized correctly ([#8741](https://github.com/mapbox/mapbox-gl-js/pull/8741)) +* Collision detection for icons with `icon-text-fit` now works correctly ([#8741](https://github.com/mapbox/mapbox-gl-js/pull/8741)) + +## 1.3.2 + +- Fix a SecurityError in Firefox >= 69 when accessing the cache [#8780](https://github.com/mapbox/mapbox-gl-js/pull/8780) + +## 1.3.1 + +### 🐞 Bug Fixes + +- Fix a race condition that produced an error when a map was removed while reloading a source. [#8711](https://github.com/mapbox/mapbox-gl-js/pull/8711) +- Fix a race condition were `render` event was sometimes not fired after `load` event in IE11. [#8708](https://github.com/mapbox/mapbox-gl-js/pull/8708) + +## 1.3.0 + +### 🍏 Features + +- Introduce `text-writing-mode` symbol layer property to allow placing point labels vertically. [#8399](https://github.com/mapbox/mapbox-gl-js/pull/8399) +- Extend variable text placement to work when `text/icon-allow-overlap` is set to `true`. [#8620](https://github.com/mapbox/mapbox-gl-js/pull/8620) +- Allow `text-color` to be used in formatted expressions to be able to draw different parts of a label in different colors. [#8068](https://github.com/mapbox/mapbox-gl-js/pull/8068) + +### ✨ Improvements + +- Improve tile loading logic to cancel requests more aggressively, improving performance when zooming or panning quickly. [#8633](https://github.com/mapbox/mapbox-gl-js/pull/8633) +- Display outline on control buttons when focused (e.g. with a tab key) for better accessibility. [#8520](https://github.com/mapbox/mapbox-gl-js/pull/8520) +- Improve the shape of line round joins. [#8275](https://github.com/mapbox/mapbox-gl-js/pull/8275) +- Improve performance of processing line layers. [#8303](https://github.com/mapbox/mapbox-gl-js/pull/8303) +- Improve legibility of info displayed with `map.showTileBoundaries = true`. [#8380](https://github.com/mapbox/mapbox-gl-js/pull/8380) (h/t [@andrewharvey](https://github.com/andrewharvey)) +- Add `MercatorCoordinate.meterInMercatorCoordinateUnits` method to make it easier to convert from meter units to coordinate values used in custom layers. [#8524](https://github.com/mapbox/mapbox-gl-js/pull/8524) (h/t [@andrewharvey](https://github.com/andrewharvey)) +- Improve conversion of legacy filters with duplicate values. [#8542](https://github.com/mapbox/mapbox-gl-js/pull/8542) +- Move out documentation & examples website source to a separate `mapbox-gl-js-docs` repo. [#8582](https://github.com/mapbox/mapbox-gl-js/pull/8582) + +### 🐞 Bug Fixes + +- Fix a bug where local CJK fonts would switch to server-generated ones in overzoomed tiles. [#8657](https://github.com/mapbox/mapbox-gl-js/pull/8657) +- Fix precision issues in [deck.gl](https://deck.gl)-powered custom layers. [#8502](https://github.com/mapbox/mapbox-gl-js/pull/8502) +- Fix a bug where fill and line layers wouldn't render correctly over fill extrusions when coming from the same source. [#8661](https://github.com/mapbox/mapbox-gl-js/pull/8661) +- Fix map loading for documents loaded from Blob URLs. [#8612](https://github.com/mapbox/mapbox-gl-js/pull/8612) +- Fix classification of relative file:// URLs when in documents loaded from a file URL. [#8612](https://github.com/mapbox/mapbox-gl-js/pull/8612) +- Remove `esm` from package `dependencies` (so that it's not installed on `npm install mapbox-gl`). [#8586](https://github.com/mapbox/mapbox-gl-js/pull/8586) (h/t [@DatGreekChick](https://github.com/DatGreekChick)) + ## 1.2.1 -## 🐞 Bug fixes +### 🐞 Bug fixes * Fix bug in `NavigationControl` compass button that prevented it from rotating with the map ([#8605](https://github.com/mapbox/mapbox-gl-js/pull/8605)) ## 1.2.0 -## Features and improvements +### Features and improvements * Add `*-sort-key` layout property for circle, fill, and line layers, to dictate which features appear above others within a single layer([#8467](https://github.com/mapbox/mapbox-gl-js/pull/8467)) * Add ability to instantiate maps with specific access tokens ([#8364](https://github.com/mapbox/mapbox-gl-js/pull/8364)) * Accommodate `prefers-reduced-motion` settings in browser ([#8494](https://github.com/mapbox/mapbox-gl-js/pull/8494)) @@ -15,7 +274,7 @@ * Make requirements for text offset properties more precise ([#8418](https://github.com/mapbox/mapbox-gl-js/pull/8418)) * Expose `convertFilter` API in the style specification ([#8493](https://github.com/mapbox/mapbox-gl-js/pull/8493) -## Bug fixes +### Bug fixes * Fix changes to `text-variable-anchor`, such that previous anchor positions would take precedence only if they are present in the updated array (considered a bug fix, but is technically a breaking change from previous behavior) ([#8473](https://github.com/mapbox/mapbox-gl-js/pull/8473)) * Fix rendering of opaque pass layers over heatmap and fill-extrusion layers ([#8440](https://github.com/mapbox/mapbox-gl-js/pull/8440)) * Fix rendering of extraneous vertical line in vector tiles ([#8477](https://github.com/mapbox/mapbox-gl-js/issues/8477), fixed by [#8479](https://github.com/mapbox/mapbox-gl-js/pull/8479)) @@ -27,7 +286,7 @@ ## 1.1.1 -## 🐞 Bug fixes +### 🐞 Bug fixes * Fix unbounded memory growth caused by failure to cancel requests to the cache ([#8472](https://github.com/mapbox/mapbox-gl-js/pull/8472)) * Fix unbounded memory growth caused by failure to cancel requests in IE ([#8481](https://github.com/mapbox/mapbox-gl-js/issues/8481)) @@ -35,7 +294,7 @@ ## 1.1.0 -## ✨ Minor features and improvements +### ✨ Minor features and improvements * Improve line rendering performance by using a more compact line attributes layout ([#8306](https://github.com/mapbox/mapbox-gl-js/pull/8306)) * Improve data-driven symbol layers rendering performance ([#8295](https://github.com/mapbox/mapbox-gl-js/pull/8295)) * Add the ability to disable validation during `queryRenderedFeatures` and `querySourceFeatures` calls, as a performance optimization ([#8211](https://github.com/mapbox/mapbox-gl-js/pull/8211)) (h/t [gorshkov-leonid](https://github.com/gorshkov-leonid)) @@ -51,7 +310,7 @@ * Add `nofollow` to Mapbox logo & "Improve this map" links ([#8106](https://github.com/mapbox/mapbox-gl-js/pull/8106)) (h/t [viniciuskneves](https://github.com/viniciuskneves)) * Include source name in invalid GeoJSON error ([#8113](https://github.com/mapbox/mapbox-gl-js/pull/8113)) (h/t [Zirak](https://github.com/Zirak)) -## 🐞 Bug fixes +### 🐞 Bug fixes * Fix `updateImage` not working as expected in Chrome ([#8199](https://github.com/mapbox/mapbox-gl-js/pull/8199)) * Fix issues with double-tap zoom on touch devices ([#8086](https://github.com/mapbox/mapbox-gl-js/pull/8086)) * Fix duplication of `movestart` events when zooming ([#8259](https://github.com/mapbox/mapbox-gl-js/pull/8259)) (h/t [bambielli-flex](https://github.com/bambielli-flex)) @@ -135,14 +394,14 @@ For further information on the pricing changes, you can read our [blog post](htt ## 0.53.1 -## Bug fixes +### Bug fixes * Turn off telemetry for Mapbox Atlas ([#7945](https://github.com/mapbox/mapbox-gl-js/pull/7945)) * Fix order of 3D features in query results (fix #7883) ([#7953](https://github.com/mapbox/mapbox-gl-js/pull/7953)) * Fix RemovePaintState benchmarks ([#7930](https://github.com/mapbox/mapbox-gl-js/pull/7930)) ## 0.53.0 -## Features and improvements +### Features and improvements * Enable `fill-extrusion` querying with ray picking ([#7499](https://github.com/mapbox/mapbox-gl-js/pull/7499)) * Add `clusterProperties` option for aggregated cluster properties ([#2412](https://github.com/mapbox/mapbox-gl-js/issues/2412), fixed by [#7584](https://github.com/mapbox/mapbox-gl-js/pull/7584)) * Allow initial map bounds to be adjusted with `fitBounds` options. ([#7681](https://github.com/mapbox/mapbox-gl-js/pull/7681)) (h/t [elyobo](https://github.com/elyobo)) @@ -151,7 +410,7 @@ For further information on the pricing changes, you can read our [blog post](htt * Add `number-format` expression ([#7626](https://github.com/mapbox/mapbox-gl-js/pull/7626)) * Add `symbol-sort-key` style property ([#7678](https://github.com/mapbox/mapbox-gl-js/pull/7678)) -## Bug fixes +### Bug fixes * Upgrades Earcut to fix a rare bug in rendering polygons that contain a coincident chain of holes ([#7806](https://github.com/mapbox/mapbox-gl-js/issues/7806), fixed by [#7878](https://github.com/mapbox/mapbox-gl-js/pull/7878)) * Allow `file://` protocol in XHR requests for Cordova/Ionic/etc ([#7818](https://github.com/mapbox/mapbox-gl-js/pull/7818)) * Correctly handle WebP images in Edge 18 ([#7687](https://github.com/mapbox/mapbox-gl-js/pull/7687)) @@ -167,23 +426,23 @@ For further information on the pricing changes, you can read our [blog post](htt ## 0.52.0 -# Breaking changes +### Breaking changes * Canonicalize tile urls to `mapbox://` urls so they can be transformed with `config.API_URL` ([#7594](https://github.com/mapbox/mapbox-gl-js/pull/7594)) -## Features and improvements +### Features and improvements * Add getter and setter for `config.API_URL` ([#7594](https://github.com/mapbox/mapbox-gl-js/pull/7594)) * Allow user to define element other than map container for full screen control ([#7548](https://github.com/mapbox/mapbox-gl-js/pull/7548)) * Add validation option to style setters ([#7604](https://github.com/mapbox/mapbox-gl-js/pull/7604)) * Add 'idle' event: fires when no further rendering is expected without further interaction. ([#7625](https://github.com/mapbox/mapbox-gl-js/pull/7625)) -## Bug fixes +### Bug fixes * Fire error when map.getLayoutProperty references missing layer ([#7537](https://github.com/mapbox/mapbox-gl-js/issues/7537), fixed by [#7539](https://github.com/mapbox/mapbox-gl-js/pull/7539)) * Fix shaky sprites when zooming with scrolling ([#7558](https://github.com/mapbox/mapbox-gl-js/pull/7558)) * Fix layout problems in attribution control ([#7608](https://github.com/mapbox/mapbox-gl-js/pull/7608)) (h/t [lucaswoj](https://github.com/lucaswoj)) * Fixes resetting map's pitch to 0 if initial bounds is set ([#7617](https://github.com/mapbox/mapbox-gl-js/pull/7617)) (h/t [stepankuzmin](https://github.com/stepankuzmin)) * Fix occasional failure to load images after multiple image request abortions [#7641](https://github.com/mapbox/mapbox-gl-js/pull/7641) * Update repo url to correct one ([#7486](https://github.com/mapbox/mapbox-gl-js/pull/7486)) (h/t [nicholas-l](https://github.com/nicholas-l)) -* Fix bug where symbols were sometimes not rendered immediately ([#7610](https://github.com/mapbox/mapbox-gl-js/pull/7610)) +* Fix bug where symbols where sometimes not rendered immediately ([#7610](https://github.com/mapbox/mapbox-gl-js/pull/7610)) * Fix bug where cameraForBounds returns incorrect CameraOptions with asymmetrical padding/offset ([#7517](https://github.com/mapbox/mapbox-gl-js/issues/7517), fixed by [#7518](https://github.com/mapbox/mapbox-gl-js/pull/7518)) (h/t [mike-marcacci](https://github.com/mike-marcacci)) * Use diff+patch approach to map.setStyle when the parameter is a URL ([#4025](https://github.com/mapbox/mapbox-gl-js/issues/4025), fixed by [#7562](https://github.com/mapbox/mapbox-gl-js/pull/7562)) * Begin touch zoom immediately when rotation disabled ([#7582](https://github.com/mapbox/mapbox-gl-js/pull/7582)) (h/t [msbarry](https://github.com/msbarry)) diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md index 7fcca0c822e..a029a56c38f 100644 --- a/CODE-OF-CONDUCT.md +++ b/CODE-OF-CONDUCT.md @@ -1,5 +1,7 @@ # Code of conduct -Everyone is invited to participate in Mapbox’s open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Mapbox organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/). +Everyone is invited to participate in [Mapbox’s open source projects](https://github.com/mapbox) and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. -You can learn more about our open source philosophy on [mapbox.com](https://www.mapbox.com/about/open/). +The [Contributor Covenant](https://contributor-covenant.org) applies to all projects under the Mapbox organization and we ask that you please read [the full text](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html). + +Please report any instances of behavior violating this code to conduct@mapbox.com. Our team will handle any such report confidentially, and promptly review and investigate the situation and act to [enforce](https://www.contributor-covenant.org/version/2/0/code_of_conduct#enforcement) this code of conduct as needed. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a36288a4136..9c1dfc3fdc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ Install the Xcode Command Line Tools Package xcode-select --install ``` -Install [node.js](https://nodejs.org/) version 4 or greater +Install [node.js](https://nodejs.org/) version ^10.15 ( Minimum 10.15 while sticking only to major version 10.0 ) ```bash brew install node ``` @@ -31,7 +31,7 @@ yarn install ### Linux -Install [git](https://git-scm.com/), [node.js](https://nodejs.org/) (version 6 or greater), [GNU Make](http://www.gnu.org/software/make/), and libglew-dev +Install [git](https://git-scm.com/), [node.js](https://nodejs.org/) (version ^10.15), [GNU Make](http://www.gnu.org/software/make/), and libglew-dev ```bash sudo apt-get update && sudo apt-get install build-essential git nodejs libglew-dev libxi-dev @@ -56,7 +56,7 @@ yarn install ### Windows -Install [git](https://git-scm.com/), [node.js](https://nodejs.org/) (version 4 or greater), [yarn](https://yarnpkg.com/en/docs/install#windows-tab), [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 ^10.15), [yarn](https://yarnpkg.com/en/docs/install#windows-tab), [npm and node-gyp](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules). Clone the repository ```bash @@ -135,6 +135,32 @@ The conventions for module exports are: * We use [rebase merging](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) (as opposed to [basic merging](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#Basic-Merging)) to merge branches +Here is a recommended way to get setup: +1. Fork this project +2. Clone your new fork, `git clone git@github.com:GithubUser/mapbox-gl-js.git` +3. `cd mapbox-gl-js` +4. Add the Mapbox repository as an upstream repository: `git add remote upstream git@github.com:mapbox/mapbox-gl-js.git` +5. Create a new branch `git checkout -b your-branch` for your contribution +6. Write code, open a PR from your branch when you're ready +7. If you need to rebase your fork's PR branch onto master to resolve conflicts: `git fetch upstream`, `git rebase upstream/master` and force push to Github `git push --force origin your-branch` + +## Changelog Conventions + +What warrants a changelog entry? + +- Any change that affects the public API, visual appearance or user security *must* have a changelog entry +- Any performance improvement or bugfix *should* have a changelog entry +- Any contribution from a community member *may* have a changelog entry, no matter how small +- Any documentation related changes *should not* have a changelog entry +- Any regression change introduced and fixed within the same release *should not* have a changelog entry +- Any internal refactoring, technical debt reduction, render test, unit test or benchmark related change *should not* have a changelog entry + +How to add your changelog? + +- Any changelog entry should be descriptive and concise; it should explain the change to a reader without context +- Any changelog entry should be added to the pull request in the following format: `Changelog description` +- Any change that does not require a changelog should be labelled `skip changelog` + ## Documentation Conventions See [`README.md`](https://github.com/mapbox/mapbox-gl-js-docs/blob/publisher-production/README.md) from [`mapbox-gl-js-docs`](https://github.com/mapbox/mapbox-gl-js-docs/). diff --git a/LICENSE.txt b/LICENSE.txt index 9b9f7ca0ea5..a5aa63e13bd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2016, Mapbox +Copyright (c) 2020, Mapbox All rights reserved. @@ -26,9 +26,6 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- - -Contains Hershey Simplex Font: http://paulbourke.net/dataformats/hershey/ ------------------------------------------------------------------------------- diff --git a/bench/benchmarks/expressions.js b/bench/benchmarks/expressions.js index 8f2a780de79..d81c5aa85f4 100644 --- a/bench/benchmarks/expressions.js +++ b/bench/benchmarks/expressions.js @@ -4,8 +4,8 @@ import Benchmark from '../lib/benchmark'; import spec from '../../src/style-spec/reference/latest'; import convertFunction from '../../src/style-spec/function/convert'; -import { isFunction, createFunction } from '../../src/style-spec/function'; -import { createPropertyExpression } from '../../src/style-spec/expression'; +import {isFunction, createFunction} from '../../src/style-spec/function'; +import {createPropertyExpression} from '../../src/style-spec/expression'; import fetchStyle from '../lib/fetch_style'; import type {StyleSpecification} from '../../src/style-spec/types'; diff --git a/bench/benchmarks/filter_evaluate.js b/bench/benchmarks/filter_evaluate.js index 041470c0fa7..40ca85af21b 100644 --- a/bench/benchmarks/filter_evaluate.js +++ b/bench/benchmarks/filter_evaluate.js @@ -1,6 +1,6 @@ import Benchmark from '../lib/benchmark'; -import { VectorTile } from '@mapbox/vector-tile'; +import {VectorTile} from '@mapbox/vector-tile'; import Pbf from 'pbf'; import createFilter from '../../src/style-spec/feature_filter'; import filters from '../data/filters.json'; @@ -30,7 +30,7 @@ export default class FilterEvaluate extends Benchmark { } } - this.layers.push({ features, filters: layerFilters }); + this.layers.push({features, filters: layerFilters}); } }); } diff --git a/bench/benchmarks/hillshade_load.js b/bench/benchmarks/hillshade_load.js new file mode 100644 index 00000000000..d86c29caf9a --- /dev/null +++ b/bench/benchmarks/hillshade_load.js @@ -0,0 +1,50 @@ +// @flow + +import Benchmark from '../lib/benchmark'; +import createMap from '../lib/create_map'; +import type {StyleSpecification} from '../../src/style-spec/types'; + +export default class HillshadeLoad extends Benchmark { + style: StyleSpecification; + + constructor() { + super(); + this.style = { + "version": 8, + "name": "Hillshade-only", + "center": [-112.81596278901452, 37.251160384573595], + "zoom": 11.560975632435424, + "bearing": 0, + "pitch": 0, + "sources": { + "mapbox://mapbox.terrain-rgb": { + "url": "mapbox://mapbox.terrain-rgb", + "type": "raster-dem", + "tileSize": 256 + } + }, + "layers": [ + { + "id": "mapbox-terrain-rgb", + "type": "hillshade", + "source": "mapbox://mapbox.terrain-rgb", + "layout": {}, + "paint": {} + } + ] + }; + } + + bench() { + return createMap({ + width: 1024, + height: 1024, + style: this.style, + stubRender: false, + showMap: true, + idle: true + }).then((map) => { + map.remove(); + }); + } +} diff --git a/bench/benchmarks/layers.js b/bench/benchmarks/layers.js index a63e25e40ef..13ba7214db3 100644 --- a/bench/benchmarks/layers.js +++ b/bench/benchmarks/layers.js @@ -5,10 +5,11 @@ import style from '../data/empty.json'; const width = 1024; const height = 768; +const layerCount = 50; function generateLayers(layer) { const generated = []; - for (let i = 0; i < 50; i++) { + for (let i = 0; i < layerCount; i++) { const id = layer.id + i; generated.push(Object.assign({}, layer, {id})); } @@ -25,6 +26,8 @@ export class LayerBenchmark extends Benchmark { style: this.layerStyle }).then(map => { this.map = map; + }).catch(error => { + console.error(error); }); } @@ -218,3 +221,79 @@ export class LayerSymbol extends LayerBenchmark { }); } } + +export class LayerSymbolWithIcons extends LayerBenchmark { + constructor() { + super(); + + this.layerStyle = Object.assign({}, style, { + layers: generateLayers({ + 'id': 'symbollayer', + 'type': 'symbol', + 'source': 'composite', + 'source-layer': 'poi_label', + 'layout': { + 'icon-image': 'dot-11', + 'text-field': ['format', ['get', 'name_en'], ['image', 'dot-11']] + } + }) + }); + } +} + +export class LayerSymbolWithSortKey extends LayerBenchmark { + constructor() { + super(); + + this.layerStyle = Object.assign({}, style, { + layers: this.generateSortKeyLayers() + }); + } + + generateSortKeyLayers() { + const generated = []; + for (let i = 0; i < layerCount; i++) { + generated.push({ + 'id': `symbollayer${i}`, + 'type': 'symbol', + 'source': 'composite', + 'source-layer': 'poi_label', + 'layout': { + 'symbol-sort-key': i, + 'text-field': '{name_en}' + } + }); + } + return generated; + } +} + +export class LayerTextWithVariableAnchor extends LayerBenchmark { + constructor() { + super(); + + this.layerStyle = Object.assign({}, style, { + layers: generateLayers({ + 'id': 'symbollayer', + 'type': 'symbol', + 'source': 'composite', + 'source-layer': 'poi_label', + 'layout': { + 'text-field': 'Test Test Test', + 'text-justify': 'auto', + 'text-variable-anchor': [ + 'center', + 'top', + 'bottom', + 'left', + 'right', + 'top-left', + 'top-right', + 'bottom-left', + 'bottom-right' + ] + } + }) + }); + } +} diff --git a/bench/benchmarks/layout.js b/bench/benchmarks/layout.js index debd61d8663..fc363ff71f5 100644 --- a/bench/benchmarks/layout.js +++ b/bench/benchmarks/layout.js @@ -4,7 +4,7 @@ import type {StyleSpecification} from '../../src/style-spec/types'; import Benchmark from '../lib/benchmark'; import fetchStyle from '../lib/fetch_style'; import TileParser from '../lib/tile_parser'; -import { OverscaledTileID } from '../../src/source/tile_id'; +import {OverscaledTileID} from '../../src/source/tile_id'; export default class Layout extends Benchmark { tiles: Array<{tileID: OverscaledTileID, buffer: ArrayBuffer}>; diff --git a/bench/benchmarks/layout_dds.js b/bench/benchmarks/layout_dds.js index 27979d4e36f..f4dffbd5821 100644 --- a/bench/benchmarks/layout_dds.js +++ b/bench/benchmarks/layout_dds.js @@ -2,7 +2,7 @@ import Benchmark from '../lib/benchmark'; import TileParser from '../lib/tile_parser'; -import { OverscaledTileID } from '../../src/source/tile_id'; +import {OverscaledTileID} from '../../src/source/tile_id'; const LAYER_COUNT = 2; @@ -18,7 +18,7 @@ export default class LayoutDDS extends Benchmark { const styleJSON = { "version": 8, "sources": { - "mapbox": { "type": "vector", "url": "mapbox://mapbox.mapbox-streets-v7" } + "mapbox": {"type": "vector", "url": "mapbox://mapbox.mapbox-streets-v7"} }, "layers": [] }; diff --git a/bench/benchmarks/map_load.js b/bench/benchmarks/map_load.js index 8d54de97346..38eaa51bf90 100644 --- a/bench/benchmarks/map_load.js +++ b/bench/benchmarks/map_load.js @@ -10,6 +10,10 @@ export default class MapLoad extends Benchmark { sources: {}, layers: [] } - }).then(map => map.remove()); + }) + .then(map => map.remove()) + .catch(error => { + console.error(error); + }); } } diff --git a/bench/benchmarks/paint.js b/bench/benchmarks/paint.js index bdcfffed252..2a070444e9e 100644 --- a/bench/benchmarks/paint.js +++ b/bench/benchmarks/paint.js @@ -30,6 +30,9 @@ export default class Paint extends Benchmark { })) .then(maps => { this.maps = maps; + }) + .catch(error => { + console.error(error); }); } @@ -37,7 +40,7 @@ export default class Paint extends Benchmark { for (const map of this.maps) { map._styleDirty = true; map._sourcesDirty = true; - map._render(); + map._render(Date.now()); } } diff --git a/bench/benchmarks/paint_states.js b/bench/benchmarks/paint_states.js index c377412812a..75c91b3f924 100644 --- a/bench/benchmarks/paint_states.js +++ b/bench/benchmarks/paint_states.js @@ -53,6 +53,8 @@ export default class PaintStates extends Benchmark { style }).then(map => { this.map = map; + }).catch(error => { + console.error(error); }); }); } @@ -62,7 +64,7 @@ export default class PaintStates extends Benchmark { this.map._sourcesDirty = true; this.map._render(); for (let i = 0; i < this.numFeatures; i += 50) { - this.map.setFeatureState({ source: 'land', id: i }, { bench: true }); + this.map.setFeatureState({source: 'land', id: i}, {bench: true}); } this.map._render(); } diff --git a/bench/benchmarks/placement.js b/bench/benchmarks/placement.js new file mode 100644 index 00000000000..453e7a3ae94 --- /dev/null +++ b/bench/benchmarks/placement.js @@ -0,0 +1,61 @@ +// @flow + +import Benchmark from '../lib/benchmark'; +import createMap from '../lib/create_map'; +import type Map from '../../src/ui/map'; + +const width = 1024; +const height = 768; + +export default class Paint extends Benchmark { + style: string; + locations: Array; + maps: Array; + + constructor(style: string, locations: Array) { + super(); + this.style = style; + this.locations = locations; + } + + setup(): Promise { + return Promise.all(this.locations.map(location => { + return createMap({ + zoom: location.zoom, + width, + height, + center: location.center, + style: this.style, + idle: true + }); + })) + .then(maps => { + this.maps = maps; + }) + .catch(error => { + console.error(error); + }); + } + + bench() { + for (const map of this.maps) { + const showCollisionBoxes = false; + const fadeDuration = 300; + const crossSourceCollisions = true; + const forceFullPlacement = true; + + map.style._updatePlacement( + map.transform, + showCollisionBoxes, + fadeDuration, + crossSourceCollisions, + forceFullPlacement); + } + } + + teardown() { + for (const map of this.maps) { + map.remove(); + } + } +} diff --git a/bench/benchmarks/query_box.js b/bench/benchmarks/query_box.js index 70fab170b3b..7353864605c 100644 --- a/bench/benchmarks/query_box.js +++ b/bench/benchmarks/query_box.js @@ -30,6 +30,9 @@ export default class QueryBox extends Benchmark { })) .then(maps => { this.maps = maps; + }) + .catch(error => { + console.error(error); }); } diff --git a/bench/benchmarks/query_point.js b/bench/benchmarks/query_point.js index f0d59439e1a..d96f3130a92 100644 --- a/bench/benchmarks/query_point.js +++ b/bench/benchmarks/query_point.js @@ -41,6 +41,9 @@ export default class QueryPoint extends Benchmark { })) .then(maps => { this.maps = maps; + }) + .catch(error => { + console.error(error); }); } diff --git a/bench/benchmarks/remove_paint_state.js b/bench/benchmarks/remove_paint_state.js index 191bf243f6c..75c8017cd21 100644 --- a/bench/benchmarks/remove_paint_state.js +++ b/bench/benchmarks/remove_paint_state.js @@ -53,7 +53,10 @@ class RemovePaintState extends Benchmark { style }).then(map => { this.map = map; - }); + }) + .catch(error => { + console.error(error); + }); }); } @@ -72,10 +75,10 @@ export class PropertyLevelRemove extends RemovePaintState { bench() { for (let i = 0; i < this.numFeatures; i += 50) { - this.map.setFeatureState({ source: 'land', id: i }, { bench: true }); + this.map.setFeatureState({source: 'land', id: i}, {bench: true}); } for (let i = 0; i < this.numFeatures; i += 50) { - this.map.removeFeatureState({ source: 'land', id: i }, 'bench'); + this.map.removeFeatureState({source: 'land', id: i}, 'bench'); } this.map._render(); @@ -86,10 +89,10 @@ export class FeatureLevelRemove extends RemovePaintState { bench() { for (let i = 0; i < this.numFeatures; i += 50) { - this.map.setFeatureState({ source: 'land', id: i }, { bench: true }); + this.map.setFeatureState({source: 'land', id: i}, {bench: true}); } for (let i = 0; i < this.numFeatures; i += 50) { - this.map.removeFeatureState({ source: 'land', id: i }); + this.map.removeFeatureState({source: 'land', id: i}); } this.map._render(); @@ -100,10 +103,10 @@ export class SourceLevelRemove extends RemovePaintState { bench() { for (let i = 0; i < this.numFeatures; i += 50) { - this.map.setFeatureState({ source: 'land', id: i }, { bench: true }); + this.map.setFeatureState({source: 'land', id: i}, {bench: true}); } for (let i = 0; i < this.numFeatures; i += 50) { - this.map.removeFeatureState({ source: 'land', id: i }); + this.map.removeFeatureState({source: 'land', id: i}); } this.map._render(); diff --git a/bench/benchmarks/symbol_layout.js b/bench/benchmarks/symbol_layout.js index cf40af6a641..69397653456 100644 --- a/bench/benchmarks/symbol_layout.js +++ b/bench/benchmarks/symbol_layout.js @@ -2,8 +2,8 @@ import Layout from './layout'; import SymbolBucket from '../../src/data/bucket/symbol_bucket'; -import { performSymbolLayout } from '../../src/symbol/symbol_layout'; -import { OverscaledTileID } from '../../src/source/tile_id'; +import {performSymbolLayout} from '../../src/symbol/symbol_layout'; +import {OverscaledTileID} from '../../src/source/tile_id'; export default class SymbolLayout extends Layout { parsedTiles: Array; @@ -37,7 +37,8 @@ export default class SymbolLayout extends Layout { tileResult.glyphPositions, tileResult.iconMap, tileResult.imageAtlas.iconPositions, - false); + false, + tileResult.tileID.canonical); } } }); diff --git a/bench/benchmarks/worker_transfer.js b/bench/benchmarks/worker_transfer.js index e1245ca6808..2c5c37872d1 100644 --- a/bench/benchmarks/worker_transfer.js +++ b/bench/benchmarks/worker_transfer.js @@ -4,9 +4,9 @@ import type {StyleSpecification} from '../../src/style-spec/types'; import Benchmark from '../lib/benchmark'; 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'; +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; diff --git a/bench/benchmarks_view.js b/bench/benchmarks_view.js index b6ce6a080c8..4644a14df22 100644 --- a/bench/benchmarks_view.js +++ b/bench/benchmarks_view.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import * as d3 from 'd3'; -import { kde, probabilitiesOfSuperiority, summaryStatistics, regression } from './lib/statistics'; +import {kde, probabilitiesOfSuperiority, summaryStatistics, regression} from './lib/statistics'; const versionColor = d3.scaleOrdinal(['#1b9e77', '#7570b3', '#d95f02']); const formatSample = d3.format(".3r"); @@ -224,12 +224,12 @@ class StatisticsPlot extends React.Component { strokeWidth={bandwidth} strokeOpacity={1} /> = tMax ? 'translate(-10, 0)' : `translate(-5, ${t(mean)}) rotate(90)`} x={0} y={0} /> @@ -275,7 +275,7 @@ class StatisticsPlot extends React.Component { } componentDidMount() { - this.setState({ width: this.ref.clientWidth }); + this.setState({width: this.ref.clientWidth}); } } @@ -342,7 +342,7 @@ class RegressionPlot extends React.Component { } componentDidMount() { - this.setState({ width: this.ref.clientWidth }); + this.setState({width: this.ref.clientWidth}); } } diff --git a/bench/gl-stats.html b/bench/gl-stats.html new file mode 100644 index 00000000000..7e580e4da35 --- /dev/null +++ b/bench/gl-stats.html @@ -0,0 +1,95 @@ + + + + + + + + +
+ + diff --git a/bench/gl-stats.js b/bench/gl-stats.js new file mode 100644 index 00000000000..fe4962336b1 --- /dev/null +++ b/bench/gl-stats.js @@ -0,0 +1,47 @@ +/* eslint-disable import/no-commonjs */ + +const puppeteer = require('puppeteer'); +const fs = require('fs'); +const zlib = require('zlib'); +const mapboxGLJSSrc = fs.readFileSync('dist/mapbox-gl.js', 'utf8'); +const mapboxGLCSSSrc = fs.readFileSync('dist/mapbox-gl.css', 'utf8'); +const benchSrc = fs.readFileSync('bench/gl-stats.html', 'utf8'); +const {execSync} = require('child_process'); + +const benchHTML = benchSrc + .replace(/`) + .replace('MAPBOX_ACCESS_TOKEN', process.env.MAPBOX_ACCESS_TOKEN); + +function waitForConsole(page) { + return new Promise((resolve) => { + function onConsole(msg) { + page.removeListener('console', onConsole); + resolve(msg.text()); + } + page.on('console', onConsole); + }); +} + +(async () => { + const browser = await puppeteer.launch({ + args: ['--no-sandbox', '--disable-setuid-sandbox'] + }); + const page = await browser.newPage(); + + console.log('collecting stats...'); + await page.setViewport({width: 600, height: 600, deviceScaleFactor: 2}); + await page.setContent(benchHTML); + + const stats = JSON.parse(await waitForConsole(page)); + stats["bundle_size"] = mapboxGLJSSrc.length + mapboxGLCSSSrc.length; + stats["bundle_size_gz"] = zlib.gzipSync(mapboxGLJSSrc).length + zlib.gzipSync(mapboxGLCSSSrc).length; + stats.dt = execSync('git show --no-patch --no-notes --pretty=\'%cI\' HEAD').toString().substring(0, 19); + stats.commit = execSync('git rev-parse --short HEAD').toString().trim(); + stats.message = execSync('git show -s --format=%s HEAD').toString().trim(); + console.log(JSON.stringify(stats, null, 2)); + + fs.writeFileSync('data.json.gz', zlib.gzipSync(JSON.stringify(stats))); + + await page.close(); + await browser.close(); +})(); diff --git a/bench/lib/create_map.js b/bench/lib/create_map.js index 318c95daa70..3ef822f2a11 100644 --- a/bench/lib/create_map.js +++ b/bench/lib/create_map.js @@ -4,11 +4,20 @@ import Map from '../../src/ui/map'; export default function (options: any): Promise { return new Promise((resolve, reject) => { + if (options) { + options.stubRender = options.stubRender == null ? true : options.stubRender; + options.showMap = options.showMap == null ? false : options.showMap; + } + const container = document.createElement('div'); container.style.width = `${options.width || 512}px`; - container.style.height = `${options.width || 512}px`; + container.style.height = `${options.height || 512}px`; container.style.margin = '0 auto'; - container.style.display = 'none'; + container.style.display = 'block'; + + if (!options.showMap) { + container.style.visibility = 'hidden'; + } (document.body: any).appendChild(container); const map = new Map(Object.assign({ @@ -17,16 +26,17 @@ export default function (options: any): Promise { }, options)); map - .on('load', () => { - // Stub out `_rerender`; benchmarks need to be the only trigger of `_render` from here on out. - map._rerender = () => {}; + .on(options.idle ? 'idle' : 'load', () => { + if (options.stubRender) { + // Stub out `_rerender`; benchmarks need to be the only trigger of `_render` from here on out. + map._rerender = () => {}; - // If there's a pending rerender, cancel it. - if (map._frame) { - map._frame.cancel(); - map._frame = null; + // If there's a pending rerender, cancel it. + if (map._frame) { + map._frame.cancel(); + map._frame = null; + } } - resolve(map); }) .on('error', (e) => reject(e.error)) diff --git a/bench/lib/fetch_style.js b/bench/lib/fetch_style.js index 316cfd84588..e7c1ff4cb54 100644 --- a/bench/lib/fetch_style.js +++ b/bench/lib/fetch_style.js @@ -1,7 +1,7 @@ // @flow import type {StyleSpecification} from '../../src/style-spec/types'; -import { RequestManager } from '../../src/util/mapbox'; +import {RequestManager} from '../../src/util/mapbox'; const requestManager = new RequestManager(); diff --git a/bench/lib/locations_with_tile_id.js b/bench/lib/locations_with_tile_id.js index b0788e2e0ef..b6086c2466c 100644 --- a/bench/lib/locations_with_tile_id.js +++ b/bench/lib/locations_with_tile_id.js @@ -1,11 +1,11 @@ import MercatorCoordinate from '../../src/geo/mercator_coordinate'; -import { OverscaledTileID } from '../../src/source/tile_id'; +import {OverscaledTileID} from '../../src/source/tile_id'; export default function locationsWithTileID(locations) { return locations.map(feature => { - const { coordinates } = feature.geometry; - const { zoom } = feature.properties; - const { x, y } = MercatorCoordinate.fromLngLat({ + const {coordinates} = feature.geometry; + const {zoom} = feature.properties; + const {x, y} = MercatorCoordinate.fromLngLat({ lng: coordinates[0], lat: coordinates[1] }); diff --git a/bench/lib/statistics.js b/bench/lib/statistics.js index f2efdb29ffb..77b45d5ef7d 100644 --- a/bench/lib/statistics.js +++ b/bench/lib/statistics.js @@ -87,7 +87,7 @@ function leastSquaresRegression(data) { const slope = covariance / varianceX; const intercept = meanY - slope * meanX; - return { correlation, slope, intercept, data }; + return {correlation, slope, intercept, data}; } export function kde(samples, summary, ticks) { diff --git a/bench/lib/tile_parser.js b/bench/lib/tile_parser.js index 3be9eb95b16..e28afd39f2f 100644 --- a/bench/lib/tile_parser.js +++ b/bench/lib/tile_parser.js @@ -6,15 +6,15 @@ import assert from 'assert'; import deref from '../../src/style-spec/deref'; import Style from '../../src/style/style'; -import { Evented } from '../../src/util/evented'; -import { RequestManager } from '../../src/util/mapbox'; +import {Evented} from '../../src/util/evented'; +import {RequestManager} from '../../src/util/mapbox'; import WorkerTile from '../../src/source/worker_tile'; import StyleLayerIndex from '../../src/style/style_layer_index'; -import type { StyleSpecification } from '../../src/style-spec/types'; -import type { WorkerTileResult } from '../../src/source/worker_source'; -import type { OverscaledTileID } from '../../src/source/tile_id'; -import type { TileJSON } from '../../src/types/tilejson'; +import type {StyleSpecification} from '../../src/style-spec/types'; +import type {WorkerTileResult} from '../../src/source/worker_source'; +import type {OverscaledTileID} from '../../src/source/tile_id'; +import type {TileJSON} from '../../src/types/tilejson'; class StubMap extends Evented { _requestManager: RequestManager; @@ -129,13 +129,14 @@ export default class TileParser { pitch: 0, cameraToCenterDistance: 0, cameraToTileDistance: 0, - returnDependencies + returnDependencies, + promoteId: undefined }); const vectorTile = new VT.VectorTile(new Protobuf(tile.buffer)); return new Promise((resolve, reject) => { - workerTile.parse(vectorTile, this.layerIndex, (this.actor: any), (err, result) => { + workerTile.parse(vectorTile, this.layerIndex, [], (this.actor: any), (err, result) => { if (err) { reject(err); } else { diff --git a/bench/rollup_config_benchmarks.js b/bench/rollup_config_benchmarks.js index 71d0997bf5e..8ef5437de9a 100644 --- a/bench/rollup_config_benchmarks.js +++ b/bench/rollup_config_benchmarks.js @@ -55,7 +55,7 @@ const viewConfig = { file: 'bench/benchmarks_view_generated.js', format: 'umd', indent: false, - sourcemap: true + sourcemap: false }, plugins: [ buble({transforms: {dangerousForOf: true}, objectAssign: true}), diff --git a/bench/styles/benchmarks.js b/bench/styles/benchmarks.js index aa9fd3aadcd..eb573073fc0 100644 --- a/bench/styles/benchmarks.js +++ b/bench/styles/benchmarks.js @@ -1,7 +1,7 @@ import mapboxgl from '../../src'; import accessToken from '../lib/access_token'; import locationsWithTileID from '../lib/locations_with_tile_id'; -import styleBenchmarkLocations from '@mapbox/gazetteer/mapbox-streets/style-benchmark-locations.json'; +import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json'; import StyleLayerCreate from '../benchmarks/style_layer_create'; import Validate from '../benchmarks/style_validate'; import Layout from '../benchmarks/layout'; diff --git a/bench/versions/benchmarks.js b/bench/versions/benchmarks.js index acf2ca55e0b..3738aded4e1 100644 --- a/bench/versions/benchmarks.js +++ b/bench/versions/benchmarks.js @@ -1,16 +1,18 @@ import mapboxgl from '../../src'; import accessToken from '../lib/access_token'; import locationsWithTileID from '../lib/locations_with_tile_id'; -import styleBenchmarkLocations from '@mapbox/gazetteer/mapbox-streets/style-benchmark-locations.json'; +import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json'; import Layout from '../benchmarks/layout'; +import Placement from '../benchmarks/placement'; import LayoutDDS from '../benchmarks/layout_dds'; import SymbolLayout from '../benchmarks/symbol_layout'; import WorkerTransfer from '../benchmarks/worker_transfer'; import Paint from '../benchmarks/paint'; import PaintStates from '../benchmarks/paint_states'; import {PropertyLevelRemove, FeatureLevelRemove, SourceLevelRemove} from '../benchmarks/remove_paint_state'; -import {LayerBackground, LayerCircle, LayerFill, LayerFillExtrusion, LayerHeatmap, LayerHillshade, LayerLine, LayerRaster, LayerSymbol} from '../benchmarks/layers'; +import {LayerBackground, LayerCircle, LayerFill, LayerFillExtrusion, LayerHeatmap, LayerHillshade, LayerLine, LayerRaster, LayerSymbol, LayerSymbolWithIcons, LayerTextWithVariableAnchor, LayerSymbolWithSortKey} from '../benchmarks/layers'; import Load from '../benchmarks/map_load'; +import HillshadeLoad from '../benchmarks/hillshade_load'; import Validate from '../benchmarks/style_validate'; import StyleLayerCreate from '../benchmarks/style_layer_create'; import QueryPoint from '../benchmarks/query_point'; @@ -29,9 +31,9 @@ window.mapboxglBenchmarks = window.mapboxglBenchmarks || {}; const version = process.env.BENCHMARK_VERSION; -function register(name, benchmark) { +function register(name, bench) { window.mapboxglBenchmarks[name] = window.mapboxglBenchmarks[name] || {}; - window.mapboxglBenchmarks[name][version] = benchmark; + window.mapboxglBenchmarks[name][version] = bench; } const style = 'mapbox://styles/mapbox/streets-v10'; @@ -43,6 +45,7 @@ register('Paint', new Paint(style, locations)); register('QueryPoint', new QueryPoint(style, locations)); register('QueryBox', new QueryBox(style, locations)); register('Layout', new Layout(style)); +register('Placement', new Placement(style, locations)); register('Validate', new Validate(style)); register('StyleLayerCreate', new StyleLayerCreate(style)); register('FunctionCreate', new FunctionCreate(style)); @@ -63,11 +66,15 @@ register('LayerHillshade', new LayerHillshade()); register('LayerLine', new LayerLine()); register('LayerRaster', new LayerRaster()); register('LayerSymbol', new LayerSymbol()); +register('LayerSymbolWithIcons', new LayerSymbolWithIcons()); +register('LayerTextWithVariableAnchor', new LayerTextWithVariableAnchor()); +register('LayerSymbolWithSortKey', new LayerSymbolWithSortKey()); register('Load', new Load()); register('LayoutDDS', new LayoutDDS()); register('SymbolLayout', new SymbolLayout(style, styleLocations.map(location => location.tileID[0]))); register('FilterCreate', new FilterCreate()); register('FilterEvaluate', new FilterEvaluate()); +register('HillshadeLoad', new HillshadeLoad()); Promise.resolve().then(() => { // Ensure the global worker pool is never drained. Browsers have resource limits diff --git a/bench/versions/index.html b/bench/versions/index.html index 2cfe9811552..e9d019936f0 100644 --- a/bench/versions/index.html +++ b/bench/versions/index.html @@ -18,9 +18,9 @@ const params = new URLSearchParams(location.search.slice(1)); Promise.resolve(params.has('compare') ? params.getAll('compare').filter(Boolean) : - fetch('/package.json') + fetch('https://api.github.com/repos/mapbox/mapbox-gl-js/releases/latest') .then(response => response.json()) - .then(pkg => [`v${pkg.version}`, 'master'])) + .then(pkg => [pkg['tag_name'], 'master'])) .then(versions => { return versions .map(v => `https://s3.amazonaws.com/mapbox-gl-js/${v}/benchmarks.js`) diff --git a/build/check-bundle-size.js b/build/check-bundle-size.js index 891bb1d9b57..2ec4116ae58 100755 --- a/build/check-bundle-size.js +++ b/build/check-bundle-size.js @@ -54,7 +54,7 @@ function getMergeBase() { return github.pullRequests.get({ owner: 'mapbox', repo: 'mapbox-gl-js', - number + pull_number: number }).then(({data}) => { const base = data.base.ref; const head = process.env['CIRCLE_SHA1']; @@ -88,34 +88,39 @@ function getPriorSize(mergeBase) { ref: mergeBase }).then(({data}) => { const run = data.check_runs.find(run => run.name === name); - if (!run) { - console.log('No matching check found.'); - return Promise.resolve(null); + if (run) { + const match = run.output.summary.match(/`[^`]+` is (\d+) bytes \([^\)]+\) uncompressed, (\d+) bytes \([^\)]+\) gzipped\./); + if (match) { + const prior = { size: +match[1], gzipSize: +match[2] }; + console.log(`Prior size was ${prettyBytes(prior.size)}, gzipped ${prior.gzipSize}.`); + return prior; + } } - const prior = +run.output.summary.match(/`.*` is (\d+) bytes/)[1]; - console.log(`Prior size was ${prettyBytes(prior)}.`); - return prior; + console.log('No matching check found.'); + return Promise.resolve(null); }); } +function formatSize(size, priorSize) { + if (priorSize) { + const change = size - priorSize; + const percent = (change / priorSize) * 100; + return `${change >= 0 ? '+' : ''}${prettyBytes(change)} ${percent.toFixed(3)}% (${prettyBytes(size)})`; + } else { + return prettyBytes(size); + } +} + github.apps.createInstallationToken({installation_id: SIZE_CHECK_APP_INSTALLATION_ID}) .then(({data}) => { github.authenticate({type: 'token', token: data.token}); getMergeBase().then(getPriorSize).then(prior => { - const title = (() => { - if (prior) { - const change = size - prior; - const percent = (change / prior) * 100; - return `${change >= 0 ? '+' : ''}${prettyBytes(change)} ${percent.toFixed(3)}% (${prettyBytes(size)})`; - } else { - return prettyBytes(size); - } - })(); + const title = `${formatSize(size, prior ? prior.size : null)}, gzipped ${formatSize(gzipSize, prior ? prior.gzipSize : null)}`; const megabit = Math.pow(2, 12); const downloadTime3G = (gzipSize / (3 * megabit)).toFixed(0); const downloadTime4G = (gzipSize / (10 * megabit)).toFixed(0); - const summary = `\`${file}\` is ${size} bytes (${prettyBytes(size)}) uncompressed, ${gzipSize} (${prettyBytes(gzipSize)}) gzipped. + const summary = `\`${file}\` is ${size} bytes (${prettyBytes(size)}) uncompressed, ${gzipSize} bytes (${prettyBytes(gzipSize)}) gzipped. That's **${downloadTime3G} seconds** over slow 3G (3 Mbps), **${downloadTime4G} seconds** over fast 4G (10 Mbps).`; console.log(`Posting check result:\n${title}\n${summary}`); @@ -123,7 +128,7 @@ That's **${downloadTime3G} seconds** over slow 3G (3 Mbps), **${downloadTime4G} return github.checks.create({ owner: 'mapbox', repo: 'mapbox-gl-js', - name: `Size - ${label}`, + name, head_branch: process.env['CIRCLE_BRANCH'], head_sha: process.env['CIRCLE_SHA1'], status: 'completed', diff --git a/build/diff-tarball.js b/build/diff-tarball.js new file mode 100644 index 00000000000..43970decde2 --- /dev/null +++ b/build/diff-tarball.js @@ -0,0 +1,18 @@ +const packlist = require('npm-packlist') +const npmContent = require('list-npm-contents'); + +npmContent('mapbox-gl').then(function(last_version_files) { + packlist({ path: '.' }).then(function(new_version_files) { + new_version_files = new_version_files.map(file => file.replace(/\/\/+/g, '/')); + let diff_new = new_version_files.filter(x => !last_version_files.includes(x)); + let diff_last = last_version_files.filter(x => !new_version_files.includes(x)); + console.log(`${diff_new.length} files are about to be added in the new tarball`) + diff_new.forEach(file => { + console.log('+', file); + }); + console.log(`${diff_last.length} files are about to be deleted in the new tarball`) + diff_last.forEach(file => { + console.log('-', file); + }); + }); +}); \ No newline at end of file diff --git a/build/generate-flow-typed-style-spec.js b/build/generate-flow-typed-style-spec.js index 13a60878cca..cbbbda16917 100644 --- a/build/generate-flow-typed-style-spec.js +++ b/build/generate-flow-typed-style-spec.js @@ -33,7 +33,7 @@ function flowType(property) { case 'light': return 'LightSpecification'; case 'sources': - return '{[string]: SourceSpecification}'; + return '{[_: string]: SourceSpecification}'; case '*': return 'mixed'; default: @@ -120,6 +120,10 @@ export type ColorSpecification = string; export type FormattedSpecification = string; +export type ResolvedImageSpecification = string; + +export type PromoteIdSpecification = {[_: string]: string} | string; + export type FilterSpecification = | ['has', string] | ['!has', string] diff --git a/build/generate-release-list.js b/build/generate-release-list.js new file mode 100644 index 00000000000..f19d382f4d6 --- /dev/null +++ b/build/generate-release-list.js @@ -0,0 +1,21 @@ +const octokit = require('@octokit/rest')(); +const fs = require('fs'); + +const list = {}; + +octokit + .paginate(octokit.repos.listReleases.endpoint({ + owner: 'mapbox', + repo: 'mapbox-gl-js' + })) + .then(releases => { + releases.filter(release => release.tag_name.match(/^v\d+\.\d+\.\d+(-\w+)?/)).forEach(release => { + list[release.tag_name] = { + released: release.published_at, + prerelease: release.prerelease + }; + }); + + fs.writeFileSync('dist/versions.json', JSON.stringify(list, null, 4) + '\n'); + fs.writeFileSync('dist/versions.jsonp', 'const mapboxglVersions = ' + JSON.stringify(list, null, 4) + ';\n'); + }); diff --git a/build/generate-struct-arrays.js b/build/generate-struct-arrays.js index 92f8bfde695..ccbc1ecd179 100644 --- a/build/generate-struct-arrays.js +++ b/build/generate-struct-arrays.js @@ -151,6 +151,7 @@ const { collisionBoxLayout, collisionCircleLayout, collisionVertexAttributes, + quadTriangle, placement, symbolInstance, glyphOffset, @@ -164,6 +165,7 @@ createStructArrayType('collision_box', collisionBox, true); createStructArrayType(`collision_box_layout`, collisionBoxLayout); createStructArrayType(`collision_circle_layout`, collisionCircleLayout); createStructArrayType(`collision_vertex`, collisionVertexAttributes); +createStructArrayType(`quad_triangle`, quadTriangle); createStructArrayType('placed_symbol', placement, true); createStructArrayType('symbol_instance', symbolInstance, true); createStructArrayType('glyph_offset', glyphOffset, true); diff --git a/build/generate-style-code.js b/build/generate-style-code.js index 1cad05c9048..dac319d0e17 100644 --- a/build/generate-style-code.js +++ b/build/generate-style-code.js @@ -32,6 +32,8 @@ global.flowType = function (property) { return `Color`; case 'formatted': return `Formatted`; + case 'resolvedImage': + return `ResolvedImage`; case 'array': if (property.length) { return `[${new Array(property.length).fill(flowType({type: property.value})).join(', ')}]`; @@ -73,6 +75,8 @@ global.runtimeType = function (property) { return `ColorType`; case 'formatted': return `FormattedType`; + case 'Image': + return `ImageType`; case 'array': if (property.length) { return `array(${runtimeType({type: property.value})}, ${property.length})`; diff --git a/build/print-release-url.js b/build/print-release-url.js new file mode 100644 index 00000000000..4f4eefcdac2 --- /dev/null +++ b/build/print-release-url.js @@ -0,0 +1,6 @@ +const address = require('address'); +const qrcode = require('qrcode-terminal'); + +const url = `http://${address.ip()}:9966/test/release/index.html`; +console.warn(`Scan this QR code or enter ${url}`); +qrcode.generate(url); diff --git a/build/rollup_plugins.js b/build/rollup_plugins.js index fef9a4868d1..5a8fe2e5e56 100644 --- a/build/rollup_plugins.js +++ b/build/rollup_plugins.js @@ -5,9 +5,10 @@ import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import unassert from 'rollup-plugin-unassert'; import json from 'rollup-plugin-json'; -import { terser } from 'rollup-plugin-terser'; +import {terser} from 'rollup-plugin-terser'; import minifyStyleSpec from './rollup_plugin_minify_style_spec'; -import { createFilter } from 'rollup-pluginutils'; +import {createFilter} from 'rollup-pluginutils'; +import strip from '@rollup/plugin-strip'; // Common set of plugins/transformations shared across different rollup // builds (main mapboxgl bundle, style-spec package, benchmarks bundle) @@ -16,9 +17,18 @@ export const plugins = (minified, production) => [ flow(), minifyStyleSpec(), json(), + production ? strip({ + sourceMap: true, + functions: ['PerformanceUtils.*', 'Debug.*'] + }) : false, glsl('./src/shaders/*.glsl', production), buble({transforms: {dangerousForOf: true}, objectAssign: "Object.assign"}), - minified ? terser() : false, + minified ? terser({ + compress: { + pure_getters: true, + passes: 3 + } + }) : false, production ? unassert() : false, resolve({ browser: true, diff --git a/build/test/build-tape.js b/build/test/build-tape.js new file mode 100644 index 00000000000..78f11d8d1e4 --- /dev/null +++ b/build/test/build-tape.js @@ -0,0 +1,19 @@ +/* eslint-disable import/no-commonjs */ +/* eslint-disable flowtype/require-valid-file-annotation */ +const browserify = require('browserify'); +const fs = require('fs'); + +module.exports = function() { + return new Promise((resolve, reject) => { + browserify(require.resolve('../../test/util/tape_config.js'), { standalone: 'tape' }) + .transform("babelify", {presets: ["@babel/preset-env"], global: true}) + .bundle((err, buff) => { + if (err) { throw err; } + + fs.writeFile('test/integration/dist/tape.js', buff, { encoding: 'utf8'}, (err) => { + if (err) { reject(err); } + resolve(); + }); + }); + }); +}; diff --git a/cloudformation/travis.template b/cloudformation/travis.template index 29d94c429b6..488069a3445 100644 --- a/cloudformation/travis.template +++ b/cloudformation/travis.template @@ -35,7 +35,8 @@ ], "Effect": "Allow", "Resource": [ - "arn:aws:s3:::mapbox-gl-js/*" + "arn:aws:s3:::mapbox-gl-js/*", + "arn:aws:s3:::mapbox-loading-dock/raw/gl_js.perf_metrics*/*" ] } ] diff --git a/debug/2762.html b/debug/2762.html index 655a2d08ff3..753f0131a2f 100644 --- a/debug/2762.html +++ b/debug/2762.html @@ -15,7 +15,7 @@
- + - + - + diff --git a/debug/7517.html b/debug/7517.html index 14cffb39e94..e1fe6231df0 100644 --- a/debug/7517.html +++ b/debug/7517.html @@ -11,7 +11,7 @@ margin: 0; padding: 0; } - + html, body, #map { @@ -24,7 +24,7 @@
- + + + + + + diff --git a/debug/bounds.html b/debug/bounds.html index 134bef43199..eb92005c89e 100644 --- a/debug/bounds.html +++ b/debug/bounds.html @@ -15,7 +15,7 @@
- + - + - + - + - + - + - + - + - + - + - + + + + + diff --git a/debug/events.html b/debug/events.html index a6647c7805f..7c92d9e17c9 100644 --- a/debug/events.html +++ b/debug/events.html @@ -95,7 +95,7 @@
- + - + + + + + diff --git a/debug/heatmap.html b/debug/heatmap.html index 3419e9b7696..61922291b82 100644 --- a/debug/heatmap.html +++ b/debug/heatmap.html @@ -15,7 +15,7 @@
- + - + - + - + - + - + + + + + diff --git a/debug/line-gradient.html b/debug/line-gradient.html index 280992a2d22..89b443e3504 100644 --- a/debug/line-gradient.html +++ b/debug/line-gradient.html @@ -15,7 +15,7 @@
- + - + - + - + - + - + - + - + + + + + diff --git a/debug/satellite.html b/debug/satellite.html index 845462c3751..c142fa8ab5d 100644 --- a/debug/satellite.html +++ b/debug/satellite.html @@ -15,7 +15,7 @@
- + - + + + + + diff --git a/debug/textsize.html b/debug/textsize.html index cfec9fc1215..15c92d02fe7 100644 --- a/debug/textsize.html +++ b/debug/textsize.html @@ -15,7 +15,7 @@
- + - + - + - + - + + + + + + \ No newline at end of file diff --git a/debug/video.html b/debug/video.html index fabd7e46d94..14aac3e329d 100644 --- a/debug/video.html +++ b/debug/video.html @@ -19,7 +19,7 @@ - + - + + + + + + + diff --git a/test/browser/fixtures/land.json b/test/browser/fixtures/land.json new file mode 100644 index 00000000000..3ef19f77a75 --- /dev/null +++ b/test/browser/fixtures/land.json @@ -0,0 +1 @@ +{"type":"MultiPolygon","coordinates":[[[[-59.57209,-80.04018],[-59.86585,-80.54966],[-60.15966,-81.00033],[-62.25539,-80.86318],[-64.48813,-80.92193],[-65.74167,-80.58883],[-65.74167,-80.54966],[-66.29003,-80.25577],[-64.03769,-80.29494],[-61.88325,-80.39287],[-61.13898,-79.98137],[-60.61012,-79.62868],[-59.57209,-80.04018]]],[[[-159.20818,-79.49706],[-161.1276,-79.63421],[-162.43985,-79.28147],[-163.02741,-78.92877],[-163.0666,-78.86997],[-163.7129,-78.59567],[-163.7129,-78.59567],[-163.1058,-78.22334],[-161.24511,-78.38018],[-160.24621,-78.69365],[-159.4824,-79.04634],[-159.20818,-79.49706]]],[[[-45.15476,-78.04707],[-43.92083,-78.4781],[-43.48995,-79.08556],[-43.37244,-79.51664],[-43.33327,-80.02612],[-44.88054,-80.33964],[-46.50617,-80.59436],[-48.38642,-80.82948],[-50.48211,-81.02544],[-52.85199,-80.96669],[-54.16426,-80.63353],[-53.98799,-80.22203],[-51.85313,-79.94773],[-50.99133,-79.61462],[-50.36459,-79.18349],[-49.91413,-78.81121],[-49.30696,-78.45857],[-48.66062,-78.04702],[-48.66062,-78.04702],[-48.1514,-78.04707],[-46.66286,-77.83148],[-45.15476,-78.04707]]],[[[-121.21151,-73.50099],[-119.91885,-73.65773],[-118.72414,-73.48135],[-119.29212,-73.8341],[-120.23222,-74.08881],[-121.62283,-74.01047],[-122.62173,-73.65778],[-122.62174,-73.65778],[-122.40624,-73.32462],[-121.21151,-73.50099]]],[[[-125.55957,-73.48135],[-124.03188,-73.87327],[-124.61947,-73.8341],[-125.91218,-73.73612],[-127.28313,-73.46177],[-127.28313,-73.46177],[-126.55847,-73.24623],[-125.55957,-73.48135]]],[[[-98.98155,-71.93333],[-97.88474,-72.07054],[-96.78794,-71.95297],[-96.20035,-72.52121],[-96.98376,-72.44286],[-98.19808,-72.48203],[-99.43201,-72.44286],[-100.78346,-72.50162],[-101.80187,-72.30566],[-102.33073,-71.89416],[-102.33073,-71.89416],[-101.70397,-71.71779],[-100.43092,-71.85499],[-98.98155,-71.93333]]],[[[-68.45135,-70.95582],[-68.33383,-71.40649],[-68.51013,-71.79841],[-68.7843,-72.17074],[-69.95947,-72.30789],[-71.07589,-72.50384],[-72.38813,-72.48426],[-71.8985,-72.09234],[-73.07362,-72.22949],[-74.19004,-72.36669],[-74.95389,-72.07276],[-75.01263,-71.66126],[-73.91582,-71.26934],[-73.91582,-71.26934],[-73.23033,-71.15178],[-72.07472,-71.19095],[-71.78096,-70.68147],[-71.72218,-70.3092],[-71.74179,-69.50578],[-71.17382,-69.03547],[-70.25325,-68.87874],[-69.72445,-69.25102],[-69.48942,-69.62335],[-69.05852,-70.07402],[-68.72554,-70.50515],[-68.45135,-70.95582]]],[[[-58.61414,-64.15247],[-59.04507,-64.36801],[-59.78934,-64.21122],[-60.61193,-64.3092],[-61.29742,-64.54433],[-62.0221,-64.79909],[-62.51176,-65.09303],[-62.64886,-65.48494],[-62.59013,-65.85722],[-62.12008,-66.19033],[-62.80557,-66.42551],[-63.74569,-66.50385],[-64.29411,-66.837],[-64.88169,-67.15047],[-65.50842,-67.58161],[-65.66508,-67.95389],[-65.31255,-68.36533],[-64.78371,-68.67891],[-63.9611,-68.91398],[-63.1973,-69.22756],[-62.78596,-69.61942],[-62.57052,-69.99175],[-62.27674,-70.38366],[-61.80666,-70.71677],[-61.51291,-71.08904],[-61.37581,-72.01007],[-61.08198,-72.38235],[-61.00366,-72.77426],[-60.69027,-73.16618],[-60.82737,-73.69524],[-61.37581,-74.10674],[-61.96337,-74.43985],[-63.2952,-74.577],[-63.74569,-74.92974],[-64.35284,-75.26285],[-65.86099,-75.63512],[-67.19282,-75.79191],[-68.44628,-76.00745],[-69.79772,-76.22299],[-70.60072,-76.63449],[-72.20678,-76.67367],[-73.96954,-76.63449],[-75.55598,-76.71289],[-77.24037,-76.71289],[-76.92698,-77.1048],[-75.39929,-77.28107],[-74.28288,-77.55542],[-73.65612,-77.90811],[-74.77254,-78.22163],[-76.4961,-78.12365],[-77.92586,-78.37842],[-77.98467,-78.78992],[-78.02378,-79.18183],[-76.84864,-79.51494],[-76.63322,-79.88722],[-75.3601,-80.25955],[-73.24485,-80.41633],[-71.44295,-80.69063],[-70.01316,-81.00415],[-68.19165,-81.31767],[-65.70428,-81.47446],[-63.25603,-81.74876],[-61.55203,-82.04269],[-59.69142,-82.37585],[-58.71212,-82.84611],[-58.22249,-83.21843],[-57.00812,-82.86569],[-55.36289,-82.57176],[-53.61977,-82.25823],[-51.54364,-82.00352],[-49.76135,-81.72917],[-47.27393,-81.70959],[-44.82571,-81.84674],[-42.80836,-82.08191],[-42.16202,-81.65083],[-40.77143,-81.35689],[-38.24482,-81.33731],[-36.26667,-81.12171],[-34.3864,-80.90617],[-32.3103,-80.76902],[-30.0971,-80.59265],[-28.5498,-80.33794],[-29.2549,-79.9852],[-29.68581,-79.6325],[-29.68581,-79.26023],[-31.62481,-79.2994],[-33.68132,-79.45613],[-35.63991,-79.45613],[-35.91411,-79.08385],[-35.77701,-78.33925],[-35.32655,-78.12365],[-33.89676,-77.88853],[-32.21237,-77.65345],[-30.99805,-77.35951],[-29.78373,-77.06558],[-28.88278,-76.67367],[-27.51175,-76.49735],[-26.16034,-76.36014],[-25.47482,-76.2818],[-23.92755,-76.24258],[-22.4586,-76.10543],[-21.22469,-75.90947],[-20.01038,-75.67435],[-18.91354,-75.43922],[-17.52298,-75.1257],[-16.64159,-74.79254],[-15.70149,-74.4986],[-15.40771,-74.10674],[-16.46532,-73.87161],[-16.11278,-73.46011],[-15.44686,-73.14654],[-14.4088,-72.95058],[-13.31197,-72.71546],[-12.29351,-72.40194],[-11.51007,-72.01007],[-11.02043,-71.53977],[-10.29577,-71.26542],[-9.10102,-71.32422],[-8.61138,-71.65733],[-7.41662,-71.6965],[-7.37745,-71.32422],[-6.86823,-70.93231],[-5.79098,-71.03029],[-5.53637,-71.40262],[-4.34167,-71.46137],[-3.04898,-71.28505],[-1.79549,-71.16744],[-0.65949,-71.22625],[-0.22864,-71.63775],[0.8682,-71.30464],[1.88669,-71.12827],[3.02264,-70.99112],[4.13906,-70.85392],[5.15755,-70.61879],[6.27391,-70.46205],[7.13572,-70.24651],[7.74287,-69.89377],[8.48711,-70.14853],[9.52513,-70.01133],[10.24985,-70.48164],[10.81782,-70.83433],[11.95382,-70.63837],[12.40429,-70.24651],[13.42278,-69.97216],[14.735,-70.03092],[15.12676,-70.40325],[15.94934,-70.03092],[17.02659,-69.91335],[18.20171,-69.87418],[19.25937,-69.89377],[20.37574,-70.01133],[21.45299,-70.07014],[21.92303,-70.40325],[22.5694,-70.69718],[23.66618,-70.52081],[24.84136,-70.48164],[25.97731,-70.48164],[27.09373,-70.46205],[28.09258,-70.32485],[29.15024,-70.20729],[30.03158,-69.93294],[30.97173,-69.75662],[31.99017,-69.65864],[32.75405,-69.38429],[33.30244,-68.83564],[33.87042,-68.50259],[34.90849,-68.65927],[35.3002,-69.01201],[36.16201,-69.24714],[37.20003,-69.16875],[37.90511,-69.52144],[38.6494,-69.7762],[39.66789,-69.54108],[40.02043,-69.10994],[40.92136,-68.93362],[41.95943,-68.60051],[42.9387,-68.46331],[44.11388,-68.26741],[44.89729,-68.05187],[45.71993,-67.81674],[46.50334,-67.6012],[47.44344,-67.71876],[48.34442,-67.36607],[48.99074,-67.09172],[49.93089,-67.1113],[50.75347,-66.87618],[50.94932,-66.52348],[51.79155,-66.24913],[52.61413,-66.05318],[53.61304,-65.89639],[54.53355,-65.81805],[55.41494,-65.8768],[56.35504,-65.97478],[57.15809,-66.24913],[57.25597,-66.68022],[58.13736,-67.01332],[58.74451,-67.28767],[59.93932,-67.40524],[60.60522,-67.67959],[61.42781,-67.95389],[62.38749,-68.0127],[63.19049,-67.81674],[64.05235,-67.40524],[64.99245,-67.62073],[65.97172,-67.73834],[66.91186,-67.85591],[67.89113,-67.9343],[68.89004,-67.9343],[69.71262,-68.97279],[69.67345,-69.22756],[69.55594,-69.67823],[68.59626,-69.93294],[67.81274,-70.30527],[67.94989,-70.69718],[69.06631,-70.67755],[68.92916,-71.06946],[68.41999,-71.44179],[67.94989,-71.85329],[68.71377,-72.16681],[69.86931,-72.26479],[71.0249,-72.08842],[71.57329,-71.6965],[71.90629,-71.32422],[72.45463,-71.0107],[73.08141,-70.71677],[73.33602,-70.36402],[73.86488,-69.87418],[74.49156,-69.7762],[75.62756,-69.73703],[76.62647,-69.61942],[77.6449,-69.46268],[78.13454,-69.07077],[78.42837,-68.69844],[79.11386,-68.32622],[80.09313,-68.0715],[80.93535,-67.87555],[81.48379,-67.54239],[82.05177,-67.36607],[82.77643,-67.20928],[83.77533,-67.30726],[84.67621,-67.20928],[85.65553,-67.09172],[86.75236,-67.15047],[87.47702,-66.87618],[87.98629,-66.20991],[88.35841,-66.48426],[88.82841,-66.95457],[89.67063,-67.15047],[90.63037,-67.22887],[91.5901,-67.1113],[92.60854,-67.1897],[93.54864,-67.20928],[94.17542,-67.1113],[95.01759,-67.17011],[95.78147,-67.38565],[96.6824,-67.2485],[97.75965,-67.2485],[98.68021,-67.1113],[99.71818,-67.2485],[100.38419,-66.91535],[100.89336,-66.58224],[101.5789,-66.30789],[102.83241,-65.56328],[103.47868,-65.70048],[104.24256,-65.97478],[104.90846,-66.32753],[106.18156,-66.93493],[107.16088,-66.95457],[108.08139,-66.95457],[109.15864,-66.837],[110.23583,-66.6998],[111.05847,-66.42551],[111.74396,-66.13157],[112.86038,-66.09235],[113.60467,-65.8768],[114.38809,-66.07276],[114.89731,-66.38628],[115.60238,-66.6998],[116.69916,-66.66063],[117.3847,-66.91535],[118.57946,-67.17011],[119.83292,-67.26809],[120.871,-67.1897],[121.65441,-66.87618],[122.32037,-66.56265],[123.2213,-66.48426],[124.12227,-66.62146],[125.16025,-66.71939],[126.1004,-66.56265],[127.00143,-66.56265],[127.88277,-66.66063],[128.80328,-66.75861],[129.70426,-66.58224],[130.78145,-66.42551],[131.79995,-66.38628],[132.9359,-66.38628],[133.85646,-66.2883],[134.75739,-66.20996],[135.03158,-65.72007],[135.07075,-65.30857],[135.69748,-65.58287],[135.8738,-66.03359],[136.2067,-66.44509],[136.61805,-66.7782],[137.46027,-66.95457],[138.59622,-66.89576],[139.90844,-66.87618],[140.80942,-66.81737],[142.12169,-66.81737],[143.06184,-66.79778],[144.37406,-66.837],[145.49043,-66.91535],[146.19555,-67.22887],[145.9997,-67.6012],[146.64607,-67.89513],[147.72326,-68.13026],[148.83963,-68.38502],[150.13231,-68.56129],[151.4837,-68.71813],[152.50225,-68.87481],[153.6382,-68.8945],[154.28457,-68.56129],[155.16586,-68.83564],[155.92979,-69.14921],[156.81113,-69.38429],[158.02553,-69.48227],[159.18101,-69.59983],[159.6707,-69.99175],[160.80665,-70.22688],[161.57048,-70.57962],[162.6869,-70.73635],[163.84243,-70.71677],[164.91968,-70.77552],[166.11444,-70.75594],[167.3091,-70.83433],[168.42562,-70.97148],[169.46359,-71.20666],[170.50167,-71.40262],[171.20679,-71.6965],[171.08923,-72.08842],[170.56042,-72.44116],[170.10996,-72.89183],[169.75737,-73.24452],[169.28732,-73.65602],[167.9751,-73.81281],[167.38749,-74.1655],[166.0948,-74.38104],[165.64439,-74.77295],[164.95885,-75.14528],[164.23419,-75.4588],[163.8228,-75.8703],[163.56824,-76.24258],[163.47026,-76.6933],[163.4899,-77.06558],[164.05787,-77.45744],[164.27336,-77.82977],[164.74346,-78.18251],[166.60413,-78.31961],[166.99578,-78.75075],[165.19388,-78.90748],[163.66622,-79.12303],[161.76638,-79.16225],[160.92416,-79.73048],[160.74789,-80.20074],[160.31696,-80.57307],[159.78821,-80.94539],[161.12002,-81.2785],[161.62929,-81.69],[162.49099,-82.06228],[163.70534,-82.39544],[165.09595,-82.70896],[166.60413,-83.02248],[168.89567,-83.336],[169.40478,-83.82589],[172.28393,-84.04143],[172.47705,-84.11791],[173.22408,-84.41371],[175.98567,-84.159],[178.27721,-84.47252],[180.0,-84.71338],[180.0,-90.0],[-180.0,-90.0],[-180.0,-84.71338],[-179.9425,-84.72144],[-179.05868,-84.13941],[-177.25677,-84.45293],[-177.14081,-84.41794],[-176.86199,-84.33381],[-176.52395,-84.23181],[-176.2303,-84.1432],[-176.08467,-84.09926],[-175.9341,-84.10159],[-175.82988,-84.11791],[-174.3825,-84.53432],[-173.11656,-84.11791],[-172.88911,-84.06102],[-169.95122,-83.88465],[-168.99999,-84.11791],[-168.5302,-84.23739],[-167.0221,-84.5705],[-164.18214,-84.82521],[-161.92977,-85.13873],[-158.07138,-85.37391],[-155.19225,-85.09956],[-150.9421,-85.29552],[-148.53307,-85.60904],[-145.88892,-85.3151],[-143.10772,-85.04075],[-142.89228,-84.5705],[-146.82907,-84.53127],[-150.06073,-84.29615],[-150.90293,-83.90423],[-153.5862,-83.68869],[-153.40991,-83.23802],[-153.03776,-82.82652],[-152.66564,-82.45419],[-152.86152,-82.04269],[-154.5263,-81.76839],[-155.29018,-81.41565],[-156.83745,-81.10213],[-154.40879,-81.16094],[-152.09766,-81.00415],[-150.64829,-81.33731],[-148.866,-81.04337],[-147.22075,-80.67104],[-146.41775,-80.33794],[-146.77029,-79.92644],[-148.06295,-79.65209],[-149.5319,-79.3582],[-151.58842,-79.2994],[-153.39032,-79.16225],[-155.32938,-79.06427],[-155.97567,-78.69194],[-157.2683,-78.37842],[-158.05177,-78.02568],[-158.36513,-76.88921],[-157.87547,-76.98724],[-156.97457,-77.30076],[-155.32938,-77.20273],[-153.74283,-77.06558],[-152.92025,-77.49666],[-151.33378,-77.39874],[-150.00195,-77.18314],[-148.74849,-76.90884],[-147.61248,-76.57574],[-146.10441,-76.47776],[-146.14353,-76.10543],[-146.49609,-75.73315],[-146.20231,-75.38041],[-144.90962,-75.20404],[-144.32204,-75.5372],[-142.79435,-75.34124],[-141.63876,-75.08648],[-140.20901,-75.06689],[-138.85759,-74.96891],[-137.5062,-74.73378],[-136.4289,-74.51824],[-135.21458,-74.3027],[-134.43119,-74.36145],[-133.74565,-74.43985],[-132.25717,-74.3027],[-130.92531,-74.47902],[-129.55428,-74.45943],[-128.24204,-74.32228],[-126.89062,-74.42026],[-125.40208,-74.51824],[-124.0115,-74.47902],[-122.56215,-74.4986],[-121.07361,-74.51824],[-119.70256,-74.47902],[-118.68415,-74.18508],[-117.4698,-74.02835],[-116.21631,-74.24389],[-115.02155,-74.06752],[-113.94433,-73.71483],[-113.29799,-74.02835],[-112.94545,-74.38104],[-112.29908,-74.7142],[-111.26106,-74.42026],[-110.06633,-74.79254],[-108.71491,-74.9101],[-107.55935,-75.18445],[-106.14915,-75.1257],[-104.87607,-74.94933],[-103.36795,-74.9885],[-102.01651,-75.1257],[-100.64553,-75.30202],[-100.1167,-74.87093],[-100.76304,-74.53783],[-101.2527,-74.18508],[-102.54534,-74.10674],[-103.11331,-73.73441],[-103.32875,-73.36208],[-103.68129,-72.61753],[-102.91749,-72.75468],[-101.60524,-72.81344],[-100.31253,-72.75468],[-99.13738,-72.91141],[-98.11889,-73.20535],[-97.68804,-73.55804],[-96.33659,-73.61685],[-95.04396,-73.4797],[-93.67291,-73.28374],[-92.439,-73.16618],[-91.42056,-73.40131],[-90.08873,-73.32291],[-89.22695,-72.55872],[-88.42395,-73.00939],[-87.26834,-73.18576],[-86.01482,-73.08779],[-85.19224,-73.4797],[-83.87999,-73.51887],[-82.66565,-73.63643],[-81.47091,-73.85198],[-80.68745,-73.4797],[-80.29579,-73.12696],[-79.29689,-73.51887],[-77.92586,-73.42089],[-76.90737,-73.63643],[-76.22188,-73.96954],[-74.89005,-73.87161],[-73.85202,-73.65602],[-72.83353,-73.40131],[-71.61921,-73.26416],[-70.20904,-73.14654],[-68.93592,-73.00939],[-67.95662,-72.79385],[-67.36906,-72.48033],[-67.13404,-72.04924],[-67.25155,-71.63775],[-67.56494,-71.24583],[-67.91748,-70.85392],[-68.23084,-70.46205],[-68.48545,-70.10931],[-68.54421,-69.7174],[-68.44628,-69.32553],[-67.97623,-68.95321],[-67.5845,-68.54171],[-67.42784,-68.14984],[-67.62367,-67.71876],[-67.74118,-67.32685],[-67.25155,-66.87618],[-66.70318,-66.58224],[-66.05682,-66.20996],[-65.37133,-65.89639],[-64.56828,-65.60251],[-64.17654,-65.17142],[-63.62815,-64.89707],[-63.00139,-64.64231],[-62.04169,-64.58355],[-61.41493,-64.27003],[-60.70985,-64.07407],[-59.88727,-63.95651],[-59.16258,-63.70175],[-58.59456,-63.38822],[-57.81114,-63.27066],[-57.22358,-63.52543],[-57.59573,-63.85853],[-58.61414,-64.15247]]],[[[-67.75,-53.85],[-66.45,-54.45],[-65.05,-54.7],[-65.5,-55.2],[-66.45,-55.25],[-66.95992,-54.89681],[-67.29103,-55.30124],[-68.14863,-55.61183],[-69.2321,-55.49906],[-69.95809,-55.19843],[-71.00568,-55.05383],[-72.2639,-54.49514],[-73.2852,-53.95752],[-74.66253,-52.83749],[-73.8381,-53.04743],[-72.43418,-53.7154],[-71.10773,-54.07433],[-70.59178,-53.61583],[-70.26748,-52.93123],[-69.34565,-52.5183],[-68.63411,-52.63625],[-68.63401,-52.63637],[-68.25,-53.1],[-67.75,-53.85]]],[[[-58.55,-51.1],[-57.75,-51.55],[-58.05,-51.9],[-59.4,-52.2],[-59.85,-51.85],[-60.7,-52.3],[-61.2,-51.85],[-60.0,-51.25],[-59.15,-51.5],[-58.55,-51.1]]],[[[70.28,-49.71],[68.745,-49.775],[68.72,-49.2425],[68.8675,-48.83],[68.935,-48.625],[69.58,-48.94],[70.525,-49.065],[70.56,-49.255],[70.28,-49.71]]],[[[145.39798,-40.79255],[146.36412,-41.1377],[146.90858,-41.00055],[147.68926,-40.80826],[148.28907,-40.87544],[148.35986,-42.06245],[148.0173,-42.40702],[147.91405,-43.21152],[147.56456,-42.93769],[146.87034,-43.6346],[146.66333,-43.58085],[146.04838,-43.54974],[145.43193,-42.69378],[145.29509,-42.03361],[144.71807,-41.16255],[144.74375,-40.70398],[145.39798,-40.79255]]],[[[173.02037,-40.91905],[173.24723,-41.332],[173.95841,-40.9267],[174.24759,-41.34916],[174.24852,-41.77001],[173.87645,-42.23318],[173.22274,-42.97004],[172.71125,-43.37229],[173.08011,-43.85334],[172.30858,-43.86569],[171.45293,-44.24252],[171.18514,-44.8971],[170.6167,-45.90893],[169.83142,-46.35577],[169.33233,-46.64124],[168.41135,-46.61994],[167.76374,-46.2902],[166.67689,-46.21992],[166.50914,-45.8527],[167.04642,-45.11094],[168.30376,-44.12397],[168.94941,-43.93582],[169.66781,-43.55533],[170.52492,-43.03169],[171.12509,-42.51275],[171.56971,-41.76742],[171.94871,-41.51442],[172.09723,-40.9561],[172.79858,-40.49396],[173.02037,-40.91905]]],[[[174.61201,-36.1564],[175.33662,-37.2091],[175.3576,-36.52619],[175.80889,-36.79894],[175.95849,-37.55538],[176.7632,-37.88125],[177.43881,-37.96125],[178.01035,-37.57982],[178.51709,-37.69537],[178.27473,-38.58281],[177.97046,-39.16634],[177.20699,-39.14578],[176.93998,-39.44974],[177.03295,-39.87994],[176.88582,-40.06598],[176.50802,-40.60481],[176.01244,-41.28962],[175.23957,-41.68831],[175.0679,-41.42589],[174.65097,-41.28182],[175.22763,-40.45924],[174.90016,-39.90893],[173.82405,-39.50885],[173.85226,-39.1466],[174.5748,-38.79768],[174.74347,-38.02781],[174.69702,-37.38113],[174.29203,-36.71109],[174.319,-36.53482],[173.841,-36.12198],[173.05417,-35.23713],[172.63601,-34.52911],[173.00704,-34.45066],[173.5513,-35.00618],[174.32939,-35.2655],[174.61201,-36.1564]]],[[[167.12001,-22.15999],[166.74003,-22.39998],[166.18973,-22.12971],[165.47438,-21.67961],[164.82982,-21.14982],[164.168,-20.44475],[164.02961,-20.10565],[164.45997,-20.12001],[165.02004,-20.45999],[165.46001,-20.80002],[165.77999,-21.08],[166.59999,-21.70002],[167.12001,-22.15999]]],[[[178.3736,-17.33992],[178.71806,-17.62846],[178.55271,-18.15059],[177.93266,-18.28799],[177.38146,-18.16432],[177.28504,-17.72465],[177.67087,-17.38114],[178.12557,-17.50481],[178.3736,-17.33992]]],[[[179.36414,-16.80135],[178.72506,-17.01204],[178.59684,-16.63915],[179.09661,-16.43398],[179.41351,-16.37905],[180.0,-16.06713],[180.0,-16.55522],[179.36414,-16.80135]]],[[[-179.91737,-16.50178],[-180.0,-16.55522],[-180.0,-16.06713],[-179.79332,-16.02088],[-179.91737,-16.50178]]],[[[167.84488,-16.46633],[167.51518,-16.59785],[167.18001,-16.16],[167.2168,-15.89185],[167.84488,-16.46633]]],[[[167.10771,-14.93392],[167.27003,-15.74002],[167.00121,-15.6146],[166.79316,-15.66881],[166.64986,-15.3927],[166.62914,-14.6265],[167.10771,-14.93392]]],[[[50.05651,-13.55576],[50.21743,-14.75879],[50.47654,-15.22651],[50.37711,-15.70607],[50.20027,-16.00026],[49.86061,-15.41425],[49.67261,-15.7102],[49.86334,-16.45104],[49.77456,-16.87504],[49.49861,-17.10604],[49.43562,-17.95306],[49.04179,-19.11878],[48.54854,-20.49689],[47.93075,-22.3915],[47.54772,-23.78196],[47.09576,-24.94163],[46.28248,-25.17846],[45.40951,-25.60143],[44.83357,-25.3461],[44.03972,-24.98835],[43.76377,-24.46068],[43.69778,-23.57412],[43.34565,-22.7769],[43.25419,-22.05741],[43.4333,-21.33648],[43.89368,-21.16331],[43.89637,-20.83046],[44.37433,-20.07237],[44.4644,-19.43545],[44.23242,-18.96199],[44.04298,-18.33139],[43.96308,-17.40994],[44.31247,-16.8505],[44.44652,-16.21622],[44.94494,-16.17937],[45.50273,-15.97437],[45.87299,-15.79345],[46.31224,-15.78002],[46.88218,-15.21018],[47.70513,-14.5943],[48.00521,-14.09123],[47.86905,-13.66387],[48.29383,-13.78407],[48.84506,-13.08917],[48.86351,-12.48787],[49.19465,-12.04056],[49.54352,-12.46983],[49.80898,-12.89528],[50.05651,-13.55576]]],[[[143.56181,-13.76366],[143.9221,-14.54831],[144.56371,-14.17118],[144.89491,-14.59446],[145.37472,-14.98498],[145.27199,-15.42821],[145.48526,-16.28567],[145.63703,-16.78492],[145.8889,-16.90693],[146.16031,-17.76165],[146.06367,-18.28007],[146.38748,-18.95827],[147.47108,-19.48072],[148.1776,-19.95594],[148.84841,-20.39121],[148.71747,-20.63347],[149.28942,-21.26051],[149.67834,-22.34251],[150.07738,-22.12278],[150.48294,-22.55614],[150.72727,-22.4024],[150.89955,-23.46224],[151.60918,-24.07626],[152.07354,-24.45789],[152.8552,-25.2675],[153.13616,-26.07117],[153.16195,-26.64132],[153.09291,-27.2603],[153.56947,-28.11007],[153.51211,-28.99508],[153.3391,-29.4582],[153.06924,-30.35024],[153.0896,-30.92364],[152.89158,-31.64045],[152.45,-32.55],[151.70912,-33.04134],[151.34397,-33.81602],[151.01056,-34.31036],[150.71414,-35.17346],[150.32822,-35.67188],[150.07521,-36.42021],[149.94612,-37.10905],[149.99728,-37.42526],[149.42388,-37.77268],[148.30462,-37.80906],[147.38173,-38.21922],[146.92212,-38.60653],[146.31792,-39.03576],[145.48965,-38.59377],[144.87698,-38.41745],[145.03221,-37.89619],[144.48568,-38.08532],[143.60997,-38.80947],[142.74543,-38.53827],[142.17833,-38.38003],[141.60658,-38.30851],[140.63858,-38.01933],[139.99216,-37.40294],[139.80659,-36.6436],[139.57415,-36.13836],[139.08281,-35.73275],[138.12075,-35.6123],[138.44946,-35.12726],[138.20756,-34.38472],[137.71917,-35.07683],[136.82941,-35.26053],[137.35237,-34.70734],[137.50389,-34.13027],[137.89012,-33.64048],[137.81033,-32.90001],[136.99684,-33.75277],[136.37207,-34.09477],[135.98904,-34.89012],[135.20821,-34.47867],[135.23922,-33.94795],[134.61342,-33.22278],[134.0859,-32.84807],[134.2739,-32.61723],[132.99078,-32.01122],[132.28808,-31.98265],[131.32633,-31.4958],[129.53579,-31.59042],[128.24094,-31.94849],[127.10287,-32.28227],[126.14871,-32.21597],[125.08862,-32.72875],[124.22165,-32.95949],[124.02895,-33.48385],[123.65967,-33.89018],[122.81104,-33.91447],[122.18306,-34.0034],[121.29919,-33.82104],[120.58027,-33.93018],[119.8937,-33.97607],[119.2989,-34.50937],[119.00734,-34.46415],[118.50572,-34.74682],[118.02497,-35.06473],[117.29551,-35.02546],[116.62511,-35.0251],[115.56435,-34.38643],[115.02681,-34.19652],[115.04862,-33.62343],[115.54512,-33.48726],[115.71467,-33.25957],[115.67938,-32.90037],[115.80165,-32.20506],[115.68961,-31.61244],[115.16091,-30.60159],[114.99704,-30.03072],[115.04004,-29.4611],[114.64197,-28.81023],[114.6165,-28.5164],[114.17358,-28.11808],[114.04888,-27.33477],[113.4775,-26.54313],[113.33895,-26.11655],[113.77836,-26.54903],[113.44096,-25.62128],[113.9369,-25.91123],[114.23285,-26.29845],[114.21616,-25.78628],[113.72126,-24.99894],[113.62534,-24.68397],[113.39352,-24.38476],[113.50204,-23.80635],[113.70699,-23.56022],[113.84342,-23.05999],[113.73655,-22.47548],[114.14976,-21.75588],[114.22531,-22.51749],[114.64776,-21.82952],[115.46017,-21.49517],[115.94737,-21.06869],[116.71162,-20.70168],[117.16632,-20.6236],[117.44155,-20.7469],[118.22956,-20.37421],[118.83609,-20.26331],[118.98781,-20.0442],[119.25249,-19.95294],[119.80523,-19.97651],[120.85622,-19.68371],[121.39986,-19.23976],[121.65514,-18.70532],[122.24167,-18.19765],[122.28662,-17.7986],[122.31277,-17.25497],[123.01257,-16.4052],[123.43379,-17.26856],[123.85934,-17.06904],[123.50324,-16.59651],[123.81707,-16.11132],[124.25829,-16.32794],[124.37973,-15.56706],[124.92615,-15.0751],[125.16728,-14.6804],[125.67009,-14.51007],[125.6858,-14.23066],[126.12515,-14.34734],[126.14282,-14.09599],[126.58259,-13.95279],[127.06587,-13.81797],[127.80463,-14.27691],[128.35969,-14.86917],[128.98554,-14.87599],[129.62147,-14.96978],[129.4096,-14.42067],[129.88864,-13.6187],[130.33947,-13.35738],[130.18351,-13.10752],[130.6178,-12.53639],[131.22349,-12.18365],[131.73509,-12.30245],[132.5753,-12.11404],[132.55721,-11.60301],[131.8247,-11.27378],[132.35722,-11.12852],[133.01956,-11.37641],[133.55085,-11.78652],[134.39307,-12.04237],[134.67863,-11.94118],[135.29849,-12.24861],[135.88269,-11.96227],[136.25838,-12.04934],[136.49248,-11.85721],[136.95162,-12.35196],[136.68512,-12.88722],[136.30541,-13.29123],[135.96176,-13.32451],[136.07762,-13.72428],[135.78384,-14.22399],[135.42866,-14.71543],[135.50018,-14.99774],[136.29517,-15.55026],[137.06536,-15.87076],[137.58047,-16.21508],[138.30322,-16.8076],[138.58516,-16.80662],[139.10854,-17.06268],[139.26057,-17.3716],[140.21525,-17.7108],[140.87546,-17.36907],[141.07111,-16.83205],[141.2741,-16.38887],[141.39822,-15.84053],[141.70218,-15.04492],[141.56338,-14.56133],[141.63552,-14.27039],[141.51987,-13.69808],[141.65092,-12.94469],[141.84269,-12.74155],[141.68699,-12.40761],[141.92863,-11.87747],[142.11849,-11.32804],[142.14371,-11.04274],[142.51526,-10.66819],[142.79731,-11.15735],[142.86676,-11.78471],[143.11595,-11.90563],[143.15863,-12.32566],[143.52212,-12.83436],[143.59716,-13.40042],[143.56181,-13.76366]]],[[[162.11902,-10.48272],[162.39865,-10.82637],[161.70003,-10.82001],[161.3198,-10.20475],[161.91738,-10.4467],[162.11902,-10.48272]]],[[[120.71561,-10.23958],[120.29501,-10.25865],[118.96781,-9.55797],[119.90031,-9.36134],[120.42576,-9.66592],[120.7755,-9.96968],[120.71561,-10.23958]]],[[[160.85223,-9.87294],[160.46259,-9.89521],[159.84945,-9.79403],[159.64,-9.63998],[159.70294,-9.24295],[160.36296,-9.4003],[160.68852,-9.61016],[160.85223,-9.87294]]],[[[161.67998,-9.59998],[161.5294,-9.78431],[160.78825,-8.91754],[160.58,-8.32001],[160.92003,-8.32001],[161.28001,-9.12001],[161.67998,-9.59998]]],[[[124.43595,-10.14],[123.57998,-10.35999],[123.45999,-10.23999],[123.55001,-9.90002],[123.98001,-9.29003],[124.96868,-8.89279],[125.08625,-8.65689],[125.94707,-8.43209],[126.6447,-8.39825],[126.95724,-8.27334],[127.33593,-8.39732],[126.96799,-8.66826],[125.92589,-9.10601],[125.08852,-9.39317],[124.43595,-10.14]]],[[[117.90002,-8.09568],[118.26062,-8.36238],[118.87846,-8.28068],[119.12651,-8.70582],[117.9704,-8.90664],[117.27773,-9.04089],[116.74014,-9.03294],[117.08374,-8.45716],[117.63202,-8.4493],[117.90002,-8.09568]]],[[[122.90354,-8.09423],[122.75698,-8.64981],[121.25449,-8.93367],[119.92439,-8.81042],[119.92093,-8.44486],[120.71509,-8.23696],[121.34167,-8.53674],[122.00736,-8.46062],[122.90354,-8.09423]]],[[[159.87503,-8.33732],[159.9174,-8.53829],[159.13368,-8.11418],[158.58611,-7.75482],[158.21115,-7.42187],[158.35998,-7.32002],[158.82,-7.56],[159.64,-8.02003],[159.87503,-8.33732]]],[[[157.53843,-7.34782],[157.33942,-7.40477],[156.90203,-7.17687],[156.49136,-6.76594],[156.54283,-6.59934],[157.14,-7.02164],[157.53843,-7.34782]]],[[[108.62348,-6.77767],[110.53923,-6.87736],[110.75958,-6.46519],[112.61481,-6.94604],[112.97877,-7.59421],[114.47894,-7.77653],[115.70553,-8.37081],[114.56451,-8.75182],[113.46473,-8.34895],[112.55967,-8.37618],[111.52206,-8.30213],[110.58615,-8.1226],[109.42767,-7.74066],[108.69366,-7.6416],[108.27776,-7.76666],[106.4541,-7.3549],[106.28062,-6.9249],[105.36549,-6.85142],[106.05165,-5.89592],[107.26501,-5.95499],[108.07209,-6.34576],[108.48685,-6.42198],[108.62348,-6.77767]]],[[[134.72462,-6.2144],[134.21013,-6.89524],[134.11278,-6.14247],[134.29034,-5.78306],[134.49963,-5.44504],[134.727,-5.73758],[134.72462,-6.2144]]],[[[155.88003,-6.82],[155.59999,-6.91999],[155.16699,-6.53593],[154.72919,-5.90083],[154.51411,-5.13912],[154.6525,-5.04243],[154.75999,-5.33998],[155.06292,-5.56679],[155.54775,-6.20065],[156.01997,-6.54001],[155.88003,-6.82]]],[[[151.9828,-5.47806],[151.45911,-5.56028],[151.30139,-5.84073],[150.75445,-6.08376],[150.2412,-6.31775],[149.70996,-6.31651],[148.89006,-6.02604],[148.31894,-5.74714],[148.40183,-5.43776],[149.29841,-5.58374],[149.84556,-5.5055],[149.99625,-5.0261],[150.13976,-5.00135],[150.23691,-5.53222],[150.80747,-5.45584],[151.08967,-5.11369],[151.64788,-4.75707],[151.53786,-4.16781],[152.13679,-4.14879],[152.33874,-4.31297],[152.31869,-4.86766],[151.9828,-5.47806]]],[[[127.24922,-3.45907],[126.87492,-3.79098],[126.1838,-3.60738],[125.98903,-3.17727],[127.00065,-3.12932],[127.24922,-3.45907]]],[[[130.47134,-3.09376],[130.83484,-3.85847],[129.99055,-3.4463],[129.15525,-3.36264],[128.59068,-3.42868],[127.89889,-3.39344],[128.13588,-2.84365],[129.371,-2.80215],[130.47134,-3.09376]]],[[[153.14004,-4.49998],[152.82729,-4.76643],[152.63867,-4.17613],[152.40603,-3.78974],[151.95324,-3.46206],[151.38428,-3.03542],[150.66205,-2.74149],[150.93997,-2.5],[151.47998,-2.77999],[151.82002,-2.99997],[152.23999,-3.24001],[152.64002,-3.65998],[153.01999,-3.98002],[153.14004,-4.49998]]],[[[134.14337,-1.15187],[134.42263,-2.76918],[135.4576,-3.36775],[136.29331,-2.30704],[137.44074,-1.70351],[138.32973,-1.70269],[139.18492,-2.0513],[139.92668,-2.40905],[141.00021,-2.60015],[142.73525,-3.28915],[144.58397,-3.86142],[145.27318,-4.37374],[145.82979,-4.8765],[145.98192,-5.46561],[147.64807,-6.08366],[147.89111,-6.61401],[146.97091,-6.72166],[147.19187,-7.38802],[148.08464,-8.04411],[148.73411,-9.10466],[149.30684,-9.07144],[149.26663,-9.51441],[150.03873,-9.68432],[149.7388,-9.87294],[150.80163,-10.29369],[150.69057,-10.58271],[150.02839,-10.65248],[149.78231,-10.39327],[148.92314,-10.28092],[147.91302,-10.13044],[147.13544,-9.49244],[146.56788,-8.94255],[146.04848,-8.06741],[144.74417,-7.63013],[143.89709,-7.91533],[143.28638,-8.24549],[143.41391,-8.98307],[142.62843,-9.32682],[142.06826,-9.1596],[141.03385,-9.11789],[140.14342,-8.29717],[139.12777,-8.09604],[138.88148,-8.38094],[137.61447,-8.41168],[138.0391,-7.59788],[138.66862,-7.32022],[138.40791,-6.23285],[137.92784,-5.39337],[135.98925,-4.54654],[135.1646,-4.46293],[133.66288,-3.53885],[133.3677,-4.02482],[132.98396,-4.11298],[132.75694,-3.74628],[132.75379,-3.31179],[131.9898,-2.82055],[133.06684,-2.46042],[133.78003,-2.47985],[133.69621,-2.21454],[132.23237,-2.21253],[131.83622,-1.61716],[130.94284,-1.43252],[130.51956,-0.93772],[131.86754,-0.69546],[132.38012,-0.36954],[133.98555,-0.78021],[134.14337,-1.15187]]],[[[125.2405,1.41984],[124.43704,0.42788],[123.6855,0.23559],[122.72308,0.43114],[121.05672,0.38122],[120.18308,0.23725],[120.04087,-0.51966],[120.93591,-1.40891],[121.47582,-0.95596],[123.34056,-0.61567],[123.2584,-1.07621],[122.82272,-0.93095],[122.38853,-1.51686],[121.50827,-1.90448],[122.45457,-3.18606],[122.2719,-3.5295],[123.17096,-4.68369],[123.16233,-5.3406],[122.62852,-5.63459],[122.23639,-5.28293],[122.71957,-4.46417],[121.73823,-4.85133],[121.48946,-4.57455],[121.61917,-4.18848],[120.89818,-3.60211],[120.97239,-2.62764],[120.30545,-2.9316],[120.39005,-4.09758],[120.43072,-5.52824],[119.79654,-5.6734],[119.36691,-5.37988],[119.65361,-4.45942],[119.49884,-3.49441],[119.07834,-3.48702],[118.76777,-2.802],[119.18097,-2.1471],[119.32339,-1.35315],[119.826,0.15425],[120.0357,0.56648],[120.88578,1.30922],[121.66682,1.01394],[122.92757,0.87519],[124.07752,0.9171],[125.06599,1.64326],[125.2405,1.41984]]],[[[128.68825,1.13239],[128.63595,0.25849],[128.12017,0.35641],[127.96803,-0.25208],[128.38,-0.78],[128.10002,-0.9],[127.69647,-0.2666],[127.39949,1.01172],[127.60051,1.81069],[127.93238,2.1746],[128.00416,1.62853],[128.59456,1.54081],[128.68825,1.13239]]],[[[105.81766,-5.85236],[104.71038,-5.87328],[103.86821,-5.03731],[102.58426,-4.22026],[102.15617,-3.61415],[101.39911,-2.79978],[100.9025,-2.05026],[100.14198,-0.65035],[99.26374,0.18314],[98.97001,1.04288],[98.60135,1.82351],[97.6996,2.45318],[97.17694,3.30879],[96.42402,3.86886],[95.38088,4.97078],[95.29303,5.47982],[95.93686,5.43951],[97.48488,5.24632],[98.36917,4.26837],[99.14256,3.59035],[99.694,3.17433],[100.64143,2.09938],[101.65801,2.0837],[102.49827,1.3987],[103.07684,0.56136],[103.8384,0.10454],[103.43765,-0.71195],[104.01079,-1.05921],[104.36999,-1.08484],[104.53949,-1.78237],[104.88789,-2.34043],[105.62211,-2.42884],[106.10859,-3.06178],[105.85745,-4.30552],[105.81766,-5.85236]]],[[[117.87563,1.82764],[118.99675,0.90222],[117.81186,0.78424],[117.47834,0.10247],[117.52164,-0.80372],[116.56005,-1.48766],[116.5338,-2.48352],[116.14808,-4.01273],[116.00086,-3.65704],[114.8648,-4.10698],[114.46865,-3.4957],[113.75567,-3.43917],[113.25699,-3.11878],[112.06813,-3.47839],[111.70329,-2.99444],[111.04824,-3.04943],[110.22385,-2.93403],[110.07094,-1.59287],[109.57195,-1.31491],[109.09187,-0.45951],[108.95266,0.41538],[109.06914,1.34193],[109.66326,2.00647],[110.39614,1.66377],[111.16885,1.85064],[111.37008,2.6973],[111.79693,2.8859],[112.99561,3.10239],[113.71294,3.89351],[114.20402,4.52587],[114.59996,4.90001],[115.45071,5.44773],[116.22074,6.14319],[116.7251,6.92477],[117.12963,6.92805],[117.64339,6.42217],[117.68908,5.98749],[118.34769,5.7087],[119.1819,5.40784],[119.11069,5.01613],[118.43973,4.96652],[118.61832,4.4782],[117.88203,4.13755],[117.31323,3.23443],[118.04833,2.28769],[117.87563,1.82764]]],[[[126.37681,8.41471],[126.47851,7.75035],[126.53742,7.18938],[126.19677,6.27429],[125.83142,7.29372],[125.36385,6.78649],[125.68316,6.04966],[125.39651,5.581],[124.21979,6.16136],[123.93872,6.88514],[124.24366,7.36061],[123.61021,7.83353],[123.29607,7.41888],[122.82551,7.45737],[122.0855,6.89942],[121.91993,7.19212],[122.31236,8.03496],[122.9424,8.31624],[123.48769,8.69301],[123.84115,8.24032],[124.60147,8.51416],[124.76461,8.96041],[125.47139,8.987],[125.41212,9.76033],[126.22271,9.28607],[126.30664,8.78249],[126.37681,8.41471]]],[[[81.21802,6.19714],[80.34836,5.96837],[79.87247,6.76346],[79.69517,8.20084],[80.1478,9.82408],[80.83882,9.26843],[81.30432,8.56421],[81.78796,7.52306],[81.63732,6.48178],[81.21802,6.19714]]],[[[-60.935,10.11],[-61.77,10.0],[-61.95,10.09],[-61.66,10.365],[-61.68,10.76],[-61.105,10.89],[-60.895,10.855],[-60.935,10.11]]],[[[123.98244,10.27878],[123.62318,9.95009],[123.30992,9.31827],[122.99588,9.02219],[122.38005,9.71336],[122.58609,9.98104],[122.83708,10.26116],[122.94741,10.88187],[123.49885,10.94062],[123.33777,10.26738],[124.07794,11.23273],[123.98244,10.27878]]],[[[118.50458,9.31638],[117.17427,8.3675],[117.66448,9.06689],[118.38691,9.6845],[118.98734,10.37629],[119.5115,11.36967],[119.68968,10.55429],[119.02946,10.00365],[118.50458,9.31638]]],[[[121.88355,11.89176],[122.48382,11.58219],[123.12022,11.58366],[123.10084,11.16593],[122.63771,10.74131],[122.00261,10.44102],[121.96737,10.90569],[122.03837,11.41584],[121.88355,11.89176]]],[[[125.50255,12.16269],[125.78346,11.04612],[125.01188,11.31145],[125.03276,10.97582],[125.27745,10.35872],[124.80182,10.13468],[124.76017,10.838],[124.4591,10.88993],[124.30252,11.49537],[124.89101,11.41558],[124.87799,11.79419],[124.26676,12.55776],[125.22712,12.53572],[125.50255,12.16269]]],[[[121.52739,13.06959],[121.26219,12.20556],[120.8339,12.7045],[120.32344,13.46641],[121.18013,13.4297],[121.52739,13.06959]]],[[[121.32131,18.50406],[121.9376,18.21855],[122.24601,18.47895],[122.33696,18.22488],[122.17428,17.81028],[122.51565,17.0935],[122.25231,16.26244],[121.66279,15.93102],[121.50507,15.12481],[121.72883,14.32838],[122.25893,14.2182],[122.70128,14.33654],[123.9503,13.78213],[123.85511,13.23777],[124.18129,12.99753],[124.07742,12.53668],[123.29804,13.02753],[122.92865,13.55292],[122.67136,13.18584],[122.03465,13.78448],[121.12638,13.63669],[120.62864,13.85766],[120.67938,14.27102],[120.99182,14.52539],[120.69334,14.75667],[120.56415,14.39628],[120.07043,14.97087],[119.92093,15.40635],[119.88377,16.3637],[120.28649,16.03463],[120.39005,17.59908],[120.71587,18.50523],[121.32131,18.50406]]],[[[-65.591,18.22803],[-65.84716,17.97591],[-66.59993,17.98182],[-67.18416,17.94655],[-67.24243,18.37446],[-67.10068,18.5206],[-66.28243,18.51476],[-65.7713,18.42668],[-65.591,18.22803]]],[[[-76.90256,17.86824],[-77.20634,17.70112],[-77.76602,17.8616],[-78.33772,18.22597],[-78.21773,18.45453],[-77.79736,18.52422],[-77.5696,18.49053],[-76.89662,18.40087],[-76.36536,18.1607],[-76.19966,17.88687],[-76.90256,17.86824]]],[[[-72.57967,19.8715],[-71.71236,19.71446],[-71.5873,19.88491],[-70.80671,19.88029],[-70.21436,19.62289],[-69.95082,19.648],[-69.76925,19.29327],[-69.22213,19.31321],[-69.25435,19.0152],[-68.80941,18.97907],[-68.31794,18.6122],[-68.68932,18.20514],[-69.16495,18.42265],[-69.62399,18.38071],[-69.95293,18.42831],[-70.13323,18.24592],[-70.51714,18.18429],[-70.6693,18.42689],[-70.99995,18.28333],[-71.40021,17.59856],[-71.65766,17.75757],[-71.7083,18.045],[-72.37248,18.21496],[-72.84441,18.14561],[-73.45455,18.21791],[-73.92243,18.03099],[-74.45803,18.34255],[-74.36993,18.66491],[-73.44954,18.52605],[-72.69494,18.4458],[-72.33488,18.66842],[-72.79165,19.10163],[-72.7841,19.48359],[-73.41502,19.63955],[-73.18979,19.91568],[-72.57967,19.8715]]],[[[110.33919,18.6784],[109.47521,18.1977],[108.65521,18.50768],[108.62622,19.36789],[109.11906,19.82104],[110.2116,20.10125],[110.78655,20.07753],[111.01005,19.69593],[110.57065,19.25588],[110.33919,18.6784]]],[[[-155.54211,19.08348],[-155.68817,18.91619],[-155.93665,19.05939],[-155.90806,19.33888],[-156.07347,19.70294],[-156.02368,19.81422],[-155.85008,19.97729],[-155.91907,20.17395],[-155.86108,20.26721],[-155.78505,20.2487],[-155.40214,20.07975],[-155.22452,19.99302],[-155.06226,19.8591],[-154.80741,19.50871],[-154.83147,19.45328],[-155.22217,19.23972],[-155.54211,19.08348]]],[[[-156.07926,20.64397],[-156.41445,20.57241],[-156.58673,20.783],[-156.70167,20.8643],[-156.71055,20.92676],[-156.61258,21.01249],[-156.25711,20.91745],[-155.99566,20.76404],[-156.07926,20.64397]]],[[[-156.75824,21.17684],[-156.78933,21.06873],[-157.32521,21.09777],[-157.25027,21.21958],[-156.75824,21.17684]]],[[[-157.65283,21.32217],[-157.70703,21.26442],[-157.7786,21.27729],[-158.12667,21.31244],[-158.2538,21.53919],[-158.29265,21.57912],[-158.0252,21.71696],[-157.94161,21.65272],[-157.65283,21.32217]]],[[[-159.34512,21.982],[-159.46372,21.88299],[-159.80051,22.06533],[-159.74877,22.1382],[-159.5962,22.23618],[-159.36569,22.21494],[-159.34512,21.982]]],[[[-79.67952,22.7653],[-79.28149,22.3992],[-78.34743,22.51217],[-77.9933,22.27719],[-77.14642,21.65785],[-76.52382,21.20682],[-76.19462,21.22057],[-75.59822,21.01662],[-75.67106,20.73509],[-74.9339,20.69391],[-74.17802,20.28463],[-74.29665,20.05038],[-74.96159,19.92344],[-75.63468,19.87377],[-76.32366,19.95289],[-77.75548,19.85548],[-77.08511,20.41335],[-77.49265,20.67311],[-78.13729,20.73995],[-78.48283,21.02861],[-78.71987,21.59811],[-79.285,21.55918],[-80.21748,21.82732],[-80.51753,22.03708],[-81.82094,22.19206],[-82.16999,22.38711],[-81.795,22.63696],[-82.7759,22.68815],[-83.49446,22.16852],[-83.9088,22.15457],[-84.05215,21.91058],[-84.54703,21.80123],[-84.97491,21.89603],[-84.44706,22.20495],[-84.23036,22.56575],[-83.77824,22.78812],[-83.26755,22.98304],[-82.51044,23.07875],[-82.26815,23.18861],[-81.40446,23.11727],[-80.61877,23.10598],[-79.67952,22.7653]]],[[[-77.53466,23.75975],[-77.78,23.71],[-78.03405,24.28615],[-78.40848,24.57564],[-78.19087,25.2103],[-77.89,25.17],[-77.54,24.34],[-77.53466,23.75975]]],[[[121.17563,22.79086],[120.74708,21.97057],[120.22008,22.81486],[120.10619,23.55626],[120.69468,24.53845],[121.49504,25.29546],[121.95124,24.9976],[121.77782,24.39427],[121.17563,22.79086]]],[[[-77.82,26.58],[-78.91,26.42],[-78.98,26.79],[-78.51,26.87],[-77.85,26.84],[-77.82,26.58]]],[[[-77.0,26.59],[-77.17255,25.87918],[-77.35641,26.00735],[-77.34,26.53],[-77.78802,26.92516],[-77.79,27.04],[-77.0,26.59]]],[[[134.63843,34.14923],[134.76638,33.80633],[134.20342,33.20118],[133.79295,33.52199],[133.28027,33.28957],[133.01486,32.70457],[132.36311,32.98938],[132.37118,33.46364],[132.92437,34.0603],[133.49297,33.94462],[133.90411,34.36493],[134.63843,34.14923]]],[[[34.57647,35.6716],[33.9008,35.24576],[33.97362,35.05851],[34.00488,34.9781],[32.97983,34.57187],[32.4903,34.70165],[32.25667,35.10323],[32.73178,35.14003],[32.80247,35.1455],[32.94696,35.3867],[33.66723,35.37322],[34.57647,35.6716]]],[[[23.69998,35.705],[24.24667,35.36802],[25.02502,35.425],[25.76921,35.35402],[25.74502,35.18],[26.29,35.29999],[26.165,35.005],[24.72498,34.91999],[24.73501,35.08499],[23.51498,35.27999],[23.69998,35.705]]],[[[15.52038,38.23116],[15.16024,37.44405],[15.3099,37.13422],[15.09999,36.61999],[14.33523,36.99663],[13.82673,37.10453],[12.431,37.61295],[12.57094,38.12638],[13.74116,38.03497],[14.76125,38.14387],[15.52038,38.23116]]],[[[9.21001,41.20999],[9.80998,40.50001],[9.66952,39.17738],[9.21482,39.24047],[8.80694,38.90662],[8.4283,39.17185],[8.38825,40.37831],[8.16,40.95001],[8.70999,40.89998],[9.21001,41.20999]]],[[[140.97639,37.14207],[140.59977,36.34398],[140.77407,35.84288],[140.25328,35.13811],[138.97553,34.6676],[137.2176,34.60629],[135.79298,33.46481],[135.12098,33.84907],[135.07943,34.59654],[133.34032,34.37594],[132.15677,33.90493],[130.98614,33.88576],[132.00004,33.14999],[131.33279,31.45035],[130.68632,31.02958],[130.20242,31.41824],[130.44768,32.31947],[129.81469,32.61031],[129.40846,33.29606],[130.35394,33.60415],[130.87845,34.23274],[131.88423,34.74971],[132.61767,35.43339],[134.6083,35.73162],[135.67754,35.52713],[136.72383,37.30498],[137.39061,36.82739],[138.8576,37.82748],[139.4264,38.21596],[140.05479,39.43881],[139.88338,40.56331],[140.30578,41.19501],[141.36897,41.37856],[141.91426,39.99162],[141.8846,39.18086],[140.95949,38.174],[140.97639,37.14207]]],[[[9.56002,42.15249],[9.22975,41.38001],[8.77572,41.58361],[8.54421,42.25652],[8.74601,42.62812],[9.39,43.00998],[9.56002,42.15249]]],[[[143.91016,44.1741],[144.61343,43.96088],[145.32083,44.38473],[145.54314,43.26209],[144.05966,42.98836],[143.18385,41.99521],[141.61149,42.67879],[141.06729,41.58459],[139.95511,41.56956],[139.81754,42.56376],[140.31209,43.33327],[141.38055,43.38882],[141.67195,44.77213],[141.96764,45.55148],[143.14287,44.51036],[143.91016,44.1741]]],[[[-63.6645,46.55001],[-62.9393,46.41587],[-62.01208,46.44314],[-62.50391,46.03339],[-62.87433,45.96818],[-64.1428,46.39265],[-64.39261,46.72747],[-64.01486,47.03601],[-63.6645,46.55001]]],[[[-61.8063,49.10506],[-62.29318,49.08717],[-63.58926,49.40069],[-64.51912,49.87304],[-64.17322,49.95718],[-62.85829,49.70641],[-61.83558,49.28855],[-61.8063,49.10506]]],[[[-123.51,48.51001],[-124.01289,48.37085],[-125.65501,48.825],[-125.95499,49.18],[-126.85,49.53],[-127.02999,49.815],[-128.05934,49.99496],[-128.44458,50.53914],[-128.35841,50.77065],[-127.30858,50.55257],[-126.695,50.4009],[-125.75501,50.29502],[-125.415,49.95],[-124.92077,49.47527],[-123.92251,49.06248],[-123.51,48.51001]]],[[[-56.13404,50.68701],[-56.79588,49.81231],[-56.14311,50.15012],[-55.47149,49.93582],[-55.8224,49.58713],[-54.93514,49.31301],[-54.47378,49.55669],[-53.47655,49.24914],[-53.78601,48.51678],[-53.08613,48.6878],[-52.95865,48.15716],[-52.6481,47.53555],[-53.06916,46.6555],[-53.52146,46.61829],[-54.17894,46.80707],[-53.96187,47.62521],[-54.24048,47.75228],[-55.40077,46.88499],[-55.99748,46.91972],[-55.29122,47.38956],[-56.2508,47.63255],[-57.32523,47.57281],[-59.26602,47.60335],[-59.41949,47.89945],[-58.79659,48.25153],[-59.23162,48.52319],[-58.3918,49.12558],[-57.35869,50.71827],[-56.73865,51.28744],[-55.87098,51.63209],[-55.40697,51.58827],[-55.60022,51.31707],[-56.13404,50.68701]]],[[[-132.71001,54.04001],[-132.71001,54.04001],[-132.71001,54.04001],[-132.71001,54.04001],[-131.74999,54.12],[-132.04948,52.98462],[-131.17904,52.18043],[-131.57783,52.18237],[-132.18043,52.63971],[-132.54999,53.10001],[-133.05461,53.41147],[-133.23966,53.85108],[-133.18,54.16998],[-132.71001,54.04001]]],[[[143.64801,50.7476],[144.65415,48.97639],[143.17393,49.30655],[142.55867,47.86158],[143.53349,46.83673],[143.50528,46.13791],[142.7477,46.74076],[142.09203,45.96676],[141.90693,46.80593],[142.01844,47.78013],[141.90444,48.85919],[142.1358,49.61516],[142.17998,50.95234],[141.59408,51.93543],[141.68255,53.30197],[142.60693,53.76215],[142.20975,54.22548],[142.65479,54.36588],[142.91462,53.70458],[143.26085,52.74076],[143.23527,51.75666],[143.64801,50.7476]]],[[[-6.78886,52.26012],[-8.56162,51.6693],[-9.97709,51.82045],[-9.16628,52.86463],[-9.68852,53.88136],[-8.32799,54.66452],[-7.57217,55.13162],[-6.73385,55.17286],[-5.66195,54.5546],[-6.19788,53.86757],[-6.03299,53.15316],[-6.78886,52.26012]]],[[[12.69001,55.60999],[12.08999,54.80001],[11.04354,55.36486],[10.90391,55.77995],[12.3709,56.11141],[12.69001,55.60999]]],[[[-153.00631,57.11584],[-154.00509,56.73468],[-154.5164,56.99275],[-154.67099,57.4612],[-153.76278,57.81657],[-153.22873,57.96897],[-152.56479,57.90143],[-152.14115,57.59106],[-153.00631,57.11584]]],[[[-3.005,58.635],[-4.07383,57.55302],[-3.055,57.69002],[-1.95928,57.6848],[-2.21999,56.87002],[-3.119,55.97379],[-2.08501,55.91],[-1.11499,54.62499],[-0.43048,54.46438],[0.18498,53.32501],[0.46998,52.93],[1.68153,52.73952],[1.55999,52.1],[1.05056,51.80676],[1.44987,51.28943],[0.55033,50.76574],[-0.78752,50.77499],[-2.49,50.50002],[-2.95627,50.69688],[-3.61745,50.22836],[-4.54251,50.34184],[-5.24502,49.96],[-5.77657,50.15968],[-4.30999,51.21],[-3.41485,51.42601],[-4.98437,51.59347],[-5.2673,51.9914],[-4.22235,52.30136],[-4.77001,52.84],[-4.58,53.495],[-3.09208,53.40444],[-2.94501,53.985],[-3.63001,54.61501],[-4.84417,54.79097],[-5.08253,55.0616],[-4.71911,55.50847],[-5.04798,55.78399],[-5.5864,55.31115],[-5.645,56.27501],[-6.14998,56.78501],[-5.78682,57.81885],[-5.01,58.63001],[-4.21149,58.55085],[-3.005,58.635]]],[[[-165.57916,59.90999],[-166.19277,59.75444],[-166.84834,59.94141],[-167.45528,60.21307],[-166.46779,60.38417],[-165.67443,60.29361],[-165.57916,59.90999]]],[[[-79.26582,62.15867],[-79.65752,61.63308],[-80.09956,61.7181],[-80.36215,62.01649],[-80.3154,62.08557],[-79.92939,62.3856],[-79.52002,62.36371],[-79.26582,62.15867]]],[[[-81.89825,62.7108],[-83.06857,62.15922],[-83.77462,62.18231],[-83.99367,62.4528],[-83.25048,62.91409],[-81.87699,62.90458],[-81.89825,62.7108]]],[[[-171.73166,63.78252],[-171.11443,63.59219],[-170.49111,63.69498],[-169.68251,63.43112],[-168.68944,63.29751],[-168.77194,63.1886],[-169.52944,62.97693],[-170.29056,63.19444],[-170.67139,63.37582],[-171.55306,63.31779],[-171.79111,63.40585],[-171.73166,63.78252]]],[[[-85.16131,65.65728],[-84.97576,65.21752],[-84.46401,65.37177],[-83.88263,65.10962],[-82.78758,64.76669],[-81.64201,64.45514],[-81.55344,63.97961],[-80.81736,64.05749],[-80.10345,63.72598],[-80.99102,63.41125],[-82.54718,63.65172],[-83.1088,64.10188],[-84.10042,63.56971],[-85.5234,63.05238],[-85.86677,63.63725],[-87.22198,63.54124],[-86.35276,64.03583],[-86.22489,64.82292],[-85.88385,65.73878],[-85.16131,65.65728]]],[[[-14.5087,66.45589],[-14.73964,65.80875],[-13.60973,65.12667],[-14.90983,64.36408],[-17.79444,63.67875],[-18.65625,63.49638],[-19.97275,63.64363],[-22.76297,63.96018],[-21.77848,64.40212],[-23.95504,64.89113],[-22.1844,65.08497],[-22.22742,65.37859],[-24.32618,65.61119],[-23.65051,66.26252],[-22.13492,66.41047],[-20.57628,65.73211],[-19.05684,66.2766],[-17.79862,65.99385],[-16.16782,66.52679],[-14.5087,66.45589]]],[[[-75.86588,67.14886],[-76.98687,67.09873],[-77.2364,67.58809],[-76.81166,68.14856],[-75.89521,68.28721],[-75.1145,68.01036],[-75.10333,67.58202],[-75.21597,67.44425],[-75.86588,67.14886]]],[[[-175.01425,66.58435],[-174.33983,66.33556],[-174.57182,67.06219],[-171.85731,66.91308],[-169.89958,65.97724],[-170.89107,65.54139],[-172.53025,65.43791],[-172.555,64.46079],[-172.95533,64.25269],[-173.89184,64.2826],[-174.65392,64.63125],[-175.98353,64.92288],[-176.20716,65.35667],[-177.22266,65.52024],[-178.35993,65.39052],[-178.90332,65.74044],[-178.68611,66.11211],[-179.88377,65.87456],[-179.43268,65.40411],[-180.0,64.97971],[-180.0,68.96364],[-177.55,68.2],[-174.92825,67.20589],[-175.01425,66.58435]]],[[[-95.64768,69.10769],[-96.26952,68.75704],[-97.6174,69.06003],[-98.4318,68.9507],[-99.7974,69.40003],[-98.9174,69.71003],[-98.21826,70.14354],[-97.1574,69.86003],[-96.5574,69.68003],[-96.2574,69.49003],[-95.64768,69.10769]]],[[[180.0,70.8322],[178.90343,70.78114],[178.7253,71.0988],[180.0,71.51571],[180.0,70.8322]]],[[[-178.69378,70.89302],[-180.0,70.8322],[-180.0,71.51571],[-179.87187,71.55762],[-179.02433,71.55553],[-177.57794,71.26948],[-177.66358,71.13277],[-178.69378,70.89302]]],[[[-90.54712,69.49768],[-90.55151,68.4751],[-89.21509,69.25873],[-88.01959,68.61511],[-88.3175,67.87347],[-87.3501,67.19873],[-86.30609,67.92151],[-85.5766,68.78448],[-85.52191,69.88208],[-84.10077,69.80548],[-82.6225,69.65833],[-81.2804,69.16211],[-81.22021,68.66571],[-81.96429,68.13251],[-81.25928,67.59729],[-81.38647,67.1109],[-83.34448,66.41168],[-84.73541,66.25732],[-85.76941,66.55829],[-86.06763,66.05627],[-87.03137,65.21307],[-87.32318,64.7757],[-88.48291,64.09912],[-89.91443,64.03271],[-90.70398,63.61029],[-90.77002,62.96033],[-91.93341,62.83508],[-93.15698,62.02472],[-94.24152,60.89868],[-94.62927,60.11029],[-94.68451,58.94891],[-93.21503,58.7821],[-92.76459,57.8457],[-92.297,57.0871],[-90.89771,57.28473],[-89.03949,56.85168],[-88.03979,56.47168],[-87.32422,55.99908],[-86.07123,55.72388],[-85.01178,55.30267],[-83.36047,55.24487],[-82.27283,55.14832],[-82.43622,54.28229],[-82.125,53.2771],[-81.4007,52.1579],[-79.9129,51.2085],[-79.14301,51.53387],[-78.60193,52.56207],[-79.12421,54.14148],[-79.82959,54.66772],[-78.2287,55.13647],[-77.09558,55.83752],[-76.54138,56.5343],[-76.62311,57.2027],[-77.30219,58.05212],[-78.51691,58.80469],[-77.33667,59.85272],[-77.77271,60.75787],[-78.10681,62.3197],[-77.41058,62.55048],[-75.69623,62.2785],[-74.66821,62.18109],[-73.8399,62.44391],[-72.90851,62.1051],[-71.677,61.52533],[-71.37372,61.13708],[-69.59039,61.06152],[-69.6203,60.22131],[-69.2879,58.95728],[-68.37451,58.80109],[-67.64978,58.2121],[-66.20178,58.76727],[-65.24518,59.87073],[-64.5835,60.33569],[-63.80469,59.44269],[-62.50238,58.16711],[-61.39648,56.96753],[-61.79858,56.33948],[-60.46851,55.77551],[-59.56958,55.2041],[-57.9751,54.9455],[-57.33319,54.62653],[-56.93689,53.78027],[-56.15808,53.64752],[-55.75629,53.27051],[-55.68329,52.14673],[-56.40918,51.77069],[-57.12689,51.41968],[-58.77478,51.06427],[-60.03308,50.24292],[-61.72357,50.08051],[-63.86249,50.29108],[-65.36328,50.29828],[-66.39899,50.22888],[-67.23633,49.51147],[-68.51111,49.06848],[-69.95361,47.74487],[-71.10449,46.82172],[-70.25519,46.98608],[-68.65002,48.30011],[-66.55243,49.13312],[-65.05621,49.23291],[-64.17102,48.74249],[-65.11548,48.07092],[-64.79852,46.9931],[-64.47211,46.23853],[-63.17328,45.73907],[-61.52069,45.88391],[-60.51813,47.00787],[-60.44861,46.28271],[-59.8028,45.92047],[-61.03979,45.26532],[-63.2547,44.67029],[-64.24658,44.2655],[-65.36407,43.54529],[-66.12341,43.61871],[-66.16168,44.46509],[-64.42548,45.29211],[-66.026,45.25928],[-67.13739,45.13751],[-66.9646,44.80969],[-68.03247,44.32532],[-69.06,43.9801],[-70.11609,43.68408],[-70.69,43.03009],[-70.81488,42.8653],[-70.82501,42.33508],[-70.495,41.80511],[-70.08002,41.78009],[-70.185,42.14508],[-69.88489,41.92291],[-69.96503,41.63708],[-70.64001,41.4751],[-71.1203,41.49451],[-71.85999,41.32013],[-72.29498,41.27008],[-72.8764,41.2207],[-73.71002,40.93109],[-72.24121,41.11951],[-71.94501,40.93011],[-73.34491,40.63013],[-73.98199,40.62811],[-73.95227,40.75067],[-74.25671,40.47351],[-73.9624,40.42767],[-74.17841,39.70929],[-74.90601,38.93951],[-74.98041,39.19647],[-75.20001,39.24847],[-75.52808,39.49847],[-75.32001,38.96008],[-75.0835,38.78131],[-75.0567,38.40411],[-75.37738,38.0155],[-75.94019,37.21692],[-76.03119,37.25671],[-75.72198,37.93707],[-76.23279,38.31927],[-76.34998,39.15009],[-76.54272,38.71771],[-76.32928,38.08331],[-76.96002,38.23291],[-76.30157,37.91809],[-76.25873,36.96649],[-75.9718,36.89728],[-75.86798,36.55133],[-75.72748,35.55072],[-76.3631,34.80847],[-77.39758,34.51208],[-78.05487,33.92548],[-78.55432,33.86133],[-79.06061,33.49408],[-79.20349,33.15851],[-80.30127,32.50928],[-80.86499,32.03333],[-81.3363,31.44049],[-81.49042,30.7301],[-81.31372,30.03552],[-80.97998,29.18011],[-80.53558,28.47211],[-80.53003,28.0401],[-80.05652,26.88013],[-80.08801,26.20569],[-80.13147,25.81689],[-80.38098,25.2063],[-80.67999,25.08008],[-81.17212,25.20129],[-81.33002,25.64008],[-81.71002,25.87012],[-82.23999,26.7301],[-82.70508,27.49512],[-82.85529,27.88629],[-82.65002,28.55011],[-82.92999,29.1001],[-83.70959,29.93671],[-84.09998,30.09009],[-85.10883,29.63629],[-85.28778,29.6861],[-85.77301,30.15271],[-86.40002,30.40009],[-87.53027,30.27448],[-88.41779,30.38489],[-89.18048,30.3161],[-89.60492,30.17633],[-89.4137,29.89429],[-89.42999,29.48871],[-89.21759,29.29108],[-89.4082,29.15973],[-89.7793,29.30713],[-90.1546,29.11749],[-90.88019,29.14868],[-91.62671,29.67712],[-92.49908,29.55231],[-93.22638,29.78387],[-93.84839,29.71368],[-94.69,29.4801],[-95.60028,28.73871],[-96.59399,28.3075],[-97.14001,27.83008],[-97.37,27.38013],[-97.38,26.69012],[-97.33002,26.21008],[-97.1402,25.86951],[-97.13861,25.86792],[-97.14178,25.86591],[-97.52808,24.99213],[-97.70288,24.27228],[-97.776,22.93268],[-97.87238,22.44427],[-97.69897,21.89868],[-97.38898,21.41107],[-97.18927,20.6355],[-96.52551,19.89093],[-96.29211,19.3205],[-95.90088,18.82813],[-94.83899,18.56268],[-94.42572,18.14429],[-93.54858,18.42389],[-92.78607,18.5249],[-92.03729,18.70471],[-91.4079,18.8761],[-90.77179,19.28412],[-90.53351,19.86749],[-90.45148,20.70752],[-90.27863,20.99988],[-89.60132,21.26172],[-88.54388,21.49371],[-87.65839,21.45892],[-87.05188,21.54352],[-86.81201,21.33148],[-86.84589,20.84991],[-87.3833,20.25549],[-87.62097,19.64648],[-87.43671,19.47247],[-87.58649,19.0401],[-87.83722,18.25989],[-88.09058,18.51672],[-88.29999,18.50012],[-88.29633,18.35327],[-88.10681,18.34869],[-88.12341,18.07672],[-88.28528,17.64429],[-88.19788,17.4895],[-88.30261,17.13171],[-88.2395,17.03607],[-88.35541,16.53088],[-88.55182,16.2655],[-88.73242,16.2337],[-88.9306,15.88733],[-88.60461,15.70648],[-88.51831,15.85553],[-88.22498,15.72772],[-88.12109,15.68872],[-87.90179,15.8645],[-87.6156,15.87891],[-87.52289,15.7973],[-87.36768,15.84692],[-86.9032,15.75671],[-86.44092,15.7829],[-86.1192,15.89349],[-86.00189,16.00549],[-85.68329,15.95367],[-85.44397,15.88568],[-85.18237,15.9093],[-84.9837,15.99591],[-84.52698,15.8573],[-84.36823,15.83508],[-84.06299,15.64832],[-83.77399,15.42407],[-83.4104,15.27087],[-83.14722,14.99591],[-83.23322,14.8999],[-83.28418,14.6767],[-83.18213,14.31073],[-83.41248,13.97009],[-83.51978,13.56769],[-83.55219,13.12708],[-83.49847,12.86932],[-83.47333,12.41913],[-83.6261,12.32092],[-83.7196,11.89313],[-83.65088,11.62909],[-83.85541,11.37329],[-83.8089,11.10309],[-83.65558,10.9389],[-83.40228,10.39551],[-83.01569,9.9931],[-82.5462,9.56628],[-82.18707,9.20752],[-82.20758,8.99573],[-81.80859,8.95068],[-81.71411,9.0321],[-81.43921,8.78632],[-80.94733,8.85852],[-80.52191,9.11108],[-79.91461,9.31268],[-79.5733,9.61169],[-79.02118,9.55292],[-79.05841,9.45471],[-78.50092,9.42047],[-78.05591,9.24768],[-77.72949,8.9469],[-77.35327,8.67047],[-76.83661,8.63867],[-76.0863,9.33691],[-75.67462,9.4433],[-75.66467,9.77411],[-75.48041,10.61908],[-74.90692,11.08313],[-74.27667,11.10211],[-74.1972,11.31049],[-73.41467,11.22711],[-72.62781,11.73212],[-72.23822,11.95569],[-71.75409,12.43732],[-71.39978,12.3761],[-71.13739,12.1131],[-71.3316,11.77631],[-71.35999,11.5401],[-71.94702,11.42328],[-71.62079,10.96948],[-71.633,10.44647],[-72.0741,9.86572],[-71.69562,9.07233],[-71.26459,9.13733],[-71.03998,9.86011],[-71.3501,10.21191],[-71.40057,10.96912],[-70.15521,11.37549],[-70.29382,11.84692],[-69.94318,12.16229],[-69.58429,11.45972],[-68.883,11.44348],[-68.23328,10.88568],[-68.19409,10.55469],[-67.2962,10.5459],[-66.22778,10.64868],[-65.65521,10.20093],[-64.89038,10.07727],[-64.32941,10.38971],[-64.31799,10.64148],[-63.07928,10.70172],[-61.88092,10.7157],[-62.7301,10.42029],[-62.38849,9.9483],[-61.58868,9.87311],[-60.83051,9.38129],[-60.6712,8.58032],[-60.15009,8.60291],[-59.7583,8.36713],[-59.10168,7.99933],[-58.48291,7.34772],[-58.4549,6.83289],[-58.07813,6.80908],[-57.54218,6.32129],[-57.1474,5.97308],[-55.94928,5.77289],[-55.8418,5.95312],[-55.0332,6.02533],[-53.95801,5.75653],[-53.61841,5.64648],[-52.88208,5.40991],[-51.8233,4.56592],[-51.65778,4.15631],[-51.31708,4.20349],[-51.0697,3.65051],[-50.50879,1.90149],[-49.974,1.73651],[-49.94708,1.04633],[-50.69928,0.22308],[-50.38818,-0.07837],[-48.62048,-0.23541],[-48.58441,-1.23779],[-47.82489,-0.5816],[-46.56659,-0.94098],[-44.9057,-1.5517],[-44.4176,-2.1377],[-44.5816,-2.69128],[-43.4187,-2.38312],[-41.4726,-2.91199],[-39.97858,-2.87299],[-38.50031,-3.70062],[-37.22321,-4.82092],[-36.45288,-5.10937],[-35.59778,-5.14948],[-35.23541,-5.4649],[-34.896,-6.73822],[-34.72998,-7.3432],[-35.12817,-8.9964],[-35.6369,-9.64929],[-37.04651,-11.04071],[-37.68359,-12.1712],[-38.42389,-13.03809],[-38.67389,-13.05768],[-38.95319,-13.7934],[-38.88232,-15.66699],[-39.16101,-17.20837],[-39.26727,-17.86768],[-39.5835,-18.26221],[-39.7608,-19.59912],[-40.77472,-20.90448],[-40.9447,-21.93732],[-41.75409,-22.37061],[-41.98828,-22.97009],[-43.07471,-22.96771],[-44.64783,-23.35199],[-45.35211,-23.79681],[-46.47211,-24.08899],[-47.64899,-24.88519],[-48.49548,-25.87701],[-48.64099,-26.62372],[-48.47467,-27.1759],[-48.6615,-28.1861],[-48.88843,-28.67407],[-49.58728,-29.22449],[-50.6969,-30.98437],[-51.57617,-31.77771],[-52.2561,-32.2453],[-52.7121,-33.19659],[-53.3736,-33.76831],[-53.8064,-34.39679],[-54.93579,-34.95258],[-55.67401,-34.75269],[-56.21521,-34.8598],[-57.13971,-34.43048],[-57.81781,-34.46252],[-58.427,-33.90948],[-58.49542,-34.43152],[-57.22577,-35.28802],[-57.3623,-35.97742],[-56.73749,-36.41309],[-56.78821,-36.90149],[-57.74908,-38.1839],[-59.23181,-38.72021],[-61.23743,-38.92841],[-62.33588,-38.8277],[-62.12579,-39.42407],[-62.33051,-40.17261],[-62.146,-40.67688],[-62.74579,-41.02869],[-63.77051,-41.16681],[-64.73212,-40.80261],[-65.11798,-41.06427],[-64.97858,-42.05798],[-64.30341,-42.35901],[-63.75592,-42.0437],[-63.45801,-42.56311],[-64.37878,-42.87347],[-65.18182,-43.4953],[-65.3288,-44.50128],[-65.56519,-45.0368],[-66.50989,-45.03961],[-67.29382,-45.55188],[-67.58051,-46.3017],[-66.59698,-47.03387],[-65.64099,-47.23608],[-65.98511,-48.1333],[-67.1662,-48.69733],[-67.8161,-49.86969],[-68.7287,-50.26422],[-69.13849,-50.73248],[-68.81549,-51.77112],[-68.15002,-52.34998],[-68.57147,-52.29938],[-69.4613,-52.29187],[-69.94269,-52.5379],[-70.84509,-52.89917],[-71.00629,-53.83319],[-71.42981,-53.85638],[-72.55792,-53.53137],[-73.7027,-52.83508],[-74.94678,-52.2627],[-75.26001,-51.62927],[-74.97662,-51.0434],[-75.47968,-50.3783],[-75.60797,-48.67371],[-75.18268,-47.71191],[-74.12659,-46.93921],[-75.64441,-46.64758],[-74.69208,-45.76398],[-74.35168,-44.10303],[-73.2403,-44.4549],[-72.71771,-42.3833],[-73.38892,-42.11749],[-73.70129,-43.36578],[-74.33191,-43.22498],[-74.01788,-41.7948],[-73.67712,-39.9422],[-73.21759,-39.25861],[-73.50549,-38.2829],[-73.58801,-37.15631],[-73.16669,-37.12378],[-72.5531,-35.50879],[-71.86169,-33.90912],[-71.43848,-32.41888],[-71.6687,-30.92059],[-71.37,-30.0957],[-71.48981,-28.86139],[-70.90509,-27.64038],[-70.72498,-25.70587],[-70.40399,-23.62891],[-70.09119,-21.39331],[-70.16443,-19.75641],[-70.3725,-18.3479],[-71.37518,-17.7738],[-71.46198,-17.3634],[-73.44452,-16.35937],[-75.23779,-15.26569],[-76.00922,-14.64929],[-76.4234,-13.82318],[-76.25922,-13.53497],[-77.1062,-12.22272],[-78.0921,-10.37769],[-79.03693,-8.3866],[-79.44592,-7.93079],[-79.7605,-7.19427],[-80.53748,-6.54169],[-81.25,-6.13678],[-80.92627,-5.69049],[-81.41089,-4.73669],[-81.09961,-4.03638],[-80.30249,-3.40479],[-79.7702,-2.65747],[-79.98651,-2.2207],[-80.36871,-2.68518],[-80.96771,-2.24689],[-80.76477,-1.96503],[-80.93359,-1.05737],[-80.58331,-0.90668],[-80.39929,-0.28369],[-80.02081,0.36047],[-80.09058,0.76849],[-79.54279,0.98291],[-78.85529,1.38092],[-78.99091,1.69128],[-78.6178,1.76648],[-78.66211,2.26727],[-78.42761,2.6297],[-77.93152,2.69672],[-77.51038,3.32507],[-77.12769,3.84967],[-77.49628,4.08771],[-77.30762,4.66809],[-77.5332,5.58289],[-77.31879,5.84528],[-77.47668,6.6911],[-77.88159,7.22388],[-78.2149,7.51233],[-78.42908,8.05212],[-78.18201,8.31927],[-78.43549,8.3877],[-78.62207,8.71808],[-79.1203,8.99609],[-79.5578,8.9325],[-79.7605,8.58447],[-80.16449,8.33331],[-80.38263,8.29852],[-80.48071,8.09027],[-80.0036,7.54749],[-80.27661,7.41968],[-80.42108,7.27148],[-80.88641,7.22052],[-81.05951,7.81787],[-81.1897,7.64789],[-81.51947,7.70673],[-81.72131,8.10889],[-82.13141,8.17548],[-82.39087,8.29248],[-82.82001,8.29089],[-82.85089,8.07391],[-82.9657,8.2251],[-83.50842,8.4469],[-83.71149,8.65692],[-83.59631,8.83051],[-83.63263,9.05151],[-83.90991,9.29089],[-84.30341,9.48749],[-84.64758,9.61548],[-84.71338,9.90808],[-84.97559,10.08673],[-84.91138,9.79608],[-85.1109,9.55713],[-85.33948,9.83447],[-85.66071,9.93329],[-85.79742,10.13489],[-85.79169,10.43927],[-85.6593,10.75427],[-85.94171,10.89532],[-85.71252,11.0885],[-86.05841,11.4035],[-86.52588,11.80688],[-86.74591,12.1441],[-87.16748,12.45831],[-87.66852,12.90991],[-87.5575,13.0647],[-87.3924,12.91412],[-87.31659,12.98468],[-87.48938,13.29749],[-87.79309,13.38452],[-87.90411,13.14911],[-88.48328,13.16388],[-88.8432,13.2597],[-89.25671,13.45868],[-89.81238,13.52069],[-90.09558,13.73547],[-90.60858,13.90991],[-91.23242,13.92792],[-91.6897,14.12628],[-92.22772,14.53888],[-93.35937,15.61548],[-93.87518,15.94031],[-94.69159,16.20111],[-95.25018,16.1283],[-96.05341,15.75208],[-96.55737,15.6535],[-97.26361,15.91711],[-98.013,16.1073],[-98.94769,16.5661],[-99.69739,16.7063],[-100.82953,17.17108],[-101.66608,17.64911],[-101.91852,17.91608],[-102.47809,17.97589],[-103.50098,18.2923],[-103.91748,18.74872],[-104.992,19.31628],[-105.49298,19.9469],[-105.73138,20.43408],[-105.39771,20.53168],[-105.50061,20.81689],[-105.27069,21.07629],[-105.26581,21.42212],[-105.60309,21.87128],[-105.69342,22.2691],[-106.02869,22.77368],[-106.90991,23.76788],[-107.91541,24.54889],[-108.40192,25.1723],[-109.26019,25.58069],[-109.44409,25.82489],[-109.29163,26.44287],[-109.80139,26.67609],[-110.39172,27.16211],[-110.64099,27.85992],[-111.17889,27.94128],[-111.75958,28.46808],[-112.22821,28.95453],[-112.27179,29.26691],[-112.80951,30.02112],[-113.16382,30.78693],[-113.14868,31.17108],[-113.87189,31.56769],[-114.20569,31.52411],[-114.77643,31.79968],[-114.93671,31.39349],[-114.77118,30.9137],[-114.67389,30.16272],[-114.33099,29.75049],[-113.58881,29.06171],[-113.42401,28.82629],[-113.27191,28.75488],[-113.14001,28.41132],[-112.96228,28.42529],[-112.7616,27.78027],[-112.45789,27.52588],[-112.24487,27.17188],[-111.61652,26.6629],[-111.28461,25.73273],[-110.98779,25.29468],[-110.71002,24.82611],[-110.65503,24.29871],[-110.17279,24.26569],[-109.77179,23.81128],[-109.40912,23.36469],[-109.43341,23.18573],[-109.85419,22.8183],[-110.03131,22.82312],[-110.29498,23.43109],[-110.94952,24.0011],[-111.67059,24.4845],[-112.18201,24.73853],[-112.14899,25.47028],[-112.30072,26.01208],[-112.77728,26.32208],[-113.4646,26.76831],[-113.59668,26.63953],[-113.84888,26.90009],[-114.4657,27.14209],[-115.05511,27.72272],[-114.98218,27.79828],[-114.57031,27.74152],[-114.19928,28.11511],[-114.16199,28.5661],[-114.93182,29.27948],[-115.51868,29.55627],[-115.88739,30.18091],[-116.2583,30.83649],[-116.7215,31.63568],[-117.12769,32.53528],[-117.2959,33.04633],[-117.94391,33.62128],[-118.41058,33.74091],[-118.5199,34.02789],[-119.08099,34.07812],[-119.43878,34.34851],[-120.3678,34.44708],[-120.6228,34.60852],[-120.74432,35.15692],[-121.7146,36.16168],[-122.54749,37.55188],[-122.51202,37.78351],[-122.95319,38.11371],[-123.72711,38.95172],[-123.86511,39.76709],[-124.39801,40.31329],[-124.17877,41.14209],[-124.21368,41.99969],[-124.53278,42.76611],[-124.14209,43.7085],[-123.89893,45.5235],[-124.07959,46.86469],[-124.39569,47.72028],[-124.68719,48.18451],[-124.5661,48.3797],[-123.12,48.0401],[-122.58728,47.09613],[-122.34003,47.36011],[-122.5,48.18011],[-122.84003,49.00012],[-122.97418,49.00269],[-124.91022,49.98468],[-125.62457,50.41669],[-127.43561,50.83069],[-127.99268,51.71588],[-127.85028,52.32971],[-129.1297,52.75549],[-129.30518,53.56171],[-130.51489,54.28772],[-130.53607,54.80267],[-131.08582,55.17889],[-131.96722,55.49792],[-132.25,56.37012],[-133.53918,57.17889],[-134.078,58.12311],[-135.03821,58.18768],[-136.62799,58.21228],[-137.79999,58.50012],[-139.8678,59.5379],[-140.8252,59.72748],[-142.5744,60.08447],[-143.9588,59.99933],[-145.92548,60.45868],[-147.11438,60.8847],[-148.2243,60.6731],[-148.01801,59.97827],[-148.5708,59.91431],[-149.72778,59.70569],[-150.60822,59.36829],[-151.71631,59.15588],[-151.85938,59.74512],[-151.40973,60.72589],[-150.34692,61.03369],[-150.62109,61.28448],[-151.89581,60.72729],[-152.57831,60.06171],[-154.0191,59.35028],[-153.28748,58.86469],[-154.23248,58.14648],[-155.3075,57.72791],[-156.30829,57.42291],[-156.55609,56.9801],[-158.11719,56.46368],[-158.43329,55.99408],[-159.60327,55.56671],[-160.28967,55.64368],[-161.22302,55.36469],[-162.23779,55.02429],[-163.0694,54.68988],[-164.78558,54.4043],[-164.9422,54.57233],[-163.84833,55.03949],[-162.87,55.34808],[-161.8042,55.89508],[-160.5636,56.00812],[-160.0705,56.41809],[-158.68439,57.01672],[-158.46112,57.21692],[-157.72278,57.57013],[-157.55029,58.32831],[-157.04169,58.91888],[-158.1947,58.61591],[-158.51721,58.7879],[-159.05859,58.42432],[-159.71161,58.93152],[-159.9812,58.57269],[-160.35529,59.07111],[-161.35498,58.6709],[-161.96881,58.67169],[-162.05499,59.26691],[-161.87408,59.63373],[-162.51801,59.98969],[-163.8183,59.7981],[-164.66217,60.26752],[-165.34637,60.50751],[-165.35077,61.07391],[-166.1214,61.50012],[-165.73437,62.07507],[-164.91919,62.63312],[-164.5625,63.14648],[-163.7533,63.21948],[-163.0672,63.05951],[-162.2605,63.54187],[-161.53442,63.45587],[-160.77252,63.76611],[-160.95831,64.2229],[-161.51801,64.40289],[-160.77771,64.7887],[-161.39191,64.77728],[-162.453,64.55951],[-162.75781,64.33868],[-163.54639,64.55908],[-164.96082,64.44708],[-166.42529,64.68671],[-166.84497,65.08893],[-168.11047,65.6701],[-166.7052,66.08832],[-164.47467,66.57672],[-163.65253,66.57672],[-163.78851,66.07727],[-161.6778,66.11609],[-162.48969,66.73547],[-163.71973,67.11652],[-164.43091,67.61627],[-165.3902,68.04291],[-166.7644,68.35889],[-166.20471,68.88312],[-164.43079,68.91553],[-163.16858,69.37109],[-162.93048,69.85809],[-161.90887,70.33331],[-160.93481,70.44769],[-159.03918,70.89172],[-158.11969,70.82471],[-156.58081,71.35791],[-155.06781,71.14789],[-154.34418,70.69647],[-153.90002,70.89008],[-152.21002,70.83008],[-152.27002,70.6001],[-150.73999,70.43011],[-149.71997,70.53009],[-147.61328,70.21411],[-145.69,70.12012],[-144.91998,69.99011],[-143.58942,70.15253],[-142.07251,69.85193],[-140.9859,69.7121],[-139.12048,69.47113],[-137.54639,68.99011],[-136.5036,68.89807],[-135.62567,69.31512],[-134.41461,69.6275],[-132.9292,69.50531],[-131.43127,69.94452],[-129.79468,70.19373],[-129.10773,69.7793],[-128.36151,70.01288],[-128.13818,70.48389],[-127.44708,70.37732],[-125.75629,69.48071],[-124.4248,70.15851],[-124.28961,69.39972],[-123.0611,69.56372],[-122.68341,69.85553],[-121.47229,69.79791],[-119.94281,69.37793],[-117.6026,69.01129],[-116.22638,68.84149],[-115.24689,68.90588],[-113.89789,68.39893],[-115.30481,67.90271],[-113.49719,67.68829],[-110.79791,67.80609],[-109.94611,67.98108],[-108.88019,67.38153],[-107.79242,67.88751],[-108.81299,68.31171],[-108.16718,68.65393],[-106.95001,68.70007],[-106.15002,68.80011],[-105.34277,68.56128],[-104.33789,68.01813],[-103.22107,68.0979],[-101.45428,67.64691],[-99.90198,67.80573],[-98.44318,67.78168],[-98.55859,68.40393],[-97.66949,68.57867],[-96.11987,68.2395],[-96.12579,67.29352],[-95.48938,68.0907],[-94.685,68.0639],[-94.23279,69.06909],[-95.30408,69.68573],[-96.47131,70.0899],[-96.39111,71.19489],[-95.2088,71.92047],[-93.88989,71.76007],[-92.87811,71.31873],[-91.51959,70.19128],[-92.40692,69.70007],[-90.54712,69.49768]]],[[[-114.16717,73.12145],[-114.66634,72.65277],[-112.44102,72.9554],[-111.05039,72.4504],[-109.92035,72.96113],[-109.00654,72.63335],[-108.18835,71.65089],[-107.68599,72.06548],[-108.39639,73.08953],[-107.51645,73.23598],[-106.52259,73.07601],[-105.40246,72.67259],[-104.77484,71.6984],[-104.46476,70.99297],[-102.78537,70.49776],[-100.98078,70.02432],[-101.08929,69.58447],[-102.73116,69.50402],[-102.09329,69.11962],[-102.43024,68.75282],[-104.24,68.91],[-105.96,69.18],[-107.12254,69.11922],[-109.0,68.78],[-111.9668,68.60446],[-113.3132,68.53554],[-113.85496,69.00744],[-115.22,69.28],[-116.10794,69.16821],[-117.34,69.96],[-116.67473,70.06655],[-115.13112,70.2373],[-113.72141,70.19237],[-112.4161,70.36638],[-114.35,70.6],[-116.48684,70.52045],[-117.9048,70.54056],[-118.43238,70.9092],[-116.11311,71.30918],[-117.65568,71.2952],[-119.40199,71.55859],[-118.56267,72.30785],[-117.86642,72.70594],[-115.18909,73.31459],[-114.16717,73.12145]]],[[[-104.5,73.42],[-105.38,72.76],[-106.94,73.46],[-106.6,73.6],[-105.26,73.64],[-104.5,73.42]]],[[[-76.34,73.10268],[-76.2514,72.82639],[-77.31444,72.85555],[-78.39167,72.87666],[-79.48625,72.7422],[-79.77583,72.8029],[-80.8761,73.33318],[-80.83389,73.69318],[-80.35306,73.75972],[-78.06444,73.65193],[-76.34,73.10268]]],[[[-86.56218,73.15745],[-85.77437,72.53413],[-84.85011,73.34028],[-82.31559,73.75095],[-80.60009,72.71654],[-80.74894,72.06191],[-78.77064,72.35217],[-77.82462,72.74962],[-75.60584,72.24368],[-74.22862,71.76714],[-74.09914,71.33084],[-72.24223,71.55692],[-71.20002,70.92001],[-68.78605,70.52502],[-67.91497,70.12195],[-66.96903,69.18609],[-68.80512,68.7202],[-66.44987,68.06716],[-64.86231,67.84754],[-63.42493,66.92847],[-61.85198,66.86212],[-62.16318,66.16025],[-63.91844,64.99867],[-65.14886,65.42603],[-66.72122,66.38804],[-68.01502,66.26273],[-68.14129,65.68979],[-67.08965,65.10846],[-65.73208,64.64841],[-65.32017,64.38274],[-64.66941,63.39293],[-65.0138,62.67419],[-66.27504,62.9451],[-68.78319,63.74567],[-67.36968,62.88397],[-66.3283,62.28007],[-66.16557,61.9309],[-68.87737,62.33015],[-71.02344,62.91071],[-72.23538,63.39784],[-71.88628,63.67999],[-73.37831,64.19396],[-74.83442,64.67908],[-74.8185,64.38909],[-77.70998,64.22954],[-78.55595,64.57291],[-77.89728,65.30919],[-76.01827,65.32697],[-73.9598,65.45476],[-74.29388,65.81177],[-73.94491,66.31058],[-72.65117,67.28458],[-72.92606,67.72693],[-73.31162,68.06944],[-74.84331,68.55463],[-76.8691,68.89474],[-76.22865,69.14777],[-77.28737,69.76954],[-78.16863,69.82649],[-78.95724,70.16688],[-79.49246,69.87181],[-81.30547,69.74319],[-84.94471,69.96663],[-87.06,70.26],[-88.68171,70.41074],[-89.51342,70.76204],[-88.46772,71.21819],[-89.88815,71.22255],[-90.20516,72.23507],[-89.43658,73.12946],[-88.40824,73.53789],[-85.82615,73.80382],[-86.56218,73.15745]]],[[[-100.35642,73.84389],[-99.16387,73.63339],[-97.38,73.76],[-97.12,73.47],[-98.05359,72.99052],[-96.54,72.56],[-96.72,71.66],[-98.35966,71.27285],[-99.32286,71.35639],[-100.01482,71.73827],[-102.5,72.51],[-102.48,72.83],[-100.43836,72.70588],[-101.54,73.36],[-100.35642,73.84389]]],[[[143.60385,73.21244],[142.08763,73.20544],[140.03816,73.31692],[139.86312,73.36983],[140.81171,73.76506],[142.06207,73.85758],[143.48283,73.47525],[143.60385,73.21244]]],[[[-93.1963,72.77199],[-94.26905,72.0246],[-95.40986,72.06188],[-96.03375,72.94028],[-96.01827,73.43743],[-95.49579,73.86242],[-94.50366,74.13491],[-92.42001,74.10003],[-90.50979,73.85673],[-92.00397,72.96624],[-93.1963,72.77199]]],[[[-120.46,71.4],[-123.09219,70.90164],[-123.62,71.34],[-125.92896,71.86868],[-125.59271,72.19452],[-124.80729,73.02256],[-123.94,73.68],[-124.91775,74.29275],[-121.53788,74.44893],[-120.10978,74.24135],[-117.55564,74.18577],[-116.58442,73.89607],[-115.51081,73.47519],[-116.76794,73.22292],[-119.22,72.52],[-120.46,71.82],[-120.46,71.4]]],[[[150.73167,75.08406],[149.57593,74.68892],[147.97747,74.77836],[146.11919,75.17298],[146.35849,75.49682],[148.22223,75.34585],[150.73167,75.08406]]],[[[-93.61276,74.98],[-94.15691,74.59235],[-95.60868,74.66686],[-96.82093,74.92762],[-96.28859,75.37783],[-94.85082,75.64722],[-93.97775,75.29649],[-93.61276,74.98]]],[[[145.08629,75.56262],[144.3,74.82],[140.61381,74.84768],[138.95544,74.61148],[136.97439,75.26167],[137.51176,75.94917],[138.83108,76.13676],[141.47162,76.09289],[145.08629,75.56262]]],[[[-98.5,76.72],[-97.73559,76.25656],[-97.70442,75.74344],[-98.16,75.0],[-99.80874,74.89744],[-100.88366,75.05736],[-100.86292,75.64075],[-102.50209,75.5638],[-102.56552,76.3366],[-101.48973,76.30537],[-99.98349,76.64634],[-98.57699,76.58859],[-98.5,76.72]]],[[[-108.21141,76.20168],[-107.81943,75.84552],[-106.92893,76.01282],[-105.881,75.9694],[-105.70498,75.47951],[-106.31347,75.00527],[-109.7,74.85],[-112.22307,74.41696],[-113.74381,74.39427],[-113.87135,74.72029],[-111.79421,75.1625],[-116.31221,75.04343],[-117.7104,75.2222],[-116.34602,76.19903],[-115.40487,76.47887],[-112.59056,76.14134],[-110.81422,75.54919],[-109.0671,75.47321],[-110.49726,76.42982],[-109.5811,76.79417],[-108.54859,76.67832],[-108.21141,76.20168]]],[[[57.53569,70.72046],[56.94498,70.63274],[53.67738,70.76266],[53.41202,71.20666],[51.60189,71.47476],[51.45575,72.01488],[52.47828,72.22944],[52.44417,72.77473],[54.42761,73.62755],[53.50829,73.74981],[55.90246,74.62749],[55.63193,75.08141],[57.86864,75.60939],[61.17004,76.25188],[64.49837,76.43906],[66.21098,76.80978],[68.15706,76.9397],[68.85221,76.54481],[68.18057,76.23364],[64.63733,75.73775],[61.58351,75.26088],[58.47708,74.30906],[56.98679,73.33304],[55.41934,72.37127],[55.62284,71.54059],[57.53569,70.72046]]],[[[-94.68409,77.09788],[-93.57392,76.7763],[-91.60502,76.77852],[-90.74185,76.4496],[-90.96966,76.07401],[-89.82224,75.84777],[-89.18708,75.61017],[-87.83828,75.56619],[-86.37919,75.48242],[-84.78963,75.6992],[-82.75344,75.78432],[-81.12853,75.71398],[-80.05751,75.33685],[-79.83393,74.92313],[-80.45777,74.6573],[-81.94884,74.44246],[-83.22889,74.56403],[-86.09745,74.41003],[-88.15035,74.39231],[-89.76472,74.51556],[-92.42244,74.83776],[-92.76829,75.38682],[-92.88991,75.88266],[-93.89382,76.31924],[-95.96246,76.44138],[-97.12138,76.75108],[-96.74512,77.16139],[-94.68409,77.09788]]],[[[-116.19859,77.64529],[-116.33581,76.87696],[-117.10605,76.53003],[-118.04041,76.48117],[-119.89932,76.05321],[-121.5,75.90002],[-122.85492,76.11654],[-122.85493,76.11654],[-121.15754,76.86451],[-119.10394,77.51222],[-117.57013,77.49832],[-116.19859,77.64529]]],[[[106.97028,76.9743],[107.24011,76.4801],[108.15393,76.72333],[111.07727,76.71008],[113.33148,76.22229],[114.13428,75.84772],[113.8855,75.32788],[112.7793,75.03192],[110.15131,74.47668],[109.40009,74.18011],[110.64008,74.0401],[112.11932,73.78772],[113.01947,73.97693],[113.52972,73.33508],[113.96887,73.59491],[115.56787,73.75293],[118.77631,73.58771],[119.02008,73.12012],[123.20068,72.97131],[123.25787,73.73511],[125.38013,73.56012],[126.9765,73.56549],[128.59131,73.0387],[129.0517,72.39868],[128.46008,71.9801],[129.71613,71.19312],[131.2887,70.78711],[132.25348,71.8363],[133.85773,71.38647],[135.56207,71.65527],[137.49768,71.34772],[138.23413,71.62811],[139.86987,71.48792],[139.14789,72.41632],[140.46808,72.84949],[149.50012,72.20007],[150.35132,71.60651],[152.96887,70.84229],[157.0069,71.03149],[158.99792,70.8667],[159.83032,70.45331],[159.70868,69.72211],[160.94067,69.43732],[162.27911,69.64209],[164.05249,69.66827],[165.94049,69.47211],[167.83569,69.5827],[169.5777,68.69391],[170.81689,69.01367],[170.0083,69.65289],[170.45349,70.09711],[173.64392,69.8175],[175.72412,69.87732],[178.6001,69.40009],[180.0,68.96372],[180.0,64.97958],[179.99292,64.9743],[178.70728,64.53491],[177.41132,64.60828],[178.31311,64.07593],[178.90833,63.25208],[179.37048,62.98273],[179.48651,62.56909],[179.22827,62.30408],[177.36432,62.52191],[174.56927,61.76929],[173.68011,61.65271],[172.15009,60.95007],[170.69849,60.3363],[170.33087,59.8819],[168.90051,60.57349],[166.2951,59.7887],[165.84009,60.1601],[164.87689,59.73169],[163.53931,59.86871],[163.2171,59.21112],[162.01727,58.24329],[162.0531,57.83911],[163.19189,57.61511],[163.05792,56.1593],[162.1297,56.12231],[161.70148,55.28571],[162.11749,54.85529],[160.3689,54.34448],[160.02173,53.2027],[158.53088,52.95868],[158.23132,51.94269],[156.78992,51.01111],[156.4201,51.70007],[155.99188,53.15887],[155.43372,55.3811],[155.91449,56.76788],[156.7583,57.36469],[156.81049,57.83209],[158.36432,58.05573],[160.1507,59.31488],[161.87207,60.34308],[163.66968,61.14093],[164.47369,62.55072],[163.25848,62.46631],[162.6579,61.64252],[160.12152,60.54431],[159.30231,61.77411],[156.7207,61.43451],[154.21808,59.7583],[155.04388,59.14508],[152.81189,58.88391],[151.26569,58.78088],[151.33807,59.50409],[149.78369,59.6557],[148.54492,59.16449],[145.4873,59.33649],[142.19788,59.0401],[138.9585,57.08807],[135.12628,54.72968],[136.70172,54.6037],[137.19348,53.97729],[138.16467,53.75513],[138.80469,54.2547],[139.90149,54.1897],[141.34528,53.08972],[141.37927,52.23889],[140.59747,51.23969],[140.51312,50.04547],[140.06207,48.44672],[138.55469,46.99969],[138.21973,46.30792],[136.8623,45.14349],[135.51532,43.98907],[134.86951,43.39832],[133.53693,42.81152],[132.90631,42.79852],[132.27808,43.28448],[130.93591,42.55267],[130.78009,42.22009],[130.40009,42.28009],[129.96588,41.94128],[129.66748,41.60107],[129.70532,40.88287],[129.18811,40.66193],[129.0105,40.48547],[128.63348,40.18988],[127.96753,40.02551],[127.53351,39.7569],[127.50208,39.32391],[127.3855,39.2135],[127.78333,39.0509],[128.34967,38.6123],[129.21289,37.4325],[129.46051,36.7843],[129.46832,35.63208],[129.09149,35.08252],[128.18591,34.8905],[127.38647,34.47571],[126.48572,34.39008],[126.3739,34.93469],[126.55933,35.68469],[126.11749,36.72552],[126.86029,36.89392],[126.17468,37.74969],[125.68909,37.94012],[125.56848,37.75208],[125.27533,37.66913],[125.24011,37.8573],[124.98108,37.94891],[124.71228,38.10828],[124.98608,38.54852],[125.22192,38.66589],[125.13287,38.84869],[125.38672,39.38788],[125.32111,39.55151],[124.73749,39.66028],[124.26569,39.92853],[122.86768,39.63788],[122.13153,39.17047],[121.05469,38.89752],[121.58612,39.3609],[121.37689,39.75031],[122.1687,40.42249],[121.6405,40.94647],[120.76868,40.59351],[119.63971,39.89807],[119.0235,39.25232],[118.04272,39.20428],[117.53271,38.73767],[118.05969,38.06152],[118.8783,37.89728],[118.91168,37.44849],[119.70288,37.15649],[120.82349,37.87048],[121.7113,37.48108],[122.35791,37.45453],[122.52008,36.93073],[121.10431,36.65131],[120.63708,36.11151],[119.66467,35.60992],[119.15131,34.90991],[120.22748,34.36047],[120.62048,33.37671],[121.22913,32.46033],[121.90808,31.69232],[121.89191,30.94928],[121.26428,30.67633],[121.50348,30.14288],[122.0921,29.83252],[121.93848,29.01813],[121.68451,28.22552],[121.12567,28.13568],[120.39551,27.05328],[119.58551,25.74091],[118.65692,24.54749],[117.28168,23.62451],[115.89069,22.7829],[114.76392,22.66809],[114.15253,22.22388],[113.80688,22.54828],[113.24109,22.05151],[111.84369,21.55048],[110.78552,21.39728],[110.44409,20.34113],[109.88989,20.28247],[109.62769,21.0083],[109.8645,21.39508],[108.52289,21.71527],[108.05029,21.55249],[106.71509,20.6969],[105.88171,19.75208],[105.66211,19.05829],[106.42688,18.00409],[107.36188,16.69751],[108.26947,16.07971],[108.87708,15.27667],[109.33533,13.42609],[109.20007,11.66687],[108.36609,11.0083],[107.22089,10.3645],[106.40509,9.53088],[105.15833,8.59967],[104.79529,9.24109],[105.07629,9.91852],[104.33447,10.48669],[103.49731,10.63269],[103.0907,11.15369],[102.58508,12.18671],[101.68707,12.64587],[100.83191,12.62708],[100.97852,13.41272],[100.0979,13.40692],[100.01868,12.30713],[99.47888,10.8465],[99.15369,9.96307],[99.22247,9.23932],[99.8739,9.20789],[100.27972,8.29529],[100.45929,7.42969],[101.01727,6.85687],[101.62311,6.74072],[102.1413,6.22168],[102.37128,6.1283],[102.96173,5.52448],[103.38129,4.8551],[103.43872,4.1817],[103.33209,3.72668],[103.4295,3.38287],[103.5025,2.79108],[103.85468,2.5155],[104.24792,1.63129],[104.22888,1.29309],[103.51971,1.22632],[102.57373,1.9671],[101.39069,2.76093],[101.27368,3.27032],[100.6955,3.93909],[100.5575,4.76727],[100.19672,5.3125],[100.30627,6.04071],[100.08588,6.46448],[99.69067,6.84833],[99.51971,7.34351],[98.98828,7.90808],[98.50391,8.38232],[98.33972,7.79449],[98.15009,8.3501],[98.25928,8.97388],[98.55353,9.93311],[98.45728,10.67529],[98.76453,11.44128],[98.42828,12.03308],[98.5097,13.1225],[98.1037,13.6405],[97.77771,14.83728],[97.59711,16.10071],[97.16467,16.92871],[96.50592,16.42731],[95.36932,15.71448],[94.80847,15.80353],[94.1889,16.03809],[94.53351,17.27728],[94.32489,18.2135],[93.54108,19.36652],[93.66333,19.72711],[93.07831,19.85529],[92.36853,20.6709],[92.08289,21.19232],[92.02533,21.70172],[91.8349,22.18292],[91.41711,22.76508],[90.49609,22.80511],[90.5871,22.39288],[90.27289,21.83649],[89.84747,22.03912],[89.70209,21.85712],[89.41888,21.96631],[89.0321,22.05573],[88.88892,21.69067],[88.2085,21.70331],[86.97571,21.49548],[87.03308,20.74329],[86.49933,20.15167],[85.0603,19.4787],[83.9411,18.30212],[83.18927,17.67133],[82.19287,17.01672],[82.19128,16.5567],[81.69269,16.3103],[80.79211,15.95209],[80.32489,15.89929],[80.02509,15.13647],[80.23328,13.83588],[80.28632,13.00629],[79.86249,12.05627],[79.85809,10.3573],[79.34052,10.3089],[78.8855,9.54608],[79.1897,9.21667],[78.27808,8.93311],[77.94128,8.25293],[77.53992,7.96552],[76.59308,8.89929],[76.13013,10.29968],[75.74652,11.30829],[75.39612,11.78131],[74.86493,12.74188],[74.6167,13.99268],[74.44391,14.61731],[73.5343,15.99072],[73.11987,17.92871],[72.82092,19.20831],[72.82452,20.41949],[72.63068,21.35608],[71.17529,20.75751],[70.47052,20.87732],[69.16412,22.08929],[69.6449,22.45068],[69.34967,22.84332],[68.1767,23.69208],[67.44373,23.94489],[67.14551,24.6637],[66.37292,25.42529],[64.53052,25.23712],[62.9057,25.21851],[61.4975,25.07831],[59.61609,25.38013],[58.52588,25.61011],[57.39728,25.73993],[56.97089,26.96613],[56.49213,27.14331],[55.72369,26.96472],[54.71509,26.48071],[53.4931,26.8125],[52.4837,27.58087],[51.52087,27.86572],[50.85309,28.81451],[50.11511,30.14789],[49.5769,29.98572],[48.94128,30.31708],[48.56812,29.92688],[47.97449,29.97589],[48.18329,29.53448],[48.09387,29.30627],[48.41608,28.55212],[48.80768,27.6897],[49.29968,27.4613],[49.47089,27.11011],[50.15253,26.6897],[50.21307,26.2771],[50.11328,25.94409],[50.23993,25.60809],[50.52753,25.32788],[50.66071,24.99988],[50.81012,24.75488],[50.7439,25.48248],[51.01349,26.00708],[51.2865,26.11469],[51.58911,25.80109],[51.60669,25.2157],[51.38971,24.6275],[51.57953,24.24548],[51.75751,24.29413],[51.79449,24.0199],[52.57709,24.17749],[53.40411,24.15131],[54.00812,24.12189],[54.69312,24.79791],[55.43909,25.43909],[56.07092,26.05548],[56.36212,26.39587],[56.48572,26.30908],[56.39148,25.89612],[56.26111,25.71472],[56.39691,24.92468],[56.84528,24.2417],[57.4035,23.87872],[58.13708,23.74792],[58.72931,23.56567],[59.18048,22.99249],[59.45007,22.66028],[59.80811,22.53369],[59.80627,22.31049],[59.44232,21.71448],[59.28247,21.4339],[58.86108,21.11407],[58.4881,20.42908],[58.0343,20.48151],[57.82648,20.2431],[57.66589,19.73608],[57.7887,19.06769],[57.69452,18.9447],[57.23431,18.94812],[56.60968,18.57428],[56.51233,18.0871],[56.28351,17.8761],[55.6615,17.88428],[55.27008,17.63232],[55.2749,17.22827],[54.79108,16.95068],[54.23932,17.0451],[53.5705,16.7077],[53.1087,16.65112],[52.38531,16.38251],[52.19171,15.93848],[52.16827,15.59747],[51.17249,15.17529],[49.57471,14.70868],[48.67932,14.0033],[48.23907,13.94812],[47.9389,14.00732],[47.35449,13.59229],[46.7171,13.39972],[45.87769,13.3479],[45.62512,13.29108],[45.40649,13.02692],[45.14429,12.95392],[44.98969,12.69971],[44.49469,12.72168],[44.17511,12.58588],[43.48309,12.6369],[43.2229,13.22089],[43.25153,13.7677],[43.08807,14.06268],[42.89227,14.80231],[42.60492,15.21332],[42.80511,15.26208],[42.70251,15.71887],[42.82373,15.91168],[42.77948,16.3479],[42.64972,16.77472],[42.34808,17.07593],[42.27087,17.47467],[41.75452,17.83313],[41.2215,18.67169],[40.93927,19.48651],[40.24768,20.17468],[39.8017,20.33893],[39.13953,21.29187],[39.02368,21.98688],[39.06628,22.57971],[38.49292,23.68848],[38.02393,24.07867],[37.4837,24.28552],[37.15491,24.85852],[37.20947,25.08447],[36.9317,25.60309],[36.63971,25.82629],[36.24908,26.57013],[35.64032,27.37653],[35.13031,28.06348],[34.63232,28.05847],[34.7879,28.60748],[34.83228,28.95752],[34.95612,29.35669],[34.92273,29.50128],[34.64172,29.09949],[34.4267,28.34412],[34.15448,27.8233],[33.92151,27.64868],[33.58807,27.9715],[33.1369,28.41772],[32.42328,29.85107],[32.3205,29.7605],[32.73492,28.70532],[33.34888,27.69989],[34.10468,26.14227],[34.47388,25.59869],[34.7951,25.03387],[35.6925,23.9267],[35.49371,23.7525],[35.52612,23.10248],[36.69067,22.2049],[36.86627,22.00012],[37.18872,21.01892],[36.96948,20.83752],[37.11469,19.80811],[37.48187,18.61407],[37.86267,18.36792],[38.4101,17.99829],[38.99072,16.8407],[39.26611,15.92273],[39.81427,15.43573],[41.17932,14.49109],[41.73492,13.92108],[42.27692,13.34412],[42.58972,13.00049],[43.0813,12.69971],[43.31787,12.39008],[43.2865,11.97491],[42.71588,11.73572],[43.14532,11.4621],[43.4707,11.27771],[43.66669,10.86432],[44.11792,10.44568],[44.61432,10.44232],[45.55688,10.69812],[46.64551,10.81653],[47.5257,11.12732],[48.02173,11.19312],[48.37891,11.37549],[48.9483,11.41071],[49.26788,11.43048],[49.7287,11.57892],[50.25891,11.67969],[50.73212,12.02191],[51.11133,12.02472],[51.13391,11.74829],[51.0415,11.1665],[51.04529,10.64093],[50.83429,10.27972],[50.55249,9.19873],[50.07092,8.08173],[49.4527,6.80469],[48.59448,5.33911],[47.74091,4.21948],[46.56488,2.85529],[45.56409,2.0459],[44.0683,1.05292],[43.13611,0.2923],[42.04169,-0.91919],[41.8111,-1.44641],[41.58508,-1.68323],[40.88489,-2.08252],[40.63788,-2.49982],[40.26312,-2.57312],[40.12128,-3.27771],[39.80011,-3.68109],[39.60492,-4.3465],[39.20227,-4.6767],[38.74048,-5.90887],[38.79968,-6.47559],[39.44012,-6.84003],[39.47009,-7.09998],[39.1947,-7.70392],[39.25208,-8.00781],[39.18652,-8.48547],[39.53589,-9.1123],[39.94971,-10.09839],[40.31671,-10.31708],[40.47852,-10.76538],[40.43732,-11.76172],[40.56091,-12.6391],[40.59967,-14.2019],[40.77551,-14.69171],[40.47729,-15.40631],[40.08929,-16.10071],[39.4527,-16.72089],[38.53833,-17.10101],[37.41107,-17.5863],[36.28131,-18.65961],[35.89648,-18.84229],[35.19849,-19.5528],[34.7865,-19.784],[34.7019,-20.49701],[35.17609,-21.25427],[35.37347,-21.84082],[35.38593,-22.14001],[35.56268,-22.09003],[35.53387,-23.0708],[35.37189,-23.53528],[35.60748,-23.70648],[35.45868,-24.12262],[35.04071,-24.47827],[34.21588,-24.81628],[33.01331,-25.35748],[32.57471,-25.72729],[32.66028,-26.1485],[32.91608,-26.21588],[32.83008,-26.74219],[32.58032,-27.47009],[32.46228,-28.30103],[32.20349,-28.75238],[31.52112,-29.25739],[31.32568,-29.40198],[30.90167,-29.90991],[30.62292,-30.42371],[30.05573,-31.1402],[28.92548,-32.172],[28.21973,-32.77191],[27.46472,-33.22699],[26.41949,-33.61493],[25.90973,-33.66699],[25.7807,-33.94458],[25.17291,-33.79688],[24.67792,-33.98718],[23.59412,-33.79449],[22.98828,-33.91638],[22.57428,-33.86407],[21.54291,-34.25879],[20.68909,-34.41718],[20.07129,-34.7951],[19.61652,-34.81909],[19.1933,-34.46259],[18.85529,-34.44427],[18.42468,-33.9978],[18.3775,-34.13647],[18.24451,-33.86768],[18.25012,-33.28137],[17.92529,-32.61121],[18.24792,-32.42908],[18.22168,-31.66162],[17.56689,-30.72571],[17.06451,-29.8786],[17.06293,-29.87598],[16.34509,-28.57672],[15.60193,-27.82123],[15.21051,-27.09088],[14.98969,-26.11731],[14.74329,-25.39288],[14.40808,-23.85303],[14.38568,-22.65668],[14.25769,-22.11121],[13.86871,-21.69897],[13.35248,-20.8728],[12.8269,-19.6731],[12.6087,-19.04529],[11.79492,-18.06909],[11.73431,-17.30188],[11.64008,-16.6731],[11.77869,-15.79382],[12.12372,-14.8783],[12.17572,-14.4491],[12.50012,-13.54773],[12.73853,-13.13788],[13.31293,-12.48358],[13.63373,-12.03857],[13.73871,-11.29779],[13.68652,-10.73108],[13.38733,-10.3736],[13.12109,-9.76691],[12.87549,-9.16687],[12.92908,-8.95911],[13.23651,-8.56262],[12.93311,-7.5965],[12.72827,-6.92712],[12.22748,-6.29437],[12.32251,-6.1001],[12.18231,-5.78992],[11.9151,-5.0379],[11.09369,-3.97882],[10.06628,-2.96948],[9.40527,-2.14429],[8.7981,-1.11133],[8.83008,-0.77899],[9.04852,-0.45929],[9.29132,0.26868],[9.49292,1.01007],[9.30573,1.16089],[9.64929,2.28387],[9.79529,3.07349],[9.40448,3.7345],[8.94812,3.90411],[8.74487,4.35229],[8.48889,4.49573],[8.50031,4.77209],[7.4621,4.41211],[7.0827,4.46472],[6.69812,4.24072],[5.89832,4.26251],[5.36292,4.88812],[5.03369,5.61188],[4.32568,6.27069],[3.57428,6.2583],[2.69171,6.25891],[1.8653,6.14227],[1.06012,5.92889],[-0.50763,5.34351],[-1.0636,5.00049],[-1.96472,4.71051],[-2.85608,4.99451],[-3.3111,4.98431],[-4.00879,5.17987],[-4.6499,5.16827],[-5.83441,4.99371],[-6.52869,4.70508],[-7.51892,4.33832],[-7.7121,4.36469],[-7.97412,4.3559],[-9.00482,4.83252],[-9.91339,5.59369],[-10.76538,6.14069],[-11.43878,6.78589],[-11.70819,6.86011],[-12.4281,7.26288],[-12.94897,7.79871],[-13.12402,8.16388],[-13.24652,8.90308],[-13.68518,9.49487],[-14.07397,9.88629],[-14.33008,10.01569],[-14.57971,10.21448],[-14.69318,10.65631],[-14.83948,10.87671],[-15.13031,11.04053],[-15.66418,11.4585],[-16.08521,11.52472],[-16.3147,11.80652],[-16.3089,11.95868],[-16.61377,12.1709],[-16.67743,12.38489],[-16.84149,13.15149],[-16.71368,13.59509],[-17.1261,14.37347],[-17.625,14.72968],[-17.18518,14.91949],[-16.70068,15.62152],[-16.46301,16.13507],[-16.54968,16.67389],[-16.27051,17.16711],[-16.1463,18.10852],[-16.2569,19.09668],[-16.37762,19.59387],[-16.27777,20.09253],[-16.53632,20.56787],[-17.06342,20.99988],[-17.02039,21.4223],[-16.97321,21.88568],[-16.58911,22.15833],[-16.2619,22.67932],[-16.32642,23.01788],[-15.9826,23.72351],[-15.42603,24.35913],[-15.08929,24.52032],[-14.82458,25.10352],[-14.8009,25.63629],[-14.43988,26.25452],[-13.7738,26.6189],[-13.13989,27.64008],[-12.61877,28.03833],[-11.6889,28.14868],[-10.90088,28.83228],[-10.3996,29.09869],[-9.56482,29.93372],[-9.8147,31.17767],[-9.43481,32.03809],[-9.30072,32.5647],[-8.65741,33.2403],[-7.65417,33.69708],[-6.91248,34.11047],[-6.24432,35.14587],[-5.92999,35.76007],[-5.19379,35.75531],[-4.591,35.33069],[-3.64008,35.3999],[-2.60431,35.17908],[-2.16992,35.16852],[-1.20862,35.7149],[-0.12738,35.88867],[0.50391,36.30133],[1.46692,36.60571],[3.16168,36.78387],[4.81567,36.86511],[5.32013,36.71649],[6.2619,37.11072],[7.33051,37.11853],[7.73712,36.88568],[8.42108,36.94647],[9.51007,37.3501],[10.21008,37.2301],[10.18073,36.72412],[11.02893,37.0921],[11.1001,36.90009],[10.6001,36.4101],[10.59332,35.94751],[10.93951,35.6991],[10.80792,34.8335],[10.14972,34.33069],[10.33972,33.78589],[10.85687,33.76868],[11.10852,33.29327],[11.48889,33.13708],[12.66333,32.79291],[13.08331,32.87891],[13.9187,32.7121],[15.24573,32.26508],[15.71393,31.37628],[16.61169,31.18231],[18.02112,30.76349],[19.08649,30.26648],[19.5741,30.52588],[20.05328,30.9859],[19.82031,31.75189],[20.13409,32.23828],[20.85449,32.70691],[21.54309,32.84332],[22.89587,32.63849],[23.23688,32.19153],[23.60913,32.18732],[23.92749,32.01672],[24.92108,31.89948],[25.16492,31.56927],[26.4953,31.58569],[27.4577,31.32129],[28.4505,31.02588],[28.91351,30.87012],[29.68347,31.18689],[30.09509,31.47351],[30.97693,31.55591],[31.68811,31.42969],[31.96051,30.93372],[32.1925,31.26031],[32.9939,31.02411],[33.7735,30.96753],[34.2655,31.21948],[34.55652,31.54889],[34.4881,31.60553],[34.75269,32.07288],[34.95551,32.82751],[35.09851,33.08069],[35.1261,33.09088],[35.4823,33.90552],[35.97968,34.61011],[35.99847,34.6449],[35.90509,35.4101],[36.1499,35.82147],[35.7821,36.27509],[36.16089,36.6507],[35.55109,36.56549],[34.71448,36.79547],[34.02692,36.22009],[32.50928,36.10748],[31.69971,36.64429],[30.6217,36.67792],[30.39111,36.26312],[29.70007,36.14429],[28.73291,36.67688],[27.6413,36.65887],[27.04889,37.6535],[26.3183,38.20813],[26.80469,38.9859],[26.1709,39.46368],[27.28009,40.4201],[28.82013,40.46008],[29.24011,41.22009],[31.14587,41.08771],[32.34808,41.73633],[33.51331,42.0191],[35.16772,42.04028],[36.91309,41.33551],[38.34772,40.94873],[39.5127,41.10291],[40.37347,41.01367],[41.55408,41.53571],[41.70331,41.96307],[41.45349,42.64508],[40.87549,43.01367],[40.32147,43.12872],[39.95508,43.43512],[38.68011,44.28009],[37.53912,44.65729],[36.67548,45.24469],[37.40332,45.40448],[38.23309,46.24091],[37.67371,46.63672],[39.14771,47.04468],[39.12128,47.26349],[38.22369,47.10229],[37.42511,47.02228],[36.75989,46.69873],[35.82373,46.64587],[34.96228,46.27332],[35.02087,45.65131],[35.51007,45.4101],[36.53009,45.47009],[36.33472,45.11328],[35.24011,44.94012],[33.88251,44.36151],[33.32648,44.56488],[33.54688,45.03491],[32.45428,45.32751],[32.63092,45.51929],[33.58807,45.85168],[33.29871,46.08069],[31.74408,46.3335],[31.67529,46.7063],[30.7489,46.58313],[30.37769,46.03247],[29.60327,45.29327],[29.62653,45.03552],[29.14172,44.82031],[28.83789,44.91388],[28.55811,43.70752],[28.03912,43.29327],[27.67389,42.57788],[27.9967,42.00751],[28.11548,41.62292],[28.98853,41.29993],[28.80652,41.05487],[27.61908,40.99988],[27.1925,40.69067],[26.35809,40.1521],[26.04327,40.61768],[26.05688,40.8241],[25.44769,40.85248],[24.9259,40.94708],[23.7149,40.68707],[24.40808,40.12512],[23.90009,39.9621],[23.34308,39.96112],[22.81409,40.47607],[22.62628,40.25653],[22.84967,39.6593],[23.3501,39.19012],[22.97308,38.97089],[23.53009,38.51007],[24.02509,38.22009],[24.0401,37.65509],[23.11511,37.9201],[23.4101,37.4101],[22.77509,37.30511],[23.1543,36.42249],[22.49011,36.4101],[21.6701,36.84509],[21.2951,37.64508],[21.12012,38.3103],[20.7301,38.77008],[20.21771,39.34027],[20.15009,39.62512],[19.9801,39.69513],[19.96008,39.9151],[19.40613,40.25092],[19.31909,40.72729],[19.40369,41.40948],[19.5401,41.72009],[19.37189,41.87769],[19.16248,41.95508],[18.88208,42.28149],[18.45007,42.4801],[17.50989,42.8501],[16.93011,43.21008],[16.0155,43.50732],[15.1745,44.24329],[15.37628,44.31787],[14.92029,44.73853],[14.90167,45.07611],[14.25873,45.23389],[13.95227,44.80212],[13.6571,45.13708],[13.6795,45.48413],[13.71509,45.50031],[13.93768,45.59113],[13.14172,45.73669],[12.32867,45.3819],[12.38391,44.8855],[12.26147,44.60052],[12.58929,44.09149],[13.52692,43.58771],[14.02991,42.76111],[15.1427,41.95508],[15.92633,41.9613],[16.16992,41.7403],[15.88928,41.54108],[16.7851,41.17969],[17.51929,40.87708],[18.37671,40.35571],[18.48029,40.16888],[18.29352,39.81091],[17.73853,40.27771],[16.86969,40.44232],[16.44873,39.79547],[17.17151,39.42468],[17.05292,38.90289],[16.63507,38.84369],[16.10107,37.9859],[15.68408,37.90887],[15.68811,38.21472],[15.89209,38.75092],[16.10931,38.96448],[15.71887,39.54413],[15.4137,40.04828],[14.99847,40.1731],[14.70331,40.60468],[14.06073,40.7865],[13.62811,41.18829],[12.88812,41.25311],[12.10669,41.70453],[11.19189,42.35553],[10.51208,42.93152],[10.20007,43.9201],[9.70251,44.03632],[8.88892,44.36627],[8.42871,44.23132],[7.85089,43.76727],[7.4353,43.69391],[6.5293,43.12891],[4.55688,43.39972],[3.10052,43.07532],[2.98608,42.47308],[3.03949,41.89209],[2.09192,41.22607],[0.81049,41.01471],[0.72131,40.67828],[0.10669,40.12408],[-0.27869,39.31012],[0.11133,38.73853],[-0.4671,38.29248],[-0.68341,37.64227],[-1.43829,37.44312],[-2.14642,36.67407],[-3.41571,36.65887],[-4.3689,36.67792],[-4.99518,36.32471],[-5.37708,35.9469],[-5.86639,36.02991],[-6.23669,36.36768],[-6.5202,36.94287],[-7.45367,37.0979],[-7.85559,36.83832],[-8.38281,36.97888],[-8.8988,36.8689],[-8.74609,37.65149],[-8.84003,38.2663],[-9.28748,38.35852],[-9.52649,38.73749],[-9.4469,39.39209],[-9.04828,39.75513],[-8.97729,40.1593],[-8.76868,40.76068],[-8.79077,41.18433],[-8.99078,41.54352],[-9.03479,41.88068],[-8.98438,42.5929],[-9.39288,43.02667],[-7.97821,43.74847],[-6.75452,43.56787],[-5.4118,43.57428],[-4.34778,43.4035],[-3.51752,43.45587],[-1.90131,43.42291],[-1.38422,44.02271],[-1.19379,46.01489],[-2.22571,47.06451],[-2.9632,47.57031],[-4.49158,47.95508],[-4.59229,48.68408],[-3.29578,48.90167],[-1.61652,48.64447],[-1.93341,49.77649],[-0.98938,49.34747],[1.33868,50.12732],[1.6391,50.94672],[2.51349,51.1485],[3.31512,51.34589],[3.83032,51.62048],[4.70612,53.09192],[6.07428,53.5105],[6.90527,53.4823],[7.10052,53.69391],[7.93628,53.74829],[8.1217,53.52789],[8.80072,54.02087],[8.57208,54.39569],[8.52631,54.96289],[8.1203,55.5177],[8.09009,56.5401],[8.25671,56.81012],[8.54352,57.11011],[9.4245,57.17212],[9.7757,57.44788],[10.58008,57.7301],[10.54608,57.21588],[10.25012,56.89008],[10.37012,56.61011],[10.91229,56.45868],[10.66791,56.08148],[10.37012,56.19012],[9.65009,55.47009],[9.92188,54.98309],[9.9397,54.59668],[10.95007,54.36371],[10.93951,54.00873],[11.9563,54.19647],[12.51849,54.47052],[13.64752,54.0755],[14.11969,53.75708],[14.80292,54.05072],[16.36353,54.51331],[17.62292,54.85168],[18.62091,54.68268],[18.69629,54.43872],[19.66071,54.42609],[19.88849,54.86609],[21.26849,55.19049],[21.05591,56.03113],[21.09052,56.78387],[21.58191,57.41193],[22.52448,57.75348],[23.31848,57.00629],[24.12073,57.0257],[24.31293,57.79352],[24.42908,58.38348],[24.06128,58.25751],[23.4267,58.61267],[23.3399,59.18732],[24.60431,59.46588],[25.86432,59.61108],[26.94928,59.44592],[27.98108,59.47552],[29.11768,60.02808],[28.07013,60.50348],[26.25531,60.42389],[24.4967,60.05731],[22.86969,59.8465],[22.29089,60.39191],[21.32233,60.72028],[21.54492,61.70532],[21.05933,62.60748],[21.53607,63.18988],[22.44269,63.81787],[24.73053,64.90228],[25.39807,65.11151],[25.29413,65.53448],[23.9035,66.0069],[22.18329,65.72388],[21.2135,65.02612],[21.36969,64.4137],[19.77893,63.60968],[17.8479,62.74951],[17.11969,61.34131],[17.83148,60.63672],[18.78772,60.08191],[17.86932,58.95392],[16.82928,58.71991],[16.44769,57.04108],[15.87988,56.10431],[14.66669,56.20093],[14.10071,55.4079],[12.94287,55.36188],[12.62512,56.30713],[11.78809,57.44189],[11.02728,58.85608],[10.35669,59.46991],[8.38208,58.31329],[7.04889,58.07892],[5.66589,58.58807],[5.30829,59.66333],[4.99213,61.97113],[5.9129,62.6145],[8.55353,63.4541],[10.52771,64.48608],[12.35828,65.8797],[14.76129,67.81073],[16.43591,68.56329],[19.18408,69.8175],[21.37848,70.25531],[23.02368,70.20209],[24.54669,71.03052],[26.37012,70.98633],[28.16553,71.18549],[31.29352,70.45392],[30.00549,70.18628],[31.10107,69.55811],[32.13269,69.90588],[33.77551,69.30151],[36.5141,69.06348],[40.29248,67.9325],[41.05988,67.45728],[41.1261,66.79169],[40.01593,66.2663],[38.38287,65.99951],[33.9187,66.7597],[33.18451,66.63251],[34.81488,65.90009],[34.94391,64.41449],[36.23132,64.1095],[37.01288,63.84991],[37.14209,64.33472],[36.5177,64.78027],[37.17609,65.14331],[39.59351,64.52087],[40.43573,64.76453],[39.7627,65.49689],[42.09308,66.47632],[43.01611,66.4187],[43.94989,66.06909],[44.53229,66.75629],[43.69849,67.35248],[44.18793,67.9505],[43.45288,68.57092],[46.25012,68.25012],[46.82129,67.68988],[45.5553,67.56653],[45.56207,67.01007],[46.34912,66.66772],[47.89429,66.88452],[48.13867,67.52252],[50.22772,67.99872],[53.71753,68.85748],[54.47168,68.80829],[53.4859,68.20129],[54.72632,68.09711],[55.44269,68.43872],[57.31708,68.46631],[58.80212,68.88092],[59.94153,68.2785],[61.07788,68.94067],[60.03009,69.52008],[60.55011,69.8501],[63.50409,69.54749],[64.88812,69.23492],[68.51208,68.09229],[69.18073,68.61572],[68.16449,69.14429],[68.13531,69.35651],[66.93011,69.45471],[67.25989,69.92871],[66.72491,70.70892],[66.6947,71.02911],[68.5401,71.93451],[69.19629,72.84351],[69.94012,73.0401],[72.58752,72.77631],[72.79608,72.22009],[71.84808,71.40912],[72.47009,71.09027],[72.79187,70.39111],[72.5647,69.02087],[73.66791,68.4079],[73.23871,67.74048],[71.28009,66.32013],[72.4231,66.17273],[72.82068,66.53271],[73.92108,66.78949],[74.18652,67.2843],[75.05212,67.7605],[74.4693,68.3291],[74.93591,68.98932],[73.84229,69.07147],[73.60193,69.62769],[74.3999,70.6319],[73.10107,71.44708],[74.89093,72.12128],[74.6593,72.83228],[75.15808,72.8551],[75.68347,72.30048],[75.28912,71.33569],[76.35913,71.15289],[75.90308,71.87408],[77.57672,72.26727],[79.6521,72.32013],[81.50012,71.75012],[80.61072,72.58289],[80.51111,73.64832],[82.25012,73.8501],[84.65527,73.80591],[86.82233,73.93689],[86.0097,74.45972],[87.16687,75.11652],[88.31567,75.14392],[90.26007,75.64008],[92.9007,75.77332],[93.23431,76.0473],[95.86011,76.14008],[96.67828,75.91553],[98.92249,76.4469],[100.7597,76.4303],[101.03528,76.86188],[101.99091,77.28748],[104.35168,77.69788],[106.06671,77.3739],[104.70508,77.1275],[106.97028,76.9743]],[[49.11029,41.28229],[49.6189,40.57288],[50.0849,40.52631],[50.39288,40.25653],[49.56927,40.17609],[49.39532,39.39948],[49.22333,39.04932],[48.85651,38.81549],[48.8833,38.32031],[49.19971,37.58289],[50.14789,37.37469],[50.84229,36.87292],[52.2641,36.7005],[53.82593,36.96509],[53.92169,37.19891],[53.73547,37.90613],[53.88092,38.95209],[53.10107,39.29071],[53.35791,39.97528],[52.69409,40.03369],[52.91528,40.87653],[53.85828,40.6311],[54.73688,40.95111],[54.0083,41.55133],[53.72168,42.12329],[52.91669,41.8681],[52.8147,41.1355],[52.5025,41.78333],[52.44629,42.02728],[52.69208,42.44391],[52.50153,42.7923],[51.34253,43.13312],[50.8913,44.03113],[50.33911,44.28412],[50.30573,44.60992],[51.2785,44.51489],[51.31689,45.24609],[52.16748,45.40851],[53.04089,45.25909],[53.22089,46.23468],[53.04272,46.85309],[52.04211,46.80469],[51.19208,47.04871],[50.03412,46.60913],[49.10132,46.39948],[48.64551,45.80627],[47.6759,45.64148],[46.68213,44.60931],[47.59088,43.66028],[47.49249,42.98669],[48.58447,41.8089],[49.11029,41.28229]]],[[[-93.84,77.52],[-94.29561,77.49134],[-96.16965,77.55511],[-96.4363,77.83463],[-94.42258,77.82],[-93.72066,77.63433],[-93.84,77.52]]],[[[-110.18694,77.69701],[-112.05119,77.40923],[-113.53428,77.73221],[-112.72459,78.05105],[-111.26444,78.15296],[-109.85445,77.99632],[-110.18694,77.69701]]],[[[24.72412,77.85385],[22.49032,77.44493],[20.72601,77.67704],[21.41611,77.93504],[20.8119,78.25463],[22.88426,78.45494],[23.28134,78.07954],[24.72412,77.85385]]],[[[-109.66315,78.60197],[-110.88131,78.40692],[-112.54209,78.4079],[-112.52589,78.55055],[-111.50001,78.84999],[-110.96366,78.80444],[-109.66315,78.60197]]],[[[-95.83029,78.05694],[-97.30984,77.8506],[-98.12429,78.08286],[-98.55287,78.45811],[-98.63198,78.87193],[-97.33723,78.83198],[-96.7544,78.76581],[-95.55928,78.41831],[-95.83029,78.05694]]],[[[-100.06019,78.32475],[-99.67094,77.90754],[-101.30394,78.01898],[-102.94981,78.34323],[-105.17613,78.38033],[-104.21043,78.67742],[-105.41958,78.91834],[-105.49229,79.30159],[-103.52928,79.16535],[-100.82516,78.80046],[-100.06019,78.32475]]],[[[105.07547,78.30689],[99.43814,77.921],[101.2649,79.23399],[102.08635,79.34641],[102.83782,79.28129],[105.37243,78.71334],[105.07547,78.30689]]],[[[18.25183,79.70175],[21.54383,78.95611],[19.02737,78.5626],[18.47172,77.82669],[17.59441,77.63796],[17.1182,76.80941],[15.91315,76.77045],[13.76259,77.38035],[14.66956,77.73565],[13.1706,78.02493],[11.22231,78.8693],[10.44453,79.65239],[13.17077,80.01046],[13.71852,79.66039],[15.14282,79.67431],[15.52255,80.01608],[16.99085,80.05086],[18.25183,79.70175]]],[[[25.44763,80.40734],[27.40751,80.05641],[25.92465,79.51783],[23.02447,79.40001],[20.07519,79.56682],[19.89727,79.84236],[18.46226,79.85988],[17.36802,80.3189],[20.45599,80.59816],[21.90794,80.35768],[22.91925,80.65714],[25.44763,80.40734]]],[[[51.13619,80.54728],[49.79368,80.41543],[48.89441,80.33957],[48.75494,80.17547],[47.58612,80.01018],[46.50283,80.24725],[47.07246,80.55942],[44.84696,80.58981],[46.79914,80.77192],[48.31848,80.78401],[48.52281,80.51457],[49.09719,80.75399],[50.03977,80.91889],[51.52293,80.69973],[51.13619,80.54728]]],[[[99.93976,78.88094],[97.75794,78.7562],[94.97259,79.04475],[93.31288,79.4265],[92.5454,80.14379],[91.18107,80.34146],[93.77766,81.0246],[95.9409,81.2504],[97.88385,80.74698],[100.18666,79.78014],[99.93976,78.88094]]],[[[-87.02,79.66],[-85.81435,79.3369],[-87.18756,79.0393],[-89.03535,78.28723],[-90.80436,78.21533],[-92.87669,78.34333],[-93.95116,78.75099],[-93.93574,79.11373],[-93.14524,79.3801],[-94.974,79.37248],[-96.07614,79.70502],[-96.70972,80.15777],[-96.01644,80.60233],[-95.32345,80.90729],[-94.29843,80.97727],[-94.73542,81.20646],[-92.40984,81.25739],[-91.13289,80.72345],[-89.45,80.50932],[-87.81,80.32],[-87.02,79.66]]],[[[-68.5,83.10632],[-65.82735,83.02801],[-63.68,82.9],[-61.85,82.6286],[-61.89388,82.36165],[-64.334,81.92775],[-66.75342,81.72527],[-67.65755,81.50141],[-65.48031,81.50657],[-67.84,80.9],[-69.4697,80.61683],[-71.18,79.8],[-73.2428,79.63415],[-73.88,79.43016],[-76.90773,79.32309],[-75.52924,79.19766],[-76.22046,79.01907],[-75.39345,78.52581],[-76.34354,78.18296],[-77.88851,77.89991],[-78.36269,77.50859],[-79.75951,77.20968],[-79.61965,76.98336],[-77.91089,77.02205],[-77.88911,76.77796],[-80.56125,76.17812],[-83.17439,76.45403],[-86.11184,76.29901],[-87.6,76.42],[-89.49068,76.47239],[-89.6161,76.95213],[-87.76739,77.17833],[-88.26,77.9],[-87.65,77.97022],[-84.97634,77.53873],[-86.34,78.18],[-87.96192,78.37181],[-87.15198,78.75867],[-85.37868,78.9969],[-85.09495,79.34543],[-86.50734,79.73624],[-86.93179,80.25145],[-84.19844,80.20836],[-83.4087,80.1],[-81.84823,80.46442],[-84.1,80.58],[-87.59895,80.51627],[-89.36663,80.85569],[-90.2,81.26],[-91.36786,81.5531],[-91.58702,81.89429],[-90.1,82.085],[-88.93227,82.11751],[-86.97024,82.27961],[-85.5,82.65227],[-84.26001,82.6],[-83.18,82.32],[-82.42,82.86],[-81.1,83.02],[-79.30664,83.13056],[-76.25,83.17206],[-75.71878,83.06404],[-72.83153,83.23324],[-70.66577,83.16978],[-68.5,83.10632]]],[[[-27.10046,83.51966],[-20.84539,82.72669],[-22.69182,82.34165],[-26.51753,82.29765],[-31.9,82.2],[-31.39646,82.02154],[-27.85666,82.13178],[-24.84448,81.78697],[-22.90328,82.09317],[-22.07175,81.73449],[-23.16961,81.15271],[-20.62363,81.52462],[-15.76818,81.91245],[-12.77018,81.71885],[-12.20855,81.29154],[-16.28533,80.58004],[-16.85,80.35],[-20.04624,80.17708],[-17.73035,80.12912],[-18.9,79.4],[-19.70499,78.75128],[-19.67353,77.63859],[-18.47285,76.98565],[-20.03503,76.94434],[-21.67944,76.62795],[-19.83407,76.09808],[-19.59896,75.24838],[-20.66818,75.15585],[-19.37281,74.29561],[-21.59422,74.22382],[-20.43454,73.81713],[-20.76234,73.46436],[-22.17221,73.30955],[-23.56593,73.30663],[-22.31311,72.62928],[-22.29954,72.18409],[-24.27834,72.59788],[-24.79296,72.3302],[-23.44296,72.08016],[-22.13281,71.46898],[-21.75356,70.66369],[-23.53603,70.471],[-24.30702,70.85649],[-25.54341,71.43094],[-25.20135,70.75226],[-26.36276,70.22646],[-23.72742,70.18401],[-22.34902,70.12946],[-25.02927,69.2588],[-27.74737,68.47046],[-30.67371,68.12503],[-31.77665,68.12078],[-32.81105,67.73547],[-34.20196,66.67974],[-36.35284,65.9789],[-37.04378,65.93768],[-38.37505,65.69213],[-39.81222,65.45848],[-40.66899,64.83997],[-40.68281,64.13902],[-41.1887,63.48246],[-42.81938,62.68233],[-42.41666,61.90093],[-42.86619,61.07404],[-43.3784,60.09772],[-44.7875,60.03676],[-46.26364,60.85328],[-48.26294,60.85843],[-49.23308,61.40681],[-49.90039,62.38336],[-51.63325,63.62691],[-52.14014,64.27842],[-52.27659,65.1767],[-53.66166,66.09957],[-53.30161,66.8365],[-53.96911,67.18899],[-52.9804,68.35759],[-51.47536,68.72958],[-51.08041,69.14781],[-50.87122,69.9291],[-52.01359,69.57492],[-52.55792,69.42616],[-53.45629,69.28363],[-54.68336,69.61003],[-54.75001,70.28932],[-54.35884,70.82131],[-53.43132,70.83576],[-51.39014,70.56978],[-53.10937,71.20485],[-54.00422,71.54719],[-55.0,71.40654],[-55.83468,71.65444],[-54.71819,72.58625],[-55.32634,72.95861],[-56.12003,73.64977],[-57.32363,74.71026],[-58.59679,75.09861],[-58.58516,75.51727],[-61.26861,76.10238],[-63.39165,76.1752],[-66.06427,76.13486],[-68.50438,76.06141],[-69.66485,76.37975],[-71.40257,77.00857],[-68.77671,77.32312],[-66.76397,77.37595],[-71.04293,77.63595],[-73.297,78.04419],[-73.15938,78.43271],[-69.37345,78.91388],[-65.7107,79.39436],[-65.3239,79.75814],[-68.02298,80.11721],[-67.15129,80.51582],[-63.68925,81.21396],[-62.23444,81.3211],[-62.65116,81.77042],[-60.28249,82.03363],[-57.20744,82.19074],[-54.13442,82.19962],[-53.04328,81.88833],[-50.39061,82.43883],[-48.00386,82.06481],[-46.59984,81.98595],[-44.523,81.6607],[-46.9007,82.19979],[-46.76379,82.62796],[-43.40644,83.22516],[-39.89753,83.18018],[-38.62214,83.54905],[-35.08787,83.64513],[-27.10046,83.51966]]]]} diff --git a/test/browser/util/browser.js b/test/browser/util/browser.js new file mode 100644 index 00000000000..49071674540 --- /dev/null +++ b/test/browser/util/browser.js @@ -0,0 +1,118 @@ +import tap from 'tap'; +import address from 'address'; +import st from 'st'; +import http from 'http'; + +import webdriver from 'selenium-webdriver'; +const {Builder, By} = webdriver; + +import chrome from 'selenium-webdriver/chrome'; +import firefox from 'selenium-webdriver/firefox'; +import safari from 'selenium-webdriver/safari'; + +import doubleClick from './doubleclick'; +import mouseWheel from './mousewheel'; + +const defaultViewportSize = {width: 800, height: 600}; + +const chromeOptions = new chrome.Options().windowSize(defaultViewportSize); +const firefoxOptions = new firefox.Options().windowSize(defaultViewportSize); +const safariOptions = new safari.Options(); + +if (process.env.SELENIUM_BROWSER && process.env.SELENIUM_BROWSER.split(/:/, 3)[2] === 'android') { + chromeOptions.androidChrome().setPageLoadStrategy('normal'); +} + +const ip = address.ip(); +const port = 9968; + +const browser = { + driver: null, + pixelRatio: 1, + scaleFactor: 1, + basePath: `http://${ip}:${port}`, + getMapCanvas, + doubleClick, + mouseWheel +}; + +export default browser; + +async function getMapCanvas(url) { + await browser.driver.get(url); + + await browser.driver.executeAsyncScript(callback => { + /* eslint-disable no-undef */ + if (map.loaded()) { + callback(); + } else { + map.once("load", () => callback()); + } + }); + + return browser.driver.findElement(By.className('mapboxgl-canvas')); +} + +let server = null; + +tap.test('start server', t => { + server = http.createServer( + st(process.cwd()) + ).listen(port, ip, err => { + if (err) { + t.error(err); + t.bailout(); + } else { + t.ok(true, `Listening at ${ip}:${port}`); + } + t.end(); + }); +}); + +tap.test("start browser", async t => { + try { + // eslint-disable-next-line require-atomic-updates + browser.driver = await new Builder() + .forBrowser("chrome") + .setChromeOptions(chromeOptions) + .setFirefoxOptions(firefoxOptions) + .setSafariOptions(safariOptions) + .build(); + } catch (err) { + t.error(err); + t.bailout(); + } + + const capabilities = await browser.driver.getCapabilities(); + t.ok(true, `platform: ${capabilities.getPlatform()}`); + t.ok(true, `browser: ${capabilities.getBrowserName()}`); + t.ok(true, `version: ${capabilities.getBrowserVersion()}`); + + if (capabilities.getBrowserName() === 'Safari') { + browser.scaleFactor = 2; + } + + const metrics = await browser.driver.executeScript(size => { + /* eslint-disable no-undef */ + return { + width: outerWidth - innerWidth / devicePixelRatio + size.width, + height: outerHeight - innerHeight / devicePixelRatio + size.height, + pixelRatio: devicePixelRatio + }; + }, defaultViewportSize); + browser.pixelRatio = metrics.pixelRatio; + (await browser.driver.manage().window()).setRect({ + width: metrics.width, + height: metrics.height + }); +}); + +tap.tearDown(async () => { + if (browser.driver) { + await browser.driver.quit(); + } + + if (server) { + server.close(); + } +}); diff --git a/test/browser/util/doubleclick.js b/test/browser/util/doubleclick.js new file mode 100644 index 00000000000..bc5cd648034 --- /dev/null +++ b/test/browser/util/doubleclick.js @@ -0,0 +1,30 @@ +// Simulates a double click. Unfortunately, Safari doesn't properly recognize double +// clicks when sent as two subsequent clicks via the WebDriver API. Therefore, we'll +// manually dispatch a double click event for a particular location. + +// Adapted from https://stackoverflow.com/a/47287595/331379 +export default (element, x, y) => { + // Disables modern JS features to maintain IE11/ES5 support. + /* eslint-disable no-var, no-undef, object-shorthand */ + var box = element.getBoundingClientRect(); + var clientX = box.left + (typeof x !== "undefined" ? x : box.width / 2); + var clientY = box.top + (typeof y !== "undefined" ? y : box.height / 2); + var target = element.ownerDocument.elementFromPoint(clientX, clientY); + + for (var e = target; e; e = e.parentElement) { + if (e === element) { + target.dispatchEvent( + new MouseEvent("dblclick", { + view: window, + bubbles: true, + cancelable: true, + clientX: clientX, + clientY: clientY + }) + ); + return null; + } + } + + return "Element is not interactable"; +}; diff --git a/test/browser/util/mousewheel.js b/test/browser/util/mousewheel.js new file mode 100644 index 00000000000..0f7e2ce0497 --- /dev/null +++ b/test/browser/util/mousewheel.js @@ -0,0 +1,45 @@ +// Adapted from https://stackoverflow.com/a/47287595/331379 +export default (element, deltaY, x, y) => { + // Disables modern JS features to maintain IE11/ES5 support. + /* eslint-disable no-var, no-undef, object-shorthand */ + var box = element.getBoundingClientRect(); + var clientX = box.left + (typeof x !== "undefined" ? x : box.width / 2); + var clientY = box.top + (typeof y !== "undefined" ? y : box.height / 2); + var target = element.ownerDocument.elementFromPoint(clientX, clientY); + + for (var e = target; e; e = e.parentElement) { + if (e === element) { + target.dispatchEvent( + new MouseEvent("mouseover", { + view: window, + bubbles: true, + cancelable: true, + clientX: clientX, + clientY: clientY + }) + ); + target.dispatchEvent( + new MouseEvent("mousemove", { + view: window, + bubbles: true, + cancelable: true, + clientX: clientX, + clientY: clientY + }) + ); + target.dispatchEvent( + new WheelEvent("wheel", { + view: window, + bubbles: true, + cancelable: true, + clientX: clientX, + clientY: clientY, + deltaY: deltaY + }) + ); + return null; + } + } + + return "Element is not interactable"; +}; diff --git a/test/browser/zoom.test.js b/test/browser/zoom.test.js new file mode 100644 index 00000000000..a778eb54b2a --- /dev/null +++ b/test/browser/zoom.test.js @@ -0,0 +1,21 @@ +import {test} from '../util/test'; +import browser from './util/browser'; + +test("zooming", async t => { + const {driver} = browser; + + await t.test("double click at the center", async t => { + const canvas = await browser.getMapCanvas(`${browser.basePath}/test/browser/fixtures/land.html`); + + // Double-click on the center of the map. + await driver.executeScript(browser.doubleClick, canvas); + + // Wait until the map has settled, then report the zoom level back. + const zoom = await driver.executeAsyncScript(callback => { + /* eslint-disable no-undef */ + map.once('idle', () => callback(map.getZoom())); + }); + + t.equals(zoom, 2, 'zoomed in by 1 zoom level'); + }); +}); diff --git a/test/build/dev.test.js b/test/build/dev.test.js index 6f5f6876522..6001146d504 100644 --- a/test/build/dev.test.js +++ b/test/build/dev.test.js @@ -3,5 +3,6 @@ import fs from 'fs'; test('dev build contains asserts', (t) => { t.assert(fs.readFileSync('dist/mapbox-gl-dev.js', 'utf8').indexOf('canary assert') !== -1); + t.assert(fs.readFileSync('dist/mapbox-gl-dev.js', 'utf8').indexOf('canary debug run') !== -1); t.end(); }); diff --git a/test/build/min.test.js b/test/build/min.test.js index df13cdf13b8..5cdcda50406 100644 --- a/test/build/min.test.js +++ b/test/build/min.test.js @@ -2,13 +2,14 @@ import {test} from '../util/test'; import fs from 'fs'; import path from 'path'; import reference from '../../src/style-spec/reference/latest'; -import { Linter } from 'eslint'; -import { scripts } from '../../package.json'; +import {Linter} from 'eslint'; +import {scripts} from '../../package.json'; const minBundle = fs.readFileSync('dist/mapbox-gl.js', 'utf8'); test('production build removes asserts', (t) => { t.assert(minBundle.indexOf('canary assert') === -1); + t.assert(minBundle.indexOf('canary debug run') === -1); t.end(); }); diff --git a/test/build/published-flow-types.js b/test/build/published-flow-types.js index 59c6fa03dcc..d691f8d4a80 100644 --- a/test/build/published-flow-types.js +++ b/test/build/published-flow-types.js @@ -1,4 +1,4 @@ -import { test } from '../util/test'; +import {test} from '../util/test'; import cp from 'child_process'; test('downstream projects can consume published flow types', (t) => { diff --git a/test/build/style-spec.test.js b/test/build/style-spec.test.js index 85be336c2fd..4d98121e42d 100644 --- a/test/build/style-spec.test.js +++ b/test/build/style-spec.test.js @@ -8,7 +8,7 @@ const isBuiltin = require('is-builtin-module'); const Linter = require('eslint').Linter; const rollup = require('rollup'); -import { test } from '../util/test'; +import {test} from '../util/test'; import rollupConfig from '../../src/style-spec/rollup.config'; // some paths diff --git a/test/expected/text-shaping-default.json b/test/expected/text-shaping-default.json index bf75ee0d5bb..c46e29fb6c1 100644 --- a/test/expected/text-shaping-default.json +++ b/test/expected/text-shaping-default.json @@ -1,49 +1,124 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 97, - "x": -32.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 98, - "x": -19.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "abcde", @@ -52,6 +127,6 @@ "left": -32.5, "right": 32.5, "writingMode": 1, - "yOffset": -17, - "lineCount": 1 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-images-horizontal.json b/test/expected/text-shaping-images-horizontal.json new file mode 100644 index 00000000000..b0178b19f2b --- /dev/null +++ b/test/expected/text-shaping-images-horizontal.json @@ -0,0 +1,275 @@ +{ + "positionedLines": [ + { + "positionedGlyphs": [ + { + "glyph": 70, + "imageName": null, + "x": -53, + "y": -34.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 18, + "left": 2, + "top": -8, + "advance": 12 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 111, + "imageName": null, + "x": -41, + "y": -34.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 13, + "height": 15, + "left": 1, + "top": -12, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 111, + "imageName": null, + "x": -27, + "y": -34.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 13, + "height": 15, + "left": 1, + "top": -12, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 57344, + "imageName": "square", + "x": -13, + "y": -31.5, + "vertical": false, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 1, + "metrics": { + "width": 14, + "height": 14, + "left": 1, + "top": -3, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 16, + "h": 16 + } + }, + { + "glyph": 57345, + "imageName": "wide", + "x": 8, + "y": -31.5, + "vertical": false, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 2, + "metrics": { + "width": 30, + "height": 14, + "left": 1, + "top": -3, + "advance": 30 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 16 + } + } + ], + "lineOffset": 0 + }, + { + "positionedGlyphs": [ + { + "glyph": 57346, + "imageName": "tall", + "x": -42, + "y": -10.5, + "vertical": false, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 4, + "metrics": { + "width": 14, + "height": 30, + "left": 1, + "top": -3, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 16, + "h": 32 + } + }, + { + "glyph": 57347, + "imageName": "square", + "x": -21, + "y": 13.5, + "vertical": false, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 5, + "metrics": { + "width": 14, + "height": 14, + "left": 1, + "top": -3, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 16, + "h": 16 + } + }, + { + "glyph": 32, + "imageName": null, + "x": 0, + "y": 10.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 6, + "metrics": { + "width": 0, + "height": 0, + "left": 0, + "top": -26, + "advance": 6 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": 6, + "y": 10.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 6, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 97, + "imageName": null, + "x": 20, + "y": 10.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 6, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 114, + "imageName": null, + "x": 33, + "y": 10.5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 6, + "metrics": { + "width": 8, + "height": 14, + "left": 2, + "top": -12, + "advance": 9 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 21 + } + ], + "text": "Foo\n bar", + "top": -34.5, + "bottom": 34.5, + "left": -53, + "right": 53, + "writingMode": 1, + "iconsInText": true, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-images-vertical.json b/test/expected/text-shaping-images-vertical.json new file mode 100644 index 00000000000..1aef4d6fe64 --- /dev/null +++ b/test/expected/text-shaping-images-vertical.json @@ -0,0 +1,160 @@ +{ + "positionedLines": [ + { + "positionedGlyphs": [ + { + "glyph": 19977, + "imageName": null, + "x": -33, + "y": -13.5, + "vertical": true, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 57344, + "imageName": "square", + "x": -9, + "y": -10.5, + "vertical": true, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 1, + "metrics": { + "width": 14, + "height": 14, + "left": 1, + "top": -3, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 16, + "h": 16 + } + }, + { + "glyph": 57345, + "imageName": "wide", + "x": 12, + "y": -10.5, + "vertical": true, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 2, + "metrics": { + "width": 30, + "height": 14, + "left": 1, + "top": -3, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 16 + } + } + ], + "lineOffset": 21 + }, + { + "positionedGlyphs": [ + { + "glyph": 57346, + "imageName": "tall", + "x": -43.5, + "y": -10.5, + "vertical": true, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 4, + "metrics": { + "width": 14, + "height": 30, + "left": 1, + "top": -3, + "advance": 30 + }, + "rect": { + "x": 0, + "y": 0, + "w": 16, + "h": 32 + } + }, + { + "glyph": 57347, + "imageName": "square", + "x": 1.5, + "y": 13.5, + "vertical": true, + "scale": 1.5, + "fontStack": "", + "sectionIndex": 5, + "metrics": { + "width": 14, + "height": 14, + "left": 1, + "top": -3, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 16, + "h": 16 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 22.5, + "y": 10.5, + "vertical": true, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 6, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 + } + ], + "text": "三​三", + "top": -34.5, + "bottom": 34.5, + "left": -45, + "right": 45, + "writingMode": 2, + "iconsInText": true, + "verticalizable": true +} \ No newline at end of file diff --git a/test/expected/text-shaping-linebreak.json b/test/expected/text-shaping-linebreak.json index f0f9b4430b4..c0e69fa3c66 100644 --- a/test/expected/text-shaping-linebreak.json +++ b/test/expected/text-shaping-linebreak.json @@ -1,94 +1,244 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 97, - "x": -32.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 }, { - "glyph": 98, - "x": -19.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 97, - "x": -32.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 98, - "x": -19.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "abcde abcde", @@ -97,6 +247,6 @@ "left": -32.5, "right": 32.5, "writingMode": 1, - "yOffset": -17, - "lineCount": 2 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-newline.json b/test/expected/text-shaping-newline.json index a02ed316308..2eb5df9bba8 100644 --- a/test/expected/text-shaping-newline.json +++ b/test/expected/text-shaping-newline.json @@ -1,94 +1,244 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 97, - "x": -32.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": -29, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 }, { - "glyph": 98, - "x": -19.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": -29, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 97, - "x": -32.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 98, - "x": -19.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": -5, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": -5, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "abcde\nabcde", @@ -97,6 +247,6 @@ "left": -32.5, "right": 32.5, "writingMode": 1, - "yOffset": -17, - "lineCount": 2 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-newlines-in-middle.json b/test/expected/text-shaping-newlines-in-middle.json index 27f1ea28f35..dfcfd638756 100644 --- a/test/expected/text-shaping-newlines-in-middle.json +++ b/test/expected/text-shaping-newlines-in-middle.json @@ -1,94 +1,248 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 97, - "x": -32.5, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 }, { - "glyph": 98, - "x": -19.5, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [], + "lineOffset": 0 }, { - "glyph": 99, - "x": -5.5, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 97, - "x": -32.5, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 98, - "x": -19.5, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 5.5, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 19.5, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -32.5, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -19.5, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 5.5, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 19.5, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "abcde\n\nabcde", @@ -97,6 +251,6 @@ "left": -32.5, "right": 32.5, "writingMode": 1, - "yOffset": -17, - "lineCount": 3 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-null.json b/test/expected/text-shaping-null.json index febc8a01e0b..52a63e9835c 100644 --- a/test/expected/text-shaping-null.json +++ b/test/expected/text-shaping-null.json @@ -1,22 +1,55 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 104, - "x": -10, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 105, - "x": 4, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 104, + "imageName": null, + "x": -10, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 19, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 105, + "imageName": null, + "x": 4, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 4, + "height": 18, + "left": 1, + "top": -8, + "advance": 6 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "hi\u0000", @@ -25,6 +58,6 @@ "left": -10, "right": 10, "writingMode": 1, - "yOffset": -17, - "lineCount": 1 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-spacing.json b/test/expected/text-shaping-spacing.json index 960771413aa..53161f0c8b7 100644 --- a/test/expected/text-shaping-spacing.json +++ b/test/expected/text-shaping-spacing.json @@ -1,49 +1,124 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 97, - "x": -38.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 98, - "x": -22.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 99, - "x": -5.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 100, - "x": 8.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 101, - "x": 25.5, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 97, + "imageName": null, + "x": -38.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 11, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 98, + "imageName": null, + "x": -22.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 2, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 99, + "imageName": null, + "x": -5.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 10, + "height": 15, + "left": 1, + "top": -12, + "advance": 11 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 100, + "imageName": null, + "x": 8.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 20, + "left": 1, + "top": -7, + "advance": 14 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 101, + "imageName": null, + "x": 25.5, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 12, + "height": 15, + "left": 1, + "top": -12, + "advance": 13 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "abcde", @@ -52,6 +127,6 @@ "left": -38.5, "right": 38.5, "writingMode": 1, - "yOffset": -17, - "lineCount": 1 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expected/text-shaping-zero-width-space.json b/test/expected/text-shaping-zero-width-space.json index 85959cc53db..6fc1c2a38a2 100644 --- a/test/expected/text-shaping-zero-width-space.json +++ b/test/expected/text-shaping-zero-width-space.json @@ -1,130 +1,341 @@ { - "positionedGlyphs": [ + "positionedLines": [ { - "glyph": 19977, - "x": -63, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 19977, + "imageName": null, + "x": -63, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": -42, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": -21, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 0, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 21, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 42, + "y": -41, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 }, { - "glyph": 19977, - "x": -42, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 19977, + "imageName": null, + "x": -63, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": -42, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": -21, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 0, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 21, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 42, + "y": -17, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 }, { - "glyph": 19977, - "x": -21, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 0, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 21, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 42, - "y": -41, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": -63, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": -42, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": -21, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 0, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 21, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 42, - "y": -17, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": -21, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 - }, - { - "glyph": 19977, - "x": 0, - "y": 7, - "vertical": false, - "scale": 1, - "fontStack": "Test", - "sectionIndex": 0 + "positionedGlyphs": [ + { + "glyph": 19977, + "imageName": null, + "x": -21, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + }, + { + "glyph": 19977, + "imageName": null, + "x": 0, + "y": 7, + "vertical": false, + "scale": 1, + "fontStack": "Test", + "sectionIndex": 0, + "metrics": { + "width": 18, + "height": 18, + "left": 2, + "top": -8, + "advance": 21 + }, + "rect": { + "x": 0, + "y": 0, + "w": 32, + "h": 32 + } + } + ], + "lineOffset": 0 } ], "text": "三三​三三​三三​三三三三三三​三三", @@ -133,6 +344,6 @@ "left": -63, "right": 63, "writingMode": 1, - "yOffset": -17, - "lineCount": 3 -} + "iconsInText": false, + "verticalizable": false +} \ No newline at end of file diff --git a/test/expression.test.js b/test/expression.test.js index b2c9f4c4843..d58cc480973 100644 --- a/test/expression.test.js +++ b/test/expression.test.js @@ -1,9 +1,71 @@ -import { run } from './integration/lib/expression'; -import { createPropertyExpression } from '../src/style-spec/expression'; -import { isFunction } from '../src/style-spec/function'; +import {run} from './integration/lib/expression'; +import {createPropertyExpression} from '../src/style-spec/expression'; +import {isFunction} from '../src/style-spec/function'; import convertFunction from '../src/style-spec/function/convert'; -import { toString } from '../src/style-spec/expression/types'; +import {toString} from '../src/style-spec/expression/types'; import ignores from './ignores.json'; +import {CanonicalTileID} from '../src/source/tile_id'; +import MercatorCoordinate from '../src/geo/mercator_coordinate'; + +function getPoint(coord, canonical) { + const p = canonical.getTilePoint(MercatorCoordinate.fromLngLat({lng: coord[0], lat: coord[1]}, 0)); + p.x = Math.round(p.x); + p.y = Math.round(p.y); + return p; +} + +function convertPoint(coord, canonical, out) { + out.push([getPoint(coord, canonical)]); +} + +function convertPoints(coords, canonical, out) { + for (let i = 0; i < coords.length; i++) { + convertPoint(coords[i], canonical, out); + } +} + +function convertLine(line, canonical, out) { + const l = []; + for (let i = 0; i < line.length; i++) { + l.push(getPoint(line[i], canonical)); + } + out.push(l); +} + +function convertLines(lines, canonical, out) { + for (let i = 0; i < lines.length; i++) { + convertLine(lines[i], canonical, out); + } +} + +function getGeometry(feature, geometry, canonical) { + if (geometry.coordinates) { + const coords = geometry.coordinates; + const type = geometry.type; + feature.type = type; + feature.geometry = []; + if (type === 'Point') { + convertPoint(coords, canonical, feature.geometry); + } else if (type === 'MultiPoint') { + feature.type = 'Point'; + convertPoints(coords, canonical, feature.geometry); + } else if (type === 'LineString') { + convertLine(coords, canonical, feature.geometry); + } else if (type === 'MultiLineString') { + feature.type = 'LineString'; + convertLines(coords, canonical, feature.geometry); + } else if (type === 'Polygon') { + convertLines(coords, canonical, feature.geometry); + } else if (type === 'MultiPolygon') { + feature.type = 'Polygon'; + for (let i = 0; i < coords.length; i++) { + const polygon = []; + convertLines(coords[i], canonical, polygon); + feature.geometry.push(polygon); + } + } + } +} let tests; @@ -11,8 +73,10 @@ if (process.argv[1] === __filename && process.argv.length > 2) { tests = process.argv.slice(2); } -run('js', { ignores, tests }, (fixture) => { +run('js', {ignores, tests}, (fixture) => { const spec = Object.assign({}, fixture.propertySpec); + let availableImages; + let canonical; if (!spec['property-type']) { spec['property-type'] = 'data-driven'; @@ -47,23 +111,37 @@ run('js', { ignores, tests }, (fixture) => { for (const input of fixture.inputs || []) { try { - const feature = { properties: input[1].properties || {} }; + const feature = {properties: input[1].properties || {}}; + availableImages = input[0].availableImages || []; + if ('canonicalID' in input[0]) { + const id = input[0].canonicalID; + canonical = new CanonicalTileID(id.z, id.x, id.y); + } else { + canonical = null; + } + if ('id' in input[1]) { feature.id = input[1].id; } if ('geometry' in input[1]) { - feature.type = input[1].geometry.type; + if (canonical !== null) { + getGeometry(feature, input[1].geometry, canonical); + } else { + feature.type = input[1].geometry.type; + } } - let value = expression.evaluateWithoutErrorHandling(input[0], feature); + + let value = expression.evaluateWithoutErrorHandling(input[0], feature, {}, canonical, availableImages); + if (type.kind === 'color') { value = [value.r, value.g, value.b, value.a]; } evaluationResult.push(value); } catch (error) { if (error.name === 'ExpressionEvaluationError') { - evaluationResult.push({ error: error.toJSON() }); + evaluationResult.push({error: error.toJSON()}); } else { - evaluationResult.push({ error: error.message }); + evaluationResult.push({error: error.message}); } } } @@ -73,7 +151,7 @@ run('js', { ignores, tests }, (fixture) => { } }; - const result = { compiled: {}, recompiled: {} }; + const result = {compiled: {}, recompiled: {}}; const expression = (() => { if (isFunction(fixture.expression)) { return createPropertyExpression(convertFunction(fixture.expression, spec), spec); @@ -82,7 +160,7 @@ run('js', { ignores, tests }, (fixture) => { } })(); - result.outputs = evaluateExpression(expression, result.compiled); + result.outputs = evaluateExpression(expression, result.compiled, {}, availableImages); if (expression.result === 'success') { result.serialized = expression.value._styleExpression.expression.serialize(); result.roundTripOutputs = evaluateExpression( diff --git a/test/fixtures/fontstack-glyphs.json b/test/fixtures/fontstack-glyphs.json index 7dbbcee7e49..bb8c7967f28 100644 --- a/test/fixtures/fontstack-glyphs.json +++ b/test/fixtures/fontstack-glyphs.json @@ -7,7 +7,8 @@ "left": 0, "top": -26, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "33": { "id": 33, @@ -17,7 +18,8 @@ "left": 1, "top": -8, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "34": { "id": 34, @@ -27,7 +29,8 @@ "left": 1, "top": -8, "advance": 9 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "35": { "id": 35, @@ -37,7 +40,8 @@ "left": 0, "top": -8, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "36": { "id": 36, @@ -47,7 +51,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "37": { "id": 37, @@ -57,7 +62,8 @@ "left": 1, "top": -8, "advance": 19 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "38": { "id": 38, @@ -67,7 +73,8 @@ "left": 1, "top": -8, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "39": { "id": 39, @@ -77,7 +84,8 @@ "left": 1, "top": -8, "advance": 5 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "40": { "id": 40, @@ -87,7 +95,8 @@ "left": 0, "top": -8, "advance": 7 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "41": { "id": 41, @@ -97,7 +106,8 @@ "left": 0, "top": -8, "advance": 7 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "42": { "id": 42, @@ -107,7 +117,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "43": { "id": 43, @@ -117,7 +128,8 @@ "left": 1, "top": -11, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "44": { "id": 44, @@ -127,7 +139,8 @@ "left": 0, "top": -23, "advance": 5 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "45": { "id": 45, @@ -137,7 +150,8 @@ "left": 0, "top": -18, "advance": 7 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "46": { "id": 46, @@ -147,7 +161,8 @@ "left": 1, "top": -23, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "47": { "id": 47, @@ -157,7 +172,8 @@ "left": 0, "top": -8, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "48": { "id": 48, @@ -167,7 +183,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "49": { "id": 49, @@ -177,7 +194,8 @@ "left": 2, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "50": { "id": 50, @@ -187,7 +205,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "51": { "id": 51, @@ -197,7 +216,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "52": { "id": 52, @@ -207,7 +227,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "53": { "id": 53, @@ -217,7 +238,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "54": { "id": 54, @@ -227,7 +249,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "55": { "id": 55, @@ -237,7 +260,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "56": { "id": 56, @@ -247,7 +271,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "57": { "id": 57, @@ -257,7 +282,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "58": { "id": 58, @@ -267,7 +293,8 @@ "left": 1, "top": -12, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "59": { "id": 59, @@ -277,7 +304,8 @@ "left": 0, "top": -12, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "60": { "id": 60, @@ -287,7 +315,8 @@ "left": 1, "top": -11, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "61": { "id": 61, @@ -297,7 +326,8 @@ "left": 1, "top": -14, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "62": { "id": 62, @@ -307,7 +337,8 @@ "left": 1, "top": -11, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "63": { "id": 63, @@ -317,7 +348,8 @@ "left": 0, "top": -8, "advance": 10 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "64": { "id": 64, @@ -327,7 +359,8 @@ "left": 1, "top": -8, "advance": 21 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "65": { "id": 65, @@ -337,7 +370,8 @@ "left": 0, "top": -8, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "66": { "id": 66, @@ -347,7 +381,8 @@ "left": 2, "top": -8, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "67": { "id": 67, @@ -357,7 +392,8 @@ "left": 1, "top": -8, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "68": { "id": 68, @@ -367,7 +403,8 @@ "left": 2, "top": -8, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "69": { "id": 69, @@ -377,7 +414,8 @@ "left": 2, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "70": { "id": 70, @@ -387,7 +425,8 @@ "left": 2, "top": -8, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "71": { "id": 71, @@ -397,7 +436,8 @@ "left": 1, "top": -8, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "72": { "id": 72, @@ -407,7 +447,8 @@ "left": 2, "top": -8, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "73": { "id": 73, @@ -417,7 +458,8 @@ "left": 2, "top": -8, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "74": { "id": 74, @@ -427,7 +469,8 @@ "left": -2, "top": -8, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "75": { "id": 75, @@ -437,7 +480,8 @@ "left": 2, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "76": { "id": 76, @@ -447,7 +491,8 @@ "left": 2, "top": -8, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "77": { "id": 77, @@ -457,7 +502,8 @@ "left": 2, "top": -8, "advance": 21 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "78": { "id": 78, @@ -467,7 +513,8 @@ "left": 2, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "79": { "id": 79, @@ -477,7 +524,8 @@ "left": 1, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "80": { "id": 80, @@ -487,7 +535,8 @@ "left": 2, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "81": { "id": 81, @@ -497,7 +546,8 @@ "left": 1, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "82": { "id": 82, @@ -507,7 +557,8 @@ "left": 2, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "83": { "id": 83, @@ -517,7 +568,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "84": { "id": 84, @@ -527,7 +579,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "85": { "id": 85, @@ -537,7 +590,8 @@ "left": 2, "top": -8, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "86": { "id": 86, @@ -547,7 +601,8 @@ "left": 0, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "87": { "id": 87, @@ -557,7 +612,8 @@ "left": 0, "top": -8, "advance": 22 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "88": { "id": 88, @@ -567,7 +623,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "89": { "id": 89, @@ -577,7 +634,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "90": { "id": 90, @@ -587,7 +645,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "91": { "id": 91, @@ -597,7 +656,8 @@ "left": 1, "top": -8, "advance": 7 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "92": { "id": 92, @@ -607,7 +667,8 @@ "left": 0, "top": -8, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "93": { "id": 93, @@ -617,7 +678,8 @@ "left": 0, "top": -8, "advance": 7 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "94": { "id": 94, @@ -627,7 +689,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "95": { "id": 95, @@ -637,7 +700,8 @@ "left": -1, "top": -28, "advance": 10 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "96": { "id": 96, @@ -647,7 +711,8 @@ "left": 4, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "97": { "id": 97, @@ -657,7 +722,8 @@ "left": 1, "top": -12, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "98": { "id": 98, @@ -667,7 +733,8 @@ "left": 2, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "99": { "id": 99, @@ -677,7 +744,8 @@ "left": 1, "top": -12, "advance": 11 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "100": { "id": 100, @@ -687,7 +755,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "101": { "id": 101, @@ -697,7 +766,8 @@ "left": 1, "top": -12, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "102": { "id": 102, @@ -707,7 +777,8 @@ "left": 0, "top": -7, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "103": { "id": 103, @@ -717,7 +788,8 @@ "left": 0, "top": -12, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "104": { "id": 104, @@ -727,7 +799,8 @@ "left": 2, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "105": { "id": 105, @@ -737,7 +810,8 @@ "left": 1, "top": -8, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "106": { "id": 106, @@ -747,7 +821,8 @@ "left": -2, "top": -8, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "107": { "id": 107, @@ -757,7 +832,8 @@ "left": 2, "top": -7, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "108": { "id": 108, @@ -767,7 +843,8 @@ "left": 2, "top": -7, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "109": { "id": 109, @@ -777,7 +854,8 @@ "left": 2, "top": -12, "advance": 22 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "110": { "id": 110, @@ -787,7 +865,8 @@ "left": 2, "top": -12, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "111": { "id": 111, @@ -797,7 +876,8 @@ "left": 1, "top": -12, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "112": { "id": 112, @@ -807,7 +887,8 @@ "left": 2, "top": -12, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "113": { "id": 113, @@ -817,7 +898,8 @@ "left": 1, "top": -12, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "114": { "id": 114, @@ -827,7 +909,8 @@ "left": 2, "top": -12, "advance": 9 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "115": { "id": 115, @@ -837,7 +920,8 @@ "left": 1, "top": -12, "advance": 11 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "116": { "id": 116, @@ -847,7 +931,8 @@ "left": 0, "top": -10, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "117": { "id": 117, @@ -857,7 +942,8 @@ "left": 1, "top": -13, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "118": { "id": 118, @@ -867,7 +953,8 @@ "left": 0, "top": -13, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "119": { "id": 119, @@ -877,7 +964,8 @@ "left": 0, "top": -13, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "120": { "id": 120, @@ -887,7 +975,8 @@ "left": 0, "top": -13, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "121": { "id": 121, @@ -897,7 +986,8 @@ "left": 0, "top": -13, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "122": { "id": 122, @@ -907,7 +997,8 @@ "left": 0, "top": -13, "advance": 11 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "123": { "id": 123, @@ -917,7 +1008,8 @@ "left": 0, "top": -8, "advance": 9 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "124": { "id": 124, @@ -927,7 +1019,8 @@ "left": 5, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "125": { "id": 125, @@ -937,7 +1030,8 @@ "left": 0, "top": -8, "advance": 9 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "126": { "id": 126, @@ -947,7 +1041,8 @@ "left": 1, "top": -16, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "160": { "id": 160, @@ -957,7 +1052,8 @@ "left": 0, "top": -26, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "161": { "id": 161, @@ -967,7 +1063,8 @@ "left": 1, "top": -12, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "162": { "id": 162, @@ -977,7 +1074,8 @@ "left": 2, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "163": { "id": 163, @@ -987,7 +1085,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "164": { "id": 164, @@ -997,7 +1096,8 @@ "left": 1, "top": -12, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "165": { "id": 165, @@ -1007,7 +1107,8 @@ "left": 0, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "166": { "id": 166, @@ -1017,7 +1118,8 @@ "left": 5, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "167": { "id": 167, @@ -1027,7 +1129,8 @@ "left": 1, "top": -7, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "168": { "id": 168, @@ -1037,7 +1140,8 @@ "left": 3, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "169": { "id": 169, @@ -1047,7 +1151,8 @@ "left": 1, "top": -8, "advance": 19 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "170": { "id": 170, @@ -1057,7 +1162,8 @@ "left": 0, "top": -8, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "171": { "id": 171, @@ -1067,7 +1173,8 @@ "left": 0, "top": -14, "advance": 11 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "172": { "id": 172, @@ -1077,7 +1184,8 @@ "left": 1, "top": -16, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "173": { "id": 173, @@ -1087,7 +1195,8 @@ "left": 0, "top": -18, "advance": 7 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "174": { "id": 174, @@ -1097,7 +1206,8 @@ "left": 1, "top": -8, "advance": 19 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "175": { "id": 175, @@ -1107,7 +1217,8 @@ "left": -1, "top": -6, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "176": { "id": 176, @@ -1117,7 +1228,8 @@ "left": 1, "top": -8, "advance": 10 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "177": { "id": 177, @@ -1127,7 +1239,8 @@ "left": 1, "top": -11, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "178": { "id": 178, @@ -1137,7 +1250,8 @@ "left": 0, "top": -8, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "179": { "id": 179, @@ -1147,7 +1261,8 @@ "left": 0, "top": -8, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "180": { "id": 180, @@ -1157,7 +1272,8 @@ "left": 4, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "181": { "id": 181, @@ -1167,7 +1283,8 @@ "left": 2, "top": -13, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "182": { "id": 182, @@ -1177,7 +1294,8 @@ "left": 1, "top": -7, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "183": { "id": 183, @@ -1187,7 +1305,8 @@ "left": 1, "top": -15, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "184": { "id": 184, @@ -1197,7 +1316,8 @@ "left": 0, "top": -26, "advance": 5 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "185": { "id": 185, @@ -1207,7 +1327,8 @@ "left": 0, "top": -8, "advance": 8 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "186": { "id": 186, @@ -1217,7 +1338,8 @@ "left": 0, "top": -8, "advance": 9 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "187": { "id": 187, @@ -1227,7 +1349,8 @@ "left": 0, "top": -14, "advance": 11 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "188": { "id": 188, @@ -1237,7 +1360,8 @@ "left": 0, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "189": { "id": 189, @@ -1247,7 +1371,8 @@ "left": 0, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "190": { "id": 190, @@ -1257,7 +1382,8 @@ "left": 0, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "191": { "id": 191, @@ -1267,7 +1393,8 @@ "left": 0, "top": -12, "advance": 10 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "192": { "id": 192, @@ -1277,7 +1404,8 @@ "left": 0, "top": -3, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "193": { "id": 193, @@ -1287,7 +1415,8 @@ "left": 0, "top": -3, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "194": { "id": 194, @@ -1297,7 +1426,8 @@ "left": 0, "top": -3, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "195": { "id": 195, @@ -1307,7 +1437,8 @@ "left": 0, "top": -4, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "196": { "id": 196, @@ -1317,7 +1448,8 @@ "left": 0, "top": -4, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "197": { "id": 197, @@ -1327,7 +1459,8 @@ "left": 0, "top": -4, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "198": { "id": 198, @@ -1337,7 +1470,8 @@ "left": -1, "top": -8, "advance": 20 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "199": { "id": 199, @@ -1347,7 +1481,8 @@ "left": 1, "top": -8, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "200": { "id": 200, @@ -1357,7 +1492,8 @@ "left": 2, "top": -3, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "201": { "id": 201, @@ -1367,7 +1503,8 @@ "left": 2, "top": -3, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "202": { "id": 202, @@ -1377,7 +1514,8 @@ "left": 2, "top": -3, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "203": { "id": 203, @@ -1387,7 +1525,8 @@ "left": 2, "top": -4, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "204": { "id": 204, @@ -1397,7 +1536,8 @@ "left": -1, "top": -3, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "205": { "id": 205, @@ -1407,7 +1547,8 @@ "left": 1, "top": -3, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "206": { "id": 206, @@ -1417,7 +1558,8 @@ "left": -1, "top": -3, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "207": { "id": 207, @@ -1427,7 +1569,8 @@ "left": -1, "top": -4, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "208": { "id": 208, @@ -1437,7 +1580,8 @@ "left": 0, "top": -8, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "209": { "id": 209, @@ -1447,7 +1591,8 @@ "left": 2, "top": -4, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "210": { "id": 210, @@ -1457,7 +1602,8 @@ "left": 1, "top": -3, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "211": { "id": 211, @@ -1467,7 +1613,8 @@ "left": 1, "top": -3, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "212": { "id": 212, @@ -1477,7 +1624,8 @@ "left": 1, "top": -3, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "213": { "id": 213, @@ -1487,7 +1635,8 @@ "left": 1, "top": -4, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "214": { "id": 214, @@ -1497,7 +1646,8 @@ "left": 1, "top": -4, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "215": { "id": 215, @@ -1507,7 +1657,8 @@ "left": 1, "top": -12, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "216": { "id": 216, @@ -1517,7 +1668,8 @@ "left": 1, "top": -8, "advance": 18 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "217": { "id": 217, @@ -1527,7 +1679,8 @@ "left": 2, "top": -3, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "218": { "id": 218, @@ -1537,7 +1690,8 @@ "left": 2, "top": -3, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "219": { "id": 219, @@ -1547,7 +1701,8 @@ "left": 2, "top": -3, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "220": { "id": 220, @@ -1557,7 +1712,8 @@ "left": 2, "top": -4, "advance": 17 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "221": { "id": 221, @@ -1567,7 +1723,8 @@ "left": 0, "top": -3, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "222": { "id": 222, @@ -1577,7 +1734,8 @@ "left": 2, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "223": { "id": 223, @@ -1587,7 +1745,8 @@ "left": 2, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "224": { "id": 224, @@ -1597,7 +1756,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "225": { "id": 225, @@ -1607,7 +1767,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "226": { "id": 226, @@ -1617,7 +1778,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "227": { "id": 227, @@ -1627,7 +1789,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "228": { "id": 228, @@ -1637,7 +1800,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "229": { "id": 229, @@ -1647,7 +1811,8 @@ "left": 1, "top": -6, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "230": { "id": 230, @@ -1657,7 +1822,8 @@ "left": 1, "top": -12, "advance": 20 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "231": { "id": 231, @@ -1667,7 +1833,8 @@ "left": 1, "top": -12, "advance": 11 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "232": { "id": 232, @@ -1677,7 +1844,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "233": { "id": 233, @@ -1687,7 +1855,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "234": { "id": 234, @@ -1697,7 +1866,8 @@ "left": 1, "top": -7, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "235": { "id": 235, @@ -1707,7 +1877,8 @@ "left": 1, "top": -8, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "236": { "id": 236, @@ -1717,7 +1888,8 @@ "left": -1, "top": -7, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "237": { "id": 237, @@ -1727,7 +1899,8 @@ "left": 1, "top": -7, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "238": { "id": 238, @@ -1737,7 +1910,8 @@ "left": -1, "top": -7, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "239": { "id": 239, @@ -1747,7 +1921,8 @@ "left": -1, "top": -8, "advance": 6 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "240": { "id": 240, @@ -1757,7 +1932,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "241": { "id": 241, @@ -1767,7 +1943,8 @@ "left": 2, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "242": { "id": 242, @@ -1777,7 +1954,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "243": { "id": 243, @@ -1787,7 +1965,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "244": { "id": 244, @@ -1797,7 +1976,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "245": { "id": 245, @@ -1807,7 +1987,8 @@ "left": 1, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "246": { "id": 246, @@ -1817,7 +1998,8 @@ "left": 1, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "247": { "id": 247, @@ -1827,7 +2009,8 @@ "left": 1, "top": -12, "advance": 13 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "248": { "id": 248, @@ -1837,7 +2020,8 @@ "left": 1, "top": -12, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "249": { "id": 249, @@ -1847,7 +2031,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "250": { "id": 250, @@ -1857,7 +2042,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "251": { "id": 251, @@ -1867,7 +2053,8 @@ "left": 1, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "252": { "id": 252, @@ -1877,7 +2064,8 @@ "left": 1, "top": -8, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "253": { "id": 253, @@ -1887,7 +2075,8 @@ "left": 0, "top": -7, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "254": { "id": 254, @@ -1897,7 +2086,8 @@ "left": 2, "top": -7, "advance": 14 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "255": { "id": 255, @@ -1907,7 +2097,8 @@ "left": 0, "top": -8, "advance": 12 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "256": { "id": 256, @@ -1917,7 +2108,8 @@ "left": 0, "top": -5, "advance": 15 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} }, "19977": { "id": 19977, @@ -1927,6 +2119,7 @@ "left": 2, "top": -8, "advance": 21 - } + }, + "rect": {"x": 0, "y": 0, "w": 32, "h": 32} } } diff --git a/test/ignores.json b/test/ignores.json index f571afc52c7..40fb7d909fa 100644 --- a/test/ignores.json +++ b/test/ignores.json @@ -1,9 +1,10 @@ { "query-tests/regressions/mapbox-gl-js#4494": "https://github.com/mapbox/mapbox-gl-js/issues/2716", "render-tests/geojson/inline-linestring-fill": "current behavior is arbitrary", + "render-tests/line-dasharray/case/square": "https://github.com/mapbox/mapbox-gl-js/issues/9531", "render-tests/map-mode/static": "https://github.com/mapbox/mapbox-gl-js/issues/5649", - "render-tests/map-mode/tile": "skip - mapbox-gl-js does not need to render tiles", - "render-tests/map-mode/tile-avoid-edges": "skip - mapbox-gl-js does not need to render tiles", + "render-tests/map-mode/tile": "skip - mapbox-gl-js does not support tile-mode", + "render-tests/map-mode/tile-avoid-edges": "skip - mapbox-gl-js does not support tile-mode", "render-tests/projection/axonometric": "axonometric rendering in gl-js tbd", "render-tests/projection/axonometric-multiple": "axonometric rendering in gl-js tbd", "render-tests/projection/skew": "axonometric rendering in gl-js tbd", @@ -12,17 +13,17 @@ "render-tests/runtime-styling/image-update-pattern": "skip - https://github.com/mapbox/mapbox-gl-js/issues/4804", "render-tests/mixed-zoom/z10-z11": "current behavior conflicts with https://github.com/mapbox/mapbox-gl-js/pull/6803. can be fixed when https://github.com/mapbox/api-maps/issues/1480 is done", "render-tests/fill-extrusion-pattern/tile-buffer": "https://github.com/mapbox/mapbox-gl-js/issues/4403", + "render-tests/symbol-placement/line-center-tile-map-mode": "skip - mapbox-gl-js does not support tile-mode", + "render-tests/symbol-placement/line-center-buffer-tile-map-mode": "skip - mapbox-gl-js does not support tile-mode", "render-tests/symbol-sort-key/text-ignore-placement": "skip - text drawn over icons", - "render-tests/icon-text-fit/both-padding": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/icon-text-fit/both": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/icon-text-fit/height-padding": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/icon-text-fit/height": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/icon-text-fit/placement-line": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/icon-text-fit/width-padding": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/icon-text-fit/width": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/regressions/mapbox-gl-js#5631": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/text-variable-anchor/all-anchors-icon-text-fit": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/text-variable-anchor/icon-text-fit-collision-box": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit": "https://github.com/mapbox/mapbox-gl-js/issues/8583", - "render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit": "https://github.com/mapbox/mapbox-gl-js/issues/8583" + "render-tests/text-variable-anchor/remember-last-placement": "skip - not sure this is correct behavior", + "render-tests/icon-image/icon-sdf-non-sdf-one-layer": "skip - render sdf icon and normal icon in one layer", + "render-tests/text-variable-anchor/all-anchors-tile-map-mode": "skip - mapbox-gl-js does not support tile-mode", + "render-tests/fill-pattern/update-feature-state": "https://github.com/mapbox/mapbox-gl-js/issues/7207", + "render-tests/text-size/zero": "https://github.com/mapbox/mapbox-gl-js/issues/9161", + "render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode": "skip - mapbox-gl-js does not support tile-mode", + "render-tests/tile-mode/streets-v11": "skip - mapbox-gl-js does not support tile-mode", + "render-tests/within/paint-line": "https://github.com/mapbox/mapbox-gl-js/issues/7023", + "render-tests/icon-text-fit/text-variable-anchor-tile-map-mode": "skip - mapbox-gl-js does not support tile-mode", + "render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode": "skip - mapbox-gl-js does not support tile-mode" } diff --git a/test/integration/README.md b/test/integration/README.md index 6553ee324bd..77c43e037bf 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -6,7 +6,7 @@ These integration tests verify the correctness and consistency of [mapbox-gl-js] Tests are contained in a directory tree, generally organized by [style specification](https://github.com/mapbox/mapbox-gl-style-spec) property: `background-color`, `line-width`, etc., with a second level of directories below that for individual tests. For example, the test for specifying a literal `circle-radius` value lives in [`test/integration/render-tests/circle-radius/literal/`](https://github.com/mapbox/mapbox-gl-js/tree/master/test/integration/render-tests/circle-radius/literal). -Within a leaf directory is a `style.json` file (e.g. [`circle-radius/literal/style.json`](https://github.com/mapbox/mapbox-gl-js/blob/master/test/integration/render-tests/circle-radius/literal/style.json)), which contains the minimal style needed for the given test case. The style can specify the map size, center, bearing, and pitch, and additional test metadata (e.g. output image dimensions). +Within a leaf directory is a `style.json` file (e.g. [`circle-radius/literal/style.json`](https://github.com/mapbox/mapbox-gl-js/blob/master/test/integration/render-tests/circle-radius/literal/style.json)), which contains the minimal style needed for the given test case. The style can specify the map size, center, bearing, and pitch, and additional test metadata (e.g. output image dimensions). The expected output for a given test case is in `expected.png`, e.g. [`circle-radius/literal/expected.png`](https://github.com/mapbox/mapbox-gl-js/blob/master/test/integration/render-tests/circle-radius/literal/expected.png). @@ -22,14 +22,14 @@ To run the entire integration test suite (both render or query tests), from with yarn run test-suite ``` -To run only the render/query tests: +To run only the render/query tests: ``` yarn run test-render ``` -or +or ``` -yarn run test-query +yarn run test-query-node ``` ### Running specific tests @@ -72,6 +72,44 @@ or open ./test/integration/query-tests/index.html ``` +## Running tests in the browser + +Query tests can be run in the browser, the server for serving up the test page and test fixtures starts when you run +``` +yarn run start +``` +OR +``` +yarn run start-debug +``` + +If you want to run only the test server run: +``` +yarn run watch-query +``` + +Then open the following url in the browser of your choice to start running the tests. +``` +http://localhost:7357/ +``` + +### Running specific tests + +A filter can be specified by using the `filter` query param in the url. E.g, adding +``` +?filter=circle-pitch +``` +to the end of the url will only run the tests that contain `circle-pitch` in the name. + +### Build Notifications + +The terminal window can be very noisy with both the build and the test servers running in the same session. +So the server uses platform notifications to inform when the build has finished. If this behaviour is annoying, it can be disabled by setting the following env-var +``` +DISABLE_BUILD_NOTIFICATIONS=true +``` + + ## Writing new tests _Note: Expected results are always generated with the **js** implementation. This is merely for consistency and does not @@ -88,7 +126,7 @@ To add a new render test: ``` The test will appear to fail, but you'll now see a new `expected.png` in the test directory. -4. Manually inspect `expected.png` to verify it looks as expected, and optionally run the test again without the update flag (`yarn run test-render /`) to watch it pass (enjoy that dopamine kick!) +4. Manually inspect `expected.png` to verify it looks as expected, and optionally run the test again without the update flag (`yarn run test-render /`) to watch it pass (enjoy that dopamine kick!) 5. Commit the new `style.json` and `expected.png` :rocket: diff --git a/test/integration/dist/.gitkeep b/test/integration/dist/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/integration/expression-tests/format/basic/test.json b/test/integration/expression-tests/format/basic/test.json index d4a9a32010b..3f6eeaddc55 100644 --- a/test/integration/expression-tests/format/basic/test.json +++ b/test/integration/expression-tests/format/basic/test.json @@ -40,24 +40,28 @@ "sections": [ { "text": "a", + "image": null, "scale": null, "fontStack": null, "textColor": null }, { "text": "b", + "image": null, "scale": 2, "fontStack": null, "textColor": null }, { "text": "c", + "image": null, "scale": null, "fontStack": "a,b", "textColor": null }, { "text": "d", + "image": null, "scale": null, "fontStack": null, "textColor": {"r":0,"g":1,"b":0,"a":1} diff --git a/test/integration/expression-tests/format/coercion/test.json b/test/integration/expression-tests/format/coercion/test.json index 60980b55672..213eb961575 100644 --- a/test/integration/expression-tests/format/coercion/test.json +++ b/test/integration/expression-tests/format/coercion/test.json @@ -21,18 +21,21 @@ "sections": [ { "text": "a", + "image": null, "scale": null, "fontStack": null, "textColor": null }, { "text": "1", + "image": null, "scale": null, "fontStack": null, "textColor": null }, { "text": "true", + "image": null, "scale": null, "fontStack": null, "textColor": null diff --git a/test/integration/expression-tests/format/data-driven-font/test.json b/test/integration/expression-tests/format/data-driven-font/test.json index dc0793d3169..c81fff8e8f1 100644 --- a/test/integration/expression-tests/format/data-driven-font/test.json +++ b/test/integration/expression-tests/format/data-driven-font/test.json @@ -22,6 +22,7 @@ "sections": [ { "text": "a", + "image": null, "scale": 1.5, "fontStack": null, "textColor": null @@ -32,6 +33,7 @@ "sections": [ { "text": "a", + "image": null, "scale": 0.5, "fontStack": null, "textColor": null diff --git a/test/integration/expression-tests/format/image-sections/test.json b/test/integration/expression-tests/format/image-sections/test.json new file mode 100644 index 00000000000..63f40ec477c --- /dev/null +++ b/test/integration/expression-tests/format/image-sections/test.json @@ -0,0 +1,54 @@ +{ + "expression": [ + "format", + ["image", "monument-15"], + ["image", "beach-11"] + ], + "inputs": [ + [ + {"availableImages": ["monument-15"]}, + {} + ] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": true, + "isZoomConstant": true, + "type": "formatted" + }, + "outputs": [ + { + "sections": [ + { + "text": "", + "image": {"name": "monument-15", "available": true}, + "scale": null, + "fontStack": null, + "textColor": null + }, + { + "text": "", + "image": {"name": "beach-11", "available": false}, + "scale": null, + "fontStack": null, + "textColor": null + } + ] + } + ], + "serialized": [ + "format", + [ + "image", + "monument-15" + ], + {}, + [ + "image", + "beach-11" + ], + {} + ] + } +} diff --git a/test/integration/expression-tests/format/implicit-coerce/test.json b/test/integration/expression-tests/format/implicit-coerce/test.json index 24533043cdd..6b0877bc6a9 100644 --- a/test/integration/expression-tests/format/implicit-coerce/test.json +++ b/test/integration/expression-tests/format/implicit-coerce/test.json @@ -20,6 +20,7 @@ "sections": [ { "text": "", + "image": null, "scale": null, "fontStack": null, "textColor": null @@ -30,6 +31,7 @@ "sections": [ { "text": "0", + "image": null, "scale": null, "fontStack": null, "textColor": null @@ -40,6 +42,7 @@ "sections": [ { "text": "a", + "image": null, "scale": null, "fontStack": null, "textColor": null diff --git a/test/integration/expression-tests/format/implicit-omit/test.json b/test/integration/expression-tests/format/implicit-omit/test.json index 01d9f9e9d6f..c586958ede4 100644 --- a/test/integration/expression-tests/format/implicit-omit/test.json +++ b/test/integration/expression-tests/format/implicit-omit/test.json @@ -20,6 +20,7 @@ "sections": [ { "text": "", + "image": null, "scale": null, "fontStack": null, "textColor": null @@ -30,6 +31,7 @@ "sections": [ { "text": "0", + "image": null, "scale": null, "fontStack": null, "textColor": null @@ -40,6 +42,7 @@ "sections": [ { "text": "a", + "image": null, "scale": null, "fontStack": null, "textColor": null diff --git a/test/integration/expression-tests/format/implicit/test.json b/test/integration/expression-tests/format/implicit/test.json index f9e2a151cce..097bdf814e4 100644 --- a/test/integration/expression-tests/format/implicit/test.json +++ b/test/integration/expression-tests/format/implicit/test.json @@ -20,6 +20,7 @@ "sections": [ { "text": "", + "image": null, "scale": null, "fontStack": null, "textColor": null @@ -30,6 +31,7 @@ "sections": [ { "text": "0", + "image": null, "scale": null, "fontStack": null, "textColor": null @@ -40,6 +42,7 @@ "sections": [ { "text": "a", + "image": null, "scale": null, "fontStack": null, "textColor": null diff --git a/test/integration/expression-tests/image/basic/test.json b/test/integration/expression-tests/image/basic/test.json new file mode 100644 index 00000000000..797966e7e7f --- /dev/null +++ b/test/integration/expression-tests/image/basic/test.json @@ -0,0 +1,27 @@ +{ + "expression": [ + "image", + "monument-15" + ], + "inputs": [ + [ + {"availableImages": ["monument-15"]}, + {} + ] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": true, + "isZoomConstant": true, + "type": "resolvedImage" + }, + "outputs": [ + {"name":"monument-15","available":true} + ], + "serialized": [ + "image", + "monument-15" + ] + } +} diff --git a/test/integration/expression-tests/image/coalesce/test.json b/test/integration/expression-tests/image/coalesce/test.json new file mode 100644 index 00000000000..75f168207eb --- /dev/null +++ b/test/integration/expression-tests/image/coalesce/test.json @@ -0,0 +1,29 @@ +{ + "expression": ["coalesce", ["image", "foo"], ["image", "bar"], ["image", "monument-15"]], + "propertySpec": { + "type": "resolvedImage" + }, + "inputs": [ + [ + {"availableImages": ["monument-15"]}, + {} + ] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": true, + "isZoomConstant": true, + "type": "resolvedImage" + }, + "outputs": [ + {"name":"monument-15","available":true} + ], + "serialized": [ + "coalesce", + ["image", "foo"], + ["image", "bar"], + ["image", "monument-15"] + ] + } +} diff --git a/test/integration/expression-tests/image/compound/test.json b/test/integration/expression-tests/image/compound/test.json new file mode 100644 index 00000000000..0b2b8bbcf28 --- /dev/null +++ b/test/integration/expression-tests/image/compound/test.json @@ -0,0 +1,29 @@ +{ + "expression": [ + "image", + ["get", "icon"] + ], + "inputs": [ + [ + {"availableImages": ["monument-15"]}, + { + "properties": {"icon": "monument-15"} + } + ] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "resolvedImage" + }, + "outputs": [ + {"name":"monument-15","available":true} + ], + "serialized": [ + "image", + ["string", ["get", "icon"]] + ] + } +} diff --git a/test/integration/expression-tests/image/implicit-assert/test.json b/test/integration/expression-tests/image/implicit-assert/test.json new file mode 100644 index 00000000000..beb6630d537 --- /dev/null +++ b/test/integration/expression-tests/image/implicit-assert/test.json @@ -0,0 +1,14 @@ +{ + "expression": ["number", ["get", "icon"]], + "propertySpec": { + "type": "resolvedImage" + }, + "expected": { + "compiled": { + "result": "error", + "errors": [ + {"key": "", "error": "Expected resolvedImage but found number instead."} + ] + } + } +} diff --git a/test/integration/expression-tests/in/assert-array/test.json b/test/integration/expression-tests/in/assert-array/test.json new file mode 100644 index 00000000000..2aaf19b5064 --- /dev/null +++ b/test/integration/expression-tests/in/assert-array/test.json @@ -0,0 +1,32 @@ +{ + "expression": [ + "boolean", + ["in", ["get", "i"], ["array", ["get", "arr"]]] + ], + "inputs": [ + [{}, {"properties": {"i": null, "arr": [9, 8, 7]}}], + [{}, {"properties": {"i": 1, "arr": [9, 8, 7]}}], + [{}, {"properties": {"i": 9, "arr": [9, 8, 7]}}], + [{}, {"properties": {"i": null, "arr": [9, 8, 7, null]}}], + [{}, {"properties": {"i": 1, "arr": null}}] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "boolean" + }, + "outputs": [ + false, + false, + true, + true, + {"error":"Expected value to be of type array, but found null instead."} + ], + "serialized": [ + "boolean", + ["in", ["get", "i"], ["array", ["get", "arr"]]] + ] + } +} diff --git a/test/integration/expression-tests/in/assert-string/test.json b/test/integration/expression-tests/in/assert-string/test.json new file mode 100644 index 00000000000..ce59df2ab02 --- /dev/null +++ b/test/integration/expression-tests/in/assert-string/test.json @@ -0,0 +1,30 @@ +{ + "expression": [ + "boolean", + ["in", ["get", "substr"], ["string", ["get", "str"]]] + ], + "inputs": [ + [{}, {"properties": {"substr": null, "str": "helloworld"}}], + [{}, {"properties": {"substr": "foo", "str": "helloworld"}}], + [{}, {"properties": {"substr": "low", "str": "helloworld"}}], + [{}, {"properties": {"substr": "low", "str": null}}] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "boolean" + }, + "outputs": [ + false, + false, + true, + {"error":"Expected value to be of type string, but found null instead."} + ], + "serialized": [ + "boolean", + ["in", ["get", "substr"], ["string", ["get", "str"]]] + ] + } +} diff --git a/test/integration/expression-tests/in/basic-array/test.json b/test/integration/expression-tests/in/basic-array/test.json new file mode 100644 index 00000000000..2bdd62bd061 --- /dev/null +++ b/test/integration/expression-tests/in/basic-array/test.json @@ -0,0 +1,36 @@ +{ + "expression": [ + "boolean", + ["in", ["get", "i"], ["get", "arr"]] + ], + "inputs": [ + [{}, {"properties": {"i": null, "arr": [9, 8, 7]}}], + [{}, {"properties": {"i": 1, "arr": [9, 8, 7]}}], + [{}, {"properties": {"i": 9, "arr": [9, 8, 7]}}], + [{}, {"properties": {"i": "foo", "arr": ["baz", "bar", "hello", "foo", "world"]}}], + [{}, {"properties": {"i": true, "arr": ["foo", 123, null, 456, false, {}, true]}}], + [{}, {"properties": {"i": null, "arr": ["foo", 123, null, 456, false, {}, true]}}], + [{}, {"properties": {"i": 1, "arr": null}}] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "boolean" + }, + "outputs": [ + false, + false, + true, + true, + true, + true, + false + ], + "serialized": [ + "boolean", + ["in", ["get", "i"], ["get", "arr"]] + ] + } +} diff --git a/test/integration/expression-tests/in/basic-string/test.json b/test/integration/expression-tests/in/basic-string/test.json new file mode 100644 index 00000000000..728f1d0846a --- /dev/null +++ b/test/integration/expression-tests/in/basic-string/test.json @@ -0,0 +1,36 @@ +{ + "expression": [ + "boolean", + ["in", ["get", "substr"], ["get", "str"]] + ], + "inputs": [ + [{}, {"properties": {"substr": null, "str": "helloworld"}}], + [{}, {"properties": {"substr": "foo", "str": "helloworld"}}], + [{}, {"properties": {"substr": "low", "str": "helloworld"}}], + [{}, {"properties": {"substr": true, "str": "falsetrue"}}], + [{}, {"properties": {"substr": false, "str": "falsetrue"}}], + [{}, {"properties": {"substr": 123, "str": "hello123world"}}], + [{}, {"properties": {"substr": "low", "str": null}}] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "boolean" + }, + "outputs": [ + false, + false, + true, + true, + true, + true, + false + ], + "serialized": [ + "boolean", + ["in", ["get", "substr"], ["get", "str"]] + ] + } +} diff --git a/test/integration/expression-tests/in/invalid-haystack/test.json b/test/integration/expression-tests/in/invalid-haystack/test.json new file mode 100644 index 00000000000..f855578eb8d --- /dev/null +++ b/test/integration/expression-tests/in/invalid-haystack/test.json @@ -0,0 +1,28 @@ +{ + "expression": [ + "boolean", + ["in", ["get", "needle"], ["get", "haystack"]] + ], + "inputs": [ + [{}, {"properties": {"needle": 1, "haystack": 123}}], + [{}, {"properties": {"needle": "foo", "haystack": {}}}], + [{}, {"properties": {"needle": "foo", "haystack": null}}] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "boolean" + }, + "outputs": [ + {"error":"Expected second argument to be of type array or string, but found number instead."}, + {"error":"Expected second argument to be of type array or string, but found object instead."}, + false + ], + "serialized": [ + "boolean", + ["in", ["get", "needle"], ["get", "haystack"]] + ] + } +} diff --git a/test/integration/expression-tests/in/invalid-needle/test.json b/test/integration/expression-tests/in/invalid-needle/test.json new file mode 100644 index 00000000000..e70ee8b12f1 --- /dev/null +++ b/test/integration/expression-tests/in/invalid-needle/test.json @@ -0,0 +1,26 @@ +{ + "expression": [ + "boolean", + ["in", ["get", "needle"], ["get", "haystack"]] + ], + "inputs": [ + [{}, {"properties": {"needle": {}, "haystack": [9, 8, 7]}}], + [{}, {"properties": {"needle": {}, "haystack": "helloworld"}}] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "boolean" + }, + "outputs": [ + {"error":"Expected first argument to be of type boolean, string, number or null, but found object instead."}, + {"error":"Expected first argument to be of type boolean, string, number or null, but found object instead."} + ], + "serialized": [ + "boolean", + ["in", ["get", "needle"], ["get", "haystack"]] + ] + } +} diff --git a/test/integration/expression-tests/index-of/assert-array/test.json b/test/integration/expression-tests/index-of/assert-array/test.json new file mode 100644 index 00000000000..eb8db5fc0ca --- /dev/null +++ b/test/integration/expression-tests/index-of/assert-array/test.json @@ -0,0 +1,26 @@ +{ + "expression": ["index-of", ["get", "i"], ["array", ["get", "arr"]]], + "inputs": [ + [{}, { "properties": { "i": null, "arr": [9, 8, 7] } }], + [{}, { "properties": { "i": null, "arr": [9, 8, 7, null] } }], + [{}, { "properties": { "i": 1, "arr": [9, 8, 7] } }], + [{}, { "properties": { "i": 9, "arr": [9, 8, 7, 9] } }], + [{}, { "properties": { "i": 1, "arr": null } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + -1, + 3, + -1, + 0, + { "error": "Expected value to be of type array, but found null instead." } + ], + "serialized": ["index-of", ["get", "i"], ["array", ["get", "arr"]]] + } +} diff --git a/test/integration/expression-tests/index-of/assert-string/test.json b/test/integration/expression-tests/index-of/assert-string/test.json new file mode 100644 index 00000000000..169c9808aef --- /dev/null +++ b/test/integration/expression-tests/index-of/assert-string/test.json @@ -0,0 +1,26 @@ +{ + "expression": ["index-of", ["get", "substr"], ["string", ["get", "str"]]], + "inputs": [ + [{}, { "properties": { "substr": null, "str": "helloworld" } }], + [{}, { "properties": { "substr": "foo", "str": "helloworld" } }], + [{}, { "properties": { "substr": "low", "str": "helloworld" } }], + [{}, { "properties": { "substr": "low", "str": null } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + -1, + -1, + 3, + { + "error": "Expected value to be of type string, but found null instead." + } + ], + "serialized": ["index-of", ["get", "substr"], ["string", ["get", "str"]]] + } +} diff --git a/test/integration/expression-tests/index-of/basic-array/test.json b/test/integration/expression-tests/index-of/basic-array/test.json new file mode 100644 index 00000000000..ec4c61c5a9b --- /dev/null +++ b/test/integration/expression-tests/index-of/basic-array/test.json @@ -0,0 +1,46 @@ +{ + "expression": ["index-of", ["get", "i"], ["get", "arr"]], + "inputs": [ + [{}, { "properties": { "i": null, "arr": [9, 8, 7] } }], + [{}, { "properties": { "i": 1, "arr": [9, 8, 7] } }], + [{}, { "properties": { "i": 9, "arr": [9, 8, 7] } }], + [ + {}, + { + "properties": { + "i": "foo", + "arr": ["baz", "bar", "hello", "foo", "world"] + } + } + ], + [ + {}, + { + "properties": { + "i": true, + "arr": ["foo", 123, null, 456, false, {}, true] + } + } + ], + [{}, { "properties": { "i": 1, "arr": null } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + -1, + -1, + 0, + 3, + 6, + { + "error": "Expected second argument to be of type array or string, but found null instead." + } + ], + "serialized": ["index-of", ["get", "i"], ["get", "arr"]] + } +} diff --git a/test/integration/expression-tests/index-of/basic-string/test.json b/test/integration/expression-tests/index-of/basic-string/test.json new file mode 100644 index 00000000000..3e27a80d168 --- /dev/null +++ b/test/integration/expression-tests/index-of/basic-string/test.json @@ -0,0 +1,32 @@ +{ + "expression": ["index-of", ["get", "substr"], ["get", "str"]], + "inputs": [ + [{}, { "properties": { "substr": null, "str": "helloworld" } }], + [{}, { "properties": { "substr": "foo", "str": "helloworld" } }], + [{}, { "properties": { "substr": "low", "str": "helloworld" } }], + [{}, { "properties": { "substr": true, "str": "falsetrue" } }], + [{}, { "properties": { "substr": false, "str": "falsetrue" } }], + [{}, { "properties": { "substr": 123, "str": "hello123world" } }], + [{}, { "properties": { "substr": "low", "str": null } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + -1, + -1, + 3, + 5, + 0, + 5, + { + "error": "Expected second argument to be of type array or string, but found null instead." + } + ], + "serialized": ["index-of", ["get", "substr"], ["get", "str"]] + } +} diff --git a/test/integration/expression-tests/index-of/invalid-haystack/test.json b/test/integration/expression-tests/index-of/invalid-haystack/test.json new file mode 100644 index 00000000000..519d706cbc1 --- /dev/null +++ b/test/integration/expression-tests/index-of/invalid-haystack/test.json @@ -0,0 +1,28 @@ +{ + "expression": ["index-of", ["get", "needle"], ["get", "haystack"]], + "inputs": [ + [{}, { "properties": { "needle": 1, "haystack": 123 } }], + [{}, { "properties": { "needle": "foo", "haystack": {} } }], + [{}, { "properties": { "needle": "foo", "haystack": null } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + { + "error": "Expected second argument to be of type array or string, but found number instead." + }, + { + "error": "Expected second argument to be of type array or string, but found object instead." + }, + { + "error": "Expected second argument to be of type array or string, but found null instead." + } + ], + "serialized": ["index-of", ["get", "needle"], ["get", "haystack"]] + } +} diff --git a/test/integration/expression-tests/index-of/invalid-needle/test.json b/test/integration/expression-tests/index-of/invalid-needle/test.json new file mode 100644 index 00000000000..c74a3489d3a --- /dev/null +++ b/test/integration/expression-tests/index-of/invalid-needle/test.json @@ -0,0 +1,24 @@ +{ + "expression": ["index-of", ["get", "needle"], ["get", "haystack"]], + "inputs": [ + [{}, { "properties": { "needle": {}, "haystack": [9, 8, 7] } }], + [{}, { "properties": { "needle": {}, "haystack": "helloworld" } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + { + "error": "Expected first argument to be of type boolean, string, number or null, but found object instead." + }, + { + "error": "Expected first argument to be of type boolean, string, number or null, but found object instead." + } + ], + "serialized": ["index-of", ["get", "needle"], ["get", "haystack"]] + } +} diff --git a/test/integration/expression-tests/index-of/with-from-index/test.json b/test/integration/expression-tests/index-of/with-from-index/test.json new file mode 100644 index 00000000000..e168817f569 --- /dev/null +++ b/test/integration/expression-tests/index-of/with-from-index/test.json @@ -0,0 +1,43 @@ +{ + "expression": ["index-of", ["get", "needle"], ["get", "hay"], ["get", "i"]], + "inputs": [ + [{}, { "properties": { "needle": null, "hay": "helloworld", "i": 0 } }], + [{}, { "properties": { "needle": "foo", "hay": "helloworld", "i": 0 } }], + [{}, { "properties": { "needle": "low", "hay": "helloworldlow", "i": 4 } }], + [{}, { "properties": { "needle": true, "hay": "falsetruetrue", "i": 6 } }], + [{}, { "properties": { "needle": false, "hay": "falsetrue", "i": 0 } }], + [{}, { "properties": { "needle": 123, "hay": "hello123world", "i": 6 } }], + [{}, { "properties": { "needle": "low", "hay": null, "i": 0 } }], + [{}, { "properties": { "needle": 7, "hay": [9, 8, 7, 8, 7, 7], "i": 3 } }], + [{}, { "properties": { "needle": 9, "hay": [9, 8, 7, 8, 7, 7], "i": 1 } }], + [{}, { "properties": { "needle": 8, "hay": [9, 8, 7, 8, 7, 7], "i": 1 } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "number" + }, + "outputs": [ + -1, + -1, + 10, + 9, + 0, + -1, + { + "error": "Expected second argument to be of type array or string, but found null instead." + }, + 4, + -1, + 1 + ], + "serialized": [ + "index-of", + ["get", "needle"], + ["get", "hay"], + ["number", ["get", "i"]] + ] + } +} diff --git a/test/integration/expression-tests/slice/array-one-index/test.json b/test/integration/expression-tests/slice/array-one-index/test.json new file mode 100644 index 00000000000..485cc3cd599 --- /dev/null +++ b/test/integration/expression-tests/slice/array-one-index/test.json @@ -0,0 +1,23 @@ +{ + "expression": ["slice", ["array", ["get", "val"]], ["get", "index"]], + "inputs": [ + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "index": 2 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "index": 0 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "index": 99 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "index": -2 } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "array" + }, + "outputs": [[3, 4, 5], [1, 2, 3, 4, 5], [], [4, 5]], + "serialized": [ + "slice", + ["array", ["get", "val"]], + ["number", ["get", "index"]] + ] + } +} diff --git a/test/integration/expression-tests/slice/array-two-indexes/test.json b/test/integration/expression-tests/slice/array-two-indexes/test.json new file mode 100644 index 00000000000..3cf98723e15 --- /dev/null +++ b/test/integration/expression-tests/slice/array-two-indexes/test.json @@ -0,0 +1,31 @@ +{ + "expression": [ + "slice", + ["array", ["get", "val"]], + ["get", "i1"], + ["get", "i2"] + ], + "inputs": [ + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "i1": 2, "i2": 4 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "i1": 1, "i2": 5 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "i1": 1, "i2": 99 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "i1": -4, "i2": -2 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "i1": 0, "i2": -1 } }], + [{}, { "properties": { "val": [1, 2, 3, 4, 5], "i1": 0, "i2": 0 } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "array" + }, + "outputs": [[3, 4], [2, 3, 4, 5], [2, 3, 4, 5], [2, 3], [1, 2, 3, 4], []], + "serialized": [ + "slice", + ["array", ["get", "val"]], + ["number", ["get", "i1"]], + ["number", ["get", "i2"]] + ] + } +} diff --git a/test/integration/expression-tests/slice/invalid-inputs/test.json b/test/integration/expression-tests/slice/invalid-inputs/test.json new file mode 100644 index 00000000000..408ba716db3 --- /dev/null +++ b/test/integration/expression-tests/slice/invalid-inputs/test.json @@ -0,0 +1,40 @@ +{ + "expression": ["slice", ["get", "input"], ["get", "i1"]], + "inputs": [ + [{}, { "properties": { "input": false, "i1": 1 } }], + [{}, { "properties": { "input": null, "i1": 1 } }], + [{}, { "properties": { "input": 12, "i1": 1 } }], + [{}, { "properties": { "input": {}, "i1": 1 } }], + [{}, { "properties": { "other": 1, "i1": 1 } }], + [{}, { "properties": { "input": "correct", "i1": "one" } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "value" + }, + "outputs": [ + { + "error": "Expected first argument to be of type array or string, but found boolean instead." + }, + { + "error": "Expected first argument to be of type array or string, but found null instead." + }, + { + "error": "Expected first argument to be of type array or string, but found number instead." + }, + { + "error": "Expected first argument to be of type array or string, but found object instead." + }, + { + "error": "Expected first argument to be of type array or string, but found null instead." + }, + { + "error": "Expected value to be of type number, but found string instead." + } + ], + "serialized": ["slice", ["get", "input"], ["number", ["get", "i1"]]] + } +} diff --git a/test/integration/expression-tests/slice/string-one-index/test.json b/test/integration/expression-tests/slice/string-one-index/test.json new file mode 100644 index 00000000000..e27c27b39fd --- /dev/null +++ b/test/integration/expression-tests/slice/string-one-index/test.json @@ -0,0 +1,19 @@ +{ + "expression": ["slice", ["get", "val"], ["get", "index"]], + "inputs": [ + [{}, { "properties": { "val": "0123456789", "index": 0 } }], + [{}, { "properties": { "val": "0123456789", "index": 4 } }], + [{}, { "properties": { "val": "0123456789", "index": 99 } }], + [{}, { "properties": { "val": "0123456789", "index": -2 } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "value" + }, + "outputs": ["0123456789", "456789", "", "89"], + "serialized": ["slice", ["get", "val"], ["number", ["get", "index"]]] + } +} diff --git a/test/integration/expression-tests/slice/string-two-indexes/test.json b/test/integration/expression-tests/slice/string-two-indexes/test.json new file mode 100644 index 00000000000..39089a83c4f --- /dev/null +++ b/test/integration/expression-tests/slice/string-two-indexes/test.json @@ -0,0 +1,25 @@ +{ + "expression": ["slice", ["get", "val"], ["get", "i1"], ["get", "i2"]], + "inputs": [ + [{}, { "properties": { "val": "0123456789", "i1": 1, "i2": 8 } }], + [{}, { "properties": { "val": "0123456789", "i1": 4, "i2": -2 } }], + [{}, { "properties": { "val": "0123456789", "i1": -3, "i2": -1 } }], + [{}, { "properties": { "val": "0123456789", "i1": 0, "i2": -1 } }], + [{}, { "properties": { "val": "0123456789", "i1": 0, "i2": 99 } }] + ], + "expected": { + "compiled": { + "result": "success", + "isFeatureConstant": false, + "isZoomConstant": true, + "type": "value" + }, + "outputs": ["1234567", "4567", "78", "012345678", "0123456789"], + "serialized": [ + "slice", + ["get", "val"], + ["number", ["get", "i1"]], + ["number", ["get", "i2"]] + ] + } +} diff --git a/test/integration/expression-tests/within/invalid-geojson/test.json b/test/integration/expression-tests/within/invalid-geojson/test.json new file mode 100644 index 00000000000..bd944da7d9f --- /dev/null +++ b/test/integration/expression-tests/within/invalid-geojson/test.json @@ -0,0 +1,52 @@ +{ + "expression": ["within", { + "type": "LineString", + "coordinates": [[0, 0], [0, 5], [5, 5], [5, 0]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [6, 6] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[3, 3], [4, 1]] + } + }]], + "expected": { + "compiled": { + "errors": [{ + "key": "", + "error": "'within' expression requires valid geojson object that contains polygon geometry type." + }], + "result": "error" + } + } +} diff --git a/test/integration/expression-tests/within/line-within-polygon/test.json b/test/integration/expression-tests/within/line-within-polygon/test.json new file mode 100644 index 00000000000..b42c19c999b --- /dev/null +++ b/test/integration/expression-tests/within/line-within-polygon/test.json @@ -0,0 +1,44 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[3, 3], [4, 1]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[3, 3], [6, 6]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, false], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/line-within-polygons/test.json b/test/integration/expression-tests/within/line-within-polygons/test.json new file mode 100644 index 00000000000..c193086bcd3 --- /dev/null +++ b/test/integration/expression-tests/within/line-within-polygons/test.json @@ -0,0 +1,81 @@ +{ + "expression": ["within", { + "type": "MultiPolygon", + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[3, 3], [4, 1]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[3, 3], [-2, -2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[0, 0], [2, 2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[1, 3], [-2, -2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[-1, -1], [-2, -2]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, false, false, false, true], + "serialized": ["within", { + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]], + "type": "MultiPolygon" + }] + } +} diff --git a/test/integration/expression-tests/within/lines-within-polygon/test.json b/test/integration/expression-tests/within/lines-within-polygon/test.json new file mode 100644 index 00000000000..ac914ed9b33 --- /dev/null +++ b/test/integration/expression-tests/within/lines-within-polygon/test.json @@ -0,0 +1,44 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiLineString", + "coordinates": [[[3, 3], [4, 1]], [[-2, -2], [-1, -1]]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiLineString", + "coordinates": [[[3, 3], [2, 2]], [[1, 1], [2, 2], [3, 2]]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, true], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/lines-within-polygons/test.json b/test/integration/expression-tests/within/lines-within-polygons/test.json new file mode 100644 index 00000000000..936463c000b --- /dev/null +++ b/test/integration/expression-tests/within/lines-within-polygons/test.json @@ -0,0 +1,57 @@ +{ + "expression": ["within", { + "type": "MultiPolygon", + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiLineString", + "coordinates": [[[3, 3], [4, 1]], [[-2, -2], [-1, -1]]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiLineString", + "coordinates": [[[3, 3], [2, 2]], [[1, 1], [2, 2], [3, 2]]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiLineString", + "coordinates": [[[3, 3], [2, 2]], [[-1, 1], [2, 2], [3, 2]]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, true, false], + "serialized": ["within", { + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]], + "type": "MultiPolygon" + }] + } +} diff --git a/test/integration/expression-tests/within/meridian-issue-line-1/test.json b/test/integration/expression-tests/within/meridian-issue-line-1/test.json new file mode 100644 index 00000000000..ac4f1cbf63c --- /dev/null +++ b/test/integration/expression-tests/within/meridian-issue-line-1/test.json @@ -0,0 +1,44 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[-190, 0], [-178, 0], [-178, 10], [-190, 10], [-190, 0]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[-183, 5], [-179, 1]] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[-183, 5], [181, 1]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, false], + "serialized": ["within", { + "coordinates": [[[-190, 0], [-178, 0], [-178, 10], [-190, 10], [-190, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/meridian-issue-line-2/test.json b/test/integration/expression-tests/within/meridian-issue-line-2/test.json new file mode 100644 index 00000000000..0e73e0b7e20 --- /dev/null +++ b/test/integration/expression-tests/within/meridian-issue-line-2/test.json @@ -0,0 +1,56 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[-185.0, 60.0], [175.0, 60.0], [175.0, 65.0], [-185.0, 65.0], [-185.0, 60.0]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[-183, 61], [-179, 62]] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[-183, 61], [181, 63]] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "LineString", + "coordinates": [[-183, 62], [55, 63.5]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, false, true], + "serialized": ["within", { + "coordinates": [[[-185.0, 60.0], [175.0, 60.0], [175.0, 65.0], [-185.0, 65.0], [-185.0, 60.0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/meridian-issue-point-1/test.json b/test/integration/expression-tests/within/meridian-issue-point-1/test.json new file mode 100644 index 00000000000..d86e6bcee01 --- /dev/null +++ b/test/integration/expression-tests/within/meridian-issue-point-1/test.json @@ -0,0 +1,56 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[-185.0, 60.0], [-175.0, 60.0], [-175.0, 65.0], [-185.0, 65.0], [-185.0, 60.0]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[-183, 62], [-179, 63]] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[-183, 62], [181, 63]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 7, + "y": 2 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [177, 62.5] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, true, true], + "serialized": ["within", { + "coordinates": [[[-185.0, 60.0], [-175.0, 60.0], [-175.0, 65.0], [-185.0, 65.0], [-185.0, 60.0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/meridian-issue-point-2/test.json b/test/integration/expression-tests/within/meridian-issue-point-2/test.json new file mode 100644 index 00000000000..0a7a524f847 --- /dev/null +++ b/test/integration/expression-tests/within/meridian-issue-point-2/test.json @@ -0,0 +1,68 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[-360.0, 60.0], [0.0, 60.0], [0.0, 65.0], [-360.0, 65.0], [-360.0, 60.0]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [-183, 61] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [-361, 61] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [183, 62] + } + }], [{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [55, 62] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [true, true, true, true], + "serialized": ["within", { + "coordinates": [[[-360.0, 60.0], [0.0, 60.0], [0.0, 65.0], [-360.0, 65.0], [-360.0, 60.0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/non-supported/test.json b/test/integration/expression-tests/within/non-supported/test.json new file mode 100644 index 00000000000..16659a5fc16 --- /dev/null +++ b/test/integration/expression-tests/within/non-supported/test.json @@ -0,0 +1,32 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Polygon", + "coordinates": [[[3, 3], [6, 6], [3, 3]]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/point-on-boundary-1/test.json b/test/integration/expression-tests/within/point-on-boundary-1/test.json new file mode 100644 index 00000000000..8716649bd85 --- /dev/null +++ b/test/integration/expression-tests/within/point-on-boundary-1/test.json @@ -0,0 +1,248 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 1, + "canonicalID": { + "z": 1, + "x": 1, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 2, + "canonicalID": { + "z": 2, + "x": 2, + "y": 2 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 4, + "canonicalID": { + "z": 4, + "x": 1, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 5, + "canonicalID": { + "z": 5, + "x": 16, + "y": 16 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 6, + "canonicalID": { + "z": 6, + "x": 32, + "y": 32 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 7, + "canonicalID": { + "z": 7, + "x": 65, + "y": 63 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 8, + "canonicalID": { + "z": 8, + "x": 131, + "y": 124 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 9, + "canonicalID": { + "z": 9, + "x": 263, + "y": 248 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 10, + "canonicalID": { + "z": 10, + "x": 526, + "y": 497 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 11, + "canonicalID": { + "z": 11, + "x": 1052, + "y": 995 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 12, + "canonicalID": { + "z": 12, + "x": 2104, + "y": 1991 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 13, + "canonicalID": { + "z": 13, + "x": 4209, + "y": 3982 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 14, + "canonicalID": { + "z": 14, + "x": 8419, + "y": 7964 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 15, + "canonicalID": { + "z": 15, + "x": 16839, + "y": 15928 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 16, + "canonicalID": { + "z": 16, + "x": 33678, + "y": 31856 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 17, + "canonicalID": { + "z": 17, + "x": 67356, + "y": 67313 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }], [{ + "zoom": 18, + "canonicalID": { + "z": 18, + "x": 134712, + "y": 127426 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [5, 5] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/point-on-boundary-2/test.json b/test/integration/expression-tests/within/point-on-boundary-2/test.json new file mode 100644 index 00000000000..7e67501ce44 --- /dev/null +++ b/test/integration/expression-tests/within/point-on-boundary-2/test.json @@ -0,0 +1,248 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 1, + "canonicalID": { + "z": 1, + "x": 1, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 2, + "canonicalID": { + "z": 2, + "x": 2, + "y": 2 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 4, + "canonicalID": { + "z": 4, + "x": 1, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 5, + "canonicalID": { + "z": 5, + "x": 16, + "y": 16 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 6, + "canonicalID": { + "z": 6, + "x": 32, + "y": 32 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 7, + "canonicalID": { + "z": 7, + "x": 65, + "y": 63 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 8, + "canonicalID": { + "z": 8, + "x": 131, + "y": 126 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 9, + "canonicalID": { + "z": 9, + "x": 261, + "y": 261 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 10, + "canonicalID": { + "z": 10, + "x": 512, + "y": 503 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 11, + "canonicalID": { + "z": 11, + "x": 1024, + "y": 1006 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 12, + "canonicalID": { + "z": 12, + "x": 2048, + "y": 2013 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 13, + "canonicalID": { + "z": 13, + "x": 4096, + "y": 4027 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 14, + "canonicalID": { + "z": 14, + "x": 8192, + "y": 8055 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 15, + "canonicalID": { + "z": 15, + "x": 16384, + "y": 16110 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 16, + "canonicalID": { + "z": 16, + "x": 32768, + "y": 32221 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 17, + "canonicalID": { + "z": 17, + "x": 65536, + "y": 64443 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }], [{ + "zoom": 18, + "canonicalID": { + "z": 18, + "x": 131072, + "y": 128888 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [0, 3] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/point-on-boundary-3/test.json b/test/integration/expression-tests/within/point-on-boundary-3/test.json new file mode 100644 index 00000000000..15ae0528d04 --- /dev/null +++ b/test/integration/expression-tests/within/point-on-boundary-3/test.json @@ -0,0 +1,248 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[-10, -10], [10, -10], [10, 10], [-10, 10], [-10, -10]]] + }], + "inputs": [[{ + "zoom": 0, + "canonicalID": { + "z": 0, + "x": 0, + "y": 0 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 1, + "canonicalID": { + "z": 1, + "x": 1, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 2, + "canonicalID": { + "z": 2, + "x": 2, + "y": 2 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 4, + "canonicalID": { + "z": 4, + "x": 1, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 5, + "canonicalID": { + "z": 5, + "x": 16, + "y": 16 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 6, + "canonicalID": { + "z": 6, + "x": 32, + "y": 32 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 7, + "canonicalID": { + "z": 7, + "x": 65, + "y": 63 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 8, + "canonicalID": { + "z": 8, + "x": 135, + "y": 135 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 9, + "canonicalID": { + "z": 9, + "x": 270, + "y": 270 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 10, + "canonicalID": { + "z": 10, + "x": 540, + "y": 540 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 11, + "canonicalID": { + "z": 11, + "x": 1080, + "y": 1081 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 12, + "canonicalID": { + "z": 12, + "x": 2161, + "y": 2162 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 13, + "canonicalID": { + "z": 13, + "x": 4323, + "y": 4324 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 14, + "canonicalID": { + "z": 14, + "x": 8650, + "y": 8650 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 15, + "canonicalID": { + "z": 15, + "x": 17295, + "y": 17298 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 16, + "canonicalID": { + "z": 16, + "x": 34588, + "y": 34597 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 17, + "canonicalID": { + "z": 17, + "x": 69176, + "y": 69195 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }], [{ + "zoom": 18, + "canonicalID": { + "z": 18, + "x": 138353, + "y": 138391 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [10, -10] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ], + "serialized": ["within", { + "coordinates": [[[-10, -10], [10, -10], [10, 10], [-10, 10], [-10, -10]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/point-within-polygon/test.json b/test/integration/expression-tests/within/point-within-polygon/test.json new file mode 100644 index 00000000000..8da9fbdceec --- /dev/null +++ b/test/integration/expression-tests/within/point-within-polygon/test.json @@ -0,0 +1,44 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [6, 6] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, true], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } +} diff --git a/test/integration/expression-tests/within/point-within-polygons/test.json b/test/integration/expression-tests/within/point-within-polygons/test.json new file mode 100644 index 00000000000..29f10acb40d --- /dev/null +++ b/test/integration/expression-tests/within/point-within-polygons/test.json @@ -0,0 +1,106 @@ +{ + "expression": ["within", { + "type": "MultiPolygon", + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [6, 6] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [2, 2] + } + }],[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [3, 4] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [-1, 3] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 0, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [-1, -5] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 5, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [2, -2] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 2, + "x": 0, + "y": 1 + } + }, { + "geometry": { + "type": "Point", + "coordinates": [-2, -2] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, true, true, false, false, false, true], + "serialized": ["within", { + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]], + "type": "MultiPolygon" + }] + } + } + \ No newline at end of file diff --git a/test/integration/expression-tests/within/points-within-polygon/test.json b/test/integration/expression-tests/within/points-within-polygon/test.json new file mode 100644 index 00000000000..6f2f45def7a --- /dev/null +++ b/test/integration/expression-tests/within/points-within-polygon/test.json @@ -0,0 +1,45 @@ +{ + "expression": ["within", { + "type": "Polygon", + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[6, 6], [3, 4], [2, 2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[2, 2], [3, 3]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, true], + "serialized": ["within", { + "coordinates": [[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + "type": "Polygon" + }] + } + } + \ No newline at end of file diff --git a/test/integration/expression-tests/within/points-within-polygons/test.json b/test/integration/expression-tests/within/points-within-polygons/test.json new file mode 100644 index 00000000000..c170f6134b7 --- /dev/null +++ b/test/integration/expression-tests/within/points-within-polygons/test.json @@ -0,0 +1,94 @@ +{ + "expression": ["within", { + "type": "MultiPolygon", + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], + [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]] + }], + "inputs": [[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[6, 6], [2, 2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[2, 2], [3, 3]] + } + }],[{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[3, 4], [-2, -2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 3, + "y": 3 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[-1, 3], [1, 3]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 3, + "x": 0, + "y": 1 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[2, 3], [-2, 3], [-2, -2]] + } + }], [{ + "zoom": 3, + "canonicalID": { + "z": 5, + "x": 15, + "y": 16 + } + }, { + "geometry": { + "type": "MultiPoint", + "coordinates": [[-2, -2], [-1, -1]] + } + }]], + "expected": { + "compiled": { + "type": "boolean", + "isFeatureConstant": false, + "isZoomConstant": true, + "result": "success" + }, + "outputs": [false, true, true, false, false, true], + "serialized": ["within", { + "coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]], + "type": "MultiPolygon" + }] + } + } + \ No newline at end of file diff --git a/test/integration/geojson/anchors.json b/test/integration/geojson/anchors.json new file mode 100644 index 00000000000..8a8840cb78f --- /dev/null +++ b/test/integration/geojson/anchors.json @@ -0,0 +1,85 @@ +{ + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "anchor": "center" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "left" + }, + "geometry": { + "type": "Point", + "coordinates": [ 30, 0 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "top-left" + }, + "geometry": { + "type": "Point", + "coordinates": [ 20, -15 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "top" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, -25 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "top-right" + }, + "geometry": { + "type": "Point", + "coordinates": [ -20, -15 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "right" + }, + "geometry": { + "type": "Point", + "coordinates": [ -30, 0 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "bottom-left" + }, + "geometry": { + "type": "Point", + "coordinates": [ 20, 15 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "bottom" + }, + "geometry": { + "type": "Point", + "coordinates": [ 0, 25 ] + } + }, { + "type": "Feature", + "properties": { + "anchor": "bottom-right" + }, + "geometry": { + "type": "Point", + "coordinates": [ -20, 15 ] + } + }] +} \ No newline at end of file diff --git a/test/integration/lib/generate-fixture-json.js b/test/integration/lib/generate-fixture-json.js new file mode 100644 index 00000000000..b4bf77377ff --- /dev/null +++ b/test/integration/lib/generate-fixture-json.js @@ -0,0 +1,120 @@ +/* eslint-disable import/no-commonjs */ +const path = require('path'); +const fs = require('fs'); +const glob = require('glob'); +const localizeURLs = require('./localize-urls'); + +const OUTPUT_FILE = 'fixtures.json'; + +exports.generateFixtureJson = generateFixtureJson; +exports.getAllFixtureGlobs = getAllFixtureGlobs; + +/** + * Analyzes the contents of the specified `path.join(rootDirectory, suiteDirectory)`, and inlines + * the contents into a single json file which can then be imported and built into a bundle + * to be shipped to the browser. + * + * @param {string} rootDirectory + * @param {string} suiteDirectory + * @param {boolean} includeImages + */ +function generateFixtureJson(rootDirectory, suiteDirectory, outputDirectory = 'test/integration/dist', includeImages = false) { + const globs = getAllFixtureGlobs(rootDirectory, suiteDirectory); + const jsonPaths = globs[0]; + const imagePaths = globs[1]; + //Extract the filedata into a flat dictionary + const allFiles = {}; + let allPaths = glob.sync(jsonPaths); + if (includeImages) { + allPaths = allPaths.concat(glob.sync(imagePaths)); + } + + //A Set that stores test names that are malformed so they can be removed later + const malformedTests = {}; + + for (const fixturePath of allPaths) { + const testName = path.dirname(fixturePath); + const fileName = path.basename(fixturePath); + const extension = path.extname(fixturePath); + try { + if (extension === '.json') { + let json = parseJsonFromFile(fixturePath); + + //Special case for style json which needs some preprocessing + if (fileName === 'style.json') { + json = processStyle(testName, json); + } + + allFiles[fixturePath] = json; + } else if (extension === '.png') { + allFiles[fixturePath] = pngToBase64Str(fixturePath); + } else { + throw new Error(`${extension} is incompatible , file path ${fixturePath}`); + } + } catch (e) { + console.log(`Error parsing file: ${fixturePath}`); + malformedTests[testName] = true; + } + } + + // Re-nest by directory path, each directory path defines a testcase. + const result = {}; + for (const fullPath in allFiles) { + const testName = path.dirname(fullPath).replace(rootDirectory, ''); + //Skip if test is malformed + if (malformedTests[testName]) { continue; } + + //Lazily initaialize an object to store each file wihin a particular testName + if (result[testName] == null) { + result[testName] = {}; + } + //Trim extension from filename + const fileName = path.basename(fullPath, path.extname(fullPath)); + result[testName][fileName] = allFiles[fullPath]; + } + + const outputStr = JSON.stringify(result, null, 4); + const outputPath = path.join(outputDirectory, OUTPUT_FILE); + + return new Promise((resolve, reject) => { + fs.writeFile(outputPath, outputStr, {encoding: 'utf8'}, (err) => { + if (err) { reject(err); } + + resolve(); + }); + }); +} + +function getAllFixtureGlobs(rootDirectory, suiteDirectory) { + const basePath = path.join(rootDirectory, suiteDirectory); + const jsonPaths = path.join(basePath, '/**/*.json'); + const imagePaths = path.join(basePath, '/**/*.png'); + + return [jsonPaths, imagePaths]; +} + +function parseJsonFromFile(filePath) { + return JSON.parse(fs.readFileSync(filePath, {encoding: 'utf8'})); +} + +function pngToBase64Str(filePath) { + return fs.readFileSync(filePath).toString('base64'); +} + +function processStyle(testName, style) { + const clone = JSON.parse(JSON.stringify(style)); + // 7357 is testem's default port + localizeURLs(clone, 7357); + + clone.metadata = clone.metadata || {}; + clone.metadata.test = Object.assign({ + testName, + width: 512, + height: 512, + pixelRatio: 1, + recycleMap: false, + allowed: 0.00015 + }, clone.metadata.test); + + return clone; +} diff --git a/test/integration/lib/harness.js b/test/integration/lib/harness.js index 5afda7c4fe8..dff138568b0 100644 --- a/test/integration/lib/harness.js +++ b/test/integration/lib/harness.js @@ -4,7 +4,7 @@ import path from 'path'; import fs from 'fs'; import glob from 'glob'; import {shuffle} from 'shuffle-seed'; -import {queue} from 'd3-queue'; +import {queue} from 'd3'; import colors from 'chalk'; import template from 'lodash.template'; import createServer from './server'; @@ -179,7 +179,7 @@ export default function (directory, implementation, options, run) { const unsuccessful = tests.filter(test => test.status === 'failed' || test.status === 'errored'); - const resultsShell = resultsTemplate({ unsuccessful, tests, stats, shuffle: options.shuffle, seed: options.seed }) + const resultsShell = resultsTemplate({unsuccessful, tests, stats, shuffle: options.shuffle, seed: options.seed}) .split(''); const p = path.join(directory, options.recycleMap ? 'index-recycle-map.html' : 'index.html'); @@ -188,7 +188,7 @@ export default function (directory, implementation, options, run) { const q = queue(1); q.defer(write, out, resultsShell[0]); for (const test of tests) { - q.defer(write, out, itemTemplate({ r: test, hasFailedTests: unsuccessful.length > 0 })); + q.defer(write, out, itemTemplate({r: test, hasFailedTests: unsuccessful.length > 0})); } q.defer(write, out, resultsShell[1]); q.await(() => { diff --git a/test/integration/lib/json-diff.js b/test/integration/lib/json-diff.js new file mode 100644 index 00000000000..730a5b89989 --- /dev/null +++ b/test/integration/lib/json-diff.js @@ -0,0 +1,37 @@ +import diff from 'diff'; + +export function generateDiffLog(expected, actual) { + return diff.diffJson(expected, actual).map((hunk) => { + if (hunk.added) { + return `+ ${hunk.value}`; + } else if (hunk.removed) { + return `- ${hunk.value}`; + } else { + return ` ${hunk.value}`; + } + }).join(''); +} + +export function deepEqual(a, b) { + if (typeof a !== typeof b) + return false; + if (typeof a === 'number') + return Math.abs(a - b) < 1e-10; + if (a === null || typeof a !== 'object') + return a === b; + + const ka = Object.keys(a); + const kb = Object.keys(b); + + if (ka.length !== kb.length) + return false; + + ka.sort(); + kb.sort(); + + for (let i = 0; i < ka.length; i++) + if (ka[i] !== kb[i] || !deepEqual(a[ka[i]], b[ka[i]])) + return false; + + return true; +} diff --git a/test/integration/lib/localize-urls.js b/test/integration/lib/localize-urls.js new file mode 100644 index 00000000000..040572cf1f9 --- /dev/null +++ b/test/integration/lib/localize-urls.js @@ -0,0 +1,102 @@ +/* eslint-disable import/no-commonjs */ +const path = require('path'); +const fs = require('fs'); +const colors = require('chalk'); + +module.exports = function localizeURLs(style, port) { + localizeStyleURLs(style, port); + if (style.metadata && style.metadata.test && style.metadata.test.operations) { + style.metadata.test.operations.forEach((op) => { + if (op[0] === 'addSource') { + localizeSourceURLs(op[2], port); + } else if (op[0] === 'setStyle') { + if (typeof op[1] === 'object') { + localizeStyleURLs(op[1], port); + return; + } + + let styleJSON; + try { + const relativePath = op[1].replace(/^local:\/\//, ''); + if (relativePath.startsWith('mapbox-gl-styles')) { + styleJSON = fs.readFileSync(path.join(path.dirname(require.resolve('mapbox-gl-styles')), '..', relativePath)); + } else { + styleJSON = fs.readFileSync(path.join(__dirname, '..', relativePath)); + } + } catch (error) { + console.log(colors.blue(`* ${error}`)); + return; + } + + try { + styleJSON = JSON.parse(styleJSON); + } catch (error) { + console.log(colors.blue(`* Error while parsing ${op[1]}: ${error}`)); + return; + } + + localizeStyleURLs(styleJSON, port); + + op[1] = styleJSON; + op[2] = {diff: false}; + } + }); + } +}; + +function localizeURL(url, port) { + return url.replace(/^local:\/\//, `http://localhost:${port}/`); +} + +function localizeMapboxSpriteURL(url, port) { + return url.replace(/^mapbox:\/\//, `http://localhost:${port}/`); +} + +function localizeMapboxFontsURL(url, port) { + return url.replace(/^mapbox:\/\/fonts/, `http://localhost:${port}/glyphs`); +} + +function localizeMapboxTilesURL(url, port) { + return url.replace(/^mapbox:\/\//, `http://localhost:${port}/tiles/`); +} + +function localizeMapboxTilesetURL(url, port) { + return url.replace(/^mapbox:\/\//, `http://localhost:${port}/tilesets/`); +} + +function localizeSourceURLs(source, port) { + for (const tile in source.tiles) { + source.tiles[tile] = localizeMapboxTilesURL(source.tiles[tile], port); + source.tiles[tile] = localizeURL(source.tiles[tile], port); + } + + if (source.urls) { + source.urls = source.urls.map((url) => localizeMapboxTilesetURL(url, port)); + source.urls = source.urls.map((url) => localizeURL(url, port)); + } + + if (source.url) { + source.url = localizeMapboxTilesetURL(source.url, port); + source.url = localizeURL(source.url, port); + } + + if (source.data && typeof source.data == 'string') { + source.data = localizeURL(source.data, port); + } +} + +function localizeStyleURLs (style, port) { + for (const source in style.sources) { + localizeSourceURLs(style.sources[source], port); + } + + if (style.sprite) { + style.sprite = localizeMapboxSpriteURL(style.sprite, port); + style.sprite = localizeURL(style.sprite, port); + } + + if (style.glyphs) { + style.glyphs = localizeMapboxFontsURL(style.glyphs, port); + style.glyphs = localizeURL(style.glyphs, port); + } +} diff --git a/test/integration/lib/operation-handlers.js b/test/integration/lib/operation-handlers.js new file mode 100644 index 00000000000..d653c892943 --- /dev/null +++ b/test/integration/lib/operation-handlers.js @@ -0,0 +1,56 @@ +function handleOperation(map, operations, opIndex, doneCb) { + const operation = operations[opIndex]; + const opName = operation[0]; + //Delegate to special handler if one is available + if (opName in operationHandlers) { + operationHandlers[opName](map, operation.slice(1), () => { + doneCb(opIndex); + }); + } else { + map[opName](...operation.slice(1)); + doneCb(opIndex); + } +} + +export const operationHandlers = { + wait(map, params, doneCb) { + const wait = function() { + if (map.loaded()) { + doneCb(); + } else { + map.once('render', wait); + } + }; + wait(); + }, + idle(map, params, doneCb) { + const idle = function() { + if (!map.isMoving()) { + doneCb(); + } else { + map.once('render', idle); + } + }; + idle(); + } +}; + +export function applyOperations(map, operations, doneCb) { + // No operations specified, end immediately adn invoke doneCb. + if (!operations || operations.length === 0) { + doneCb(); + return; + } + + // Start recursive chain + const scheduleNextOperation = (lastOpIndex) => { + if (lastOpIndex === operations.length - 1) { + // Stop recusive chain when at the end of the operations + doneCb(); + return; + } + + handleOperation(map, operations, ++lastOpIndex, scheduleNextOperation); + }; + scheduleNextOperation(-1); +} diff --git a/test/integration/lib/query-browser.js b/test/integration/lib/query-browser.js new file mode 100644 index 00000000000..4eb275a70af --- /dev/null +++ b/test/integration/lib/query-browser.js @@ -0,0 +1,86 @@ +/* eslint-env browser */ +/* global tape:readonly, mapboxgl:readonly */ +/* eslint-disable import/no-unresolved */ +// fixtures.json is automatically generated before this file gets built +// refer testem.js#before_tests() +import fixtures from '../dist/fixtures.json'; +import ignores from '../../ignores.json'; +import {applyOperations} from './operation-handlers'; +import {deepEqual, generateDiffLog} from './json-diff'; + +for (const testName in fixtures) { + if (testName in ignores) { + tape.skip(testName, testFunc); + } else { + tape(testName, {timeout: 20000}, testFunc); + } +} + +function testFunc(t) { + // This needs to be read from the `t` object because this function runs async in a closure. + const currentTestName = t.name; + const style = fixtures[currentTestName].style; + const expected = fixtures[currentTestName].expected; + const options = style.metadata.test; + const skipLayerDelete = style.metadata.skipLayerDelete; + + window.devicePixelRatio = options.pixelRatio; + + //1. Create and position the container, floating at the bottom right + const container = document.createElement('div'); + container.style.position = 'fixed'; + container.style.bottom = '10px'; + container.style.right = '10px'; + container.style.width = `${options.width}px`; + container.style.height = `${options.height}px`; + document.body.appendChild(container); + + //2. Initialize the Map + const map = new mapboxgl.Map({ + container, + style, + classes: options.classes, + interactive: false, + attributionControl: false, + preserveDrawingBuffer: true, + axonometric: options.axonometric || false, + skew: options.skew || [0, 0], + fadeDuration: options.fadeDuration || 0, + localIdeographFontFamily: options.localIdeographFontFamily || false, + crossSourceCollisions: typeof options.crossSourceCollisions === "undefined" ? true : options.crossSourceCollisions + }); + map.repaint = true; + map.once('load', () => { + //3. Run the operations on the map + applyOperations(map, options.operations, () => { + + //4. Perform query operation and compare results from expected values + const results = options.queryGeometry ? + map.queryRenderedFeatures(options.queryGeometry, options.queryOptions || {}) : + []; + + const actual = results.map((feature) => { + const featureJson = JSON.parse(JSON.stringify(feature.toJSON())); + if (!skipLayerDelete) delete featureJson.layer; + return featureJson; + }); + + const testMetaData = { + name: t.name, + actual: map.getCanvas().toDataURL() + }; + const success = deepEqual(actual, expected); + if (success) { + t.pass(JSON.stringify(testMetaData)); + } else { + testMetaData['difference'] = generateDiffLog(expected, actual); + t.fail(JSON.stringify(testMetaData)); + } + //Cleanup WebGL context + map.remove(); + delete map.painter.context.gl; + document.body.removeChild(container); + t.end(); + }); + }); +} diff --git a/test/integration/lib/query.js b/test/integration/lib/query.js index a5d192b08d1..5485d39d078 100644 --- a/test/integration/lib/query.js +++ b/test/integration/lib/query.js @@ -54,14 +54,6 @@ export function run(implementation, options, query) { const expected = require(path.join(dir, 'expected.json')); - //For feature states, remove 'state' from fixtures until implemented in native https://github.com/mapbox/mapbox-gl-native/issues/11846 - if (implementation === 'native') { - for (let i = 0; i < expected.length; i++) { - delete expected[i].state; - delete expected[i].source; - delete expected[i].sourceLayer; - } - } params.ok = deepEqual(results, expected); if (!params.ok) { diff --git a/test/integration/lib/render.js b/test/integration/lib/render.js index 345073443f7..e2846a47c0b 100644 --- a/test/integration/lib/render.js +++ b/test/integration/lib/render.js @@ -37,7 +37,7 @@ import * as glob from 'glob'; * @returns {undefined} terminates the process when testing is complete */ export function run(implementation, ignores, render) { - const options = { ignores, tests:[], shuffle:false, recycleMap:false, seed:makeHash() }; + const options = {ignores, tests:[], shuffle:false, recycleMap:false, seed:makeHash()}; // https://stackoverflow.com/a/1349426/229714 function makeHash() { diff --git a/test/integration/lib/server.js b/test/integration/lib/server.js index 3a3199cb003..b20eea261fc 100644 --- a/test/integration/lib/server.js +++ b/test/integration/lib/server.js @@ -1,14 +1,32 @@ -import path from 'path'; -import fs from 'fs'; -import st from 'st'; -import {createServer} from 'http'; -import colors from 'chalk'; - -export default function () { +/* eslint-disable import/no-commonjs */ +const path = require('path'); +const fs = require('fs'); +const st = require('st'); +const {createServer} = require('http'); +const localizeURLs = require('./localize-urls'); + +module.exports = function () { + const port = 2900; const integrationMount = st({path: path.join(__dirname, '..')}); const mapboxGLStylesMount = st({path: path.dirname(require.resolve('mapbox-gl-styles')), url: 'mapbox-gl-styles'}); const mapboxMVTFixturesMount = st({path: path.dirname(require.resolve('@mapbox/mvt-fixtures')), url: 'mvt-fixtures'}); const server = createServer((req, res) => { + if (req.method === 'POST' && req.url === '/write-file') { + let body = ''; + req.on('data', (data) => { + body += data; + }); + req.on('end', () => { + + //Write data to disk + const {filePath, data} = JSON.parse(body); + fs.writeFile(path.join(process.cwd(), filePath), data, 'base64', () => { + res.writeHead(200, {'Content-Type': 'text/html'}); + res.end('ok'); + }); + }); + } + return mapboxMVTFixturesMount(req, res, () => { return mapboxGLStylesMount(req, res, () => { return integrationMount(req, res); @@ -16,66 +34,9 @@ export default function () { }); }); - function localizeURL(url) { - return url.replace(/^local:\/\//, 'http://localhost:2900/'); - } - - function localizeMapboxSpriteURL(url) { - return url.replace(/^mapbox:\/\//, 'http://localhost:2900/'); - } - - function localizeMapboxFontsURL(url) { - return url.replace(/^mapbox:\/\/fonts/, 'http://localhost:2900/glyphs'); - } - - function localizeMapboxTilesURL(url) { - return url.replace(/^mapbox:\/\//, 'http://localhost:2900/tiles/'); - } - - function localizeMapboxTilesetURL(url) { - return url.replace(/^mapbox:\/\//, 'http://localhost:2900/tilesets/'); - } - - function localizeSourceURLs(source) { - for (const tile in source.tiles) { - source.tiles[tile] = localizeMapboxTilesURL(source.tiles[tile]); - source.tiles[tile] = localizeURL(source.tiles[tile]); - } - - if (source.urls) { - source.urls = source.urls.map(localizeMapboxTilesetURL); - source.urls = source.urls.map(localizeURL); - } - - if (source.url) { - source.url = localizeMapboxTilesetURL(source.url); - source.url = localizeURL(source.url); - } - - if (source.data && typeof source.data == 'string') { - source.data = localizeURL(source.data); - } - } - - function localizeStyleURLs (style) { - for (const source in style.sources) { - localizeSourceURLs(style.sources[source]); - } - - if (style.sprite) { - style.sprite = localizeMapboxSpriteURL(style.sprite); - style.sprite = localizeURL(style.sprite); - } - - if (style.glyphs) { - style.glyphs = localizeMapboxFontsURL(style.glyphs); - style.glyphs = localizeURL(style.glyphs); - } - } - return { listen(callback) { - server.listen(2900, callback); + server.listen(port, callback); }, close(callback) { @@ -83,44 +44,7 @@ export default function () { }, localizeURLs(style) { - localizeStyleURLs(style); - if (style.metadata && style.metadata.test && style.metadata.test.operations) { - style.metadata.test.operations.forEach((op) => { - if (op[0] === 'addSource') { - localizeSourceURLs(op[2]); - } else if (op[0] === 'setStyle') { - if (typeof op[1] === 'object') { - localizeStyleURLs(op[1]); - return; - } - - let styleJSON; - try { - const relativePath = op[1].replace(/^local:\/\//, ''); - if (relativePath.startsWith('mapbox-gl-styles')) { - styleJSON = fs.readFileSync(path.join(path.dirname(require.resolve('mapbox-gl-styles')), '..', relativePath)); - } else { - styleJSON = fs.readFileSync(path.join(__dirname, '..', relativePath)); - } - } catch (error) { - console.log(colors.blue(`* ${error}`)); - return; - } - - try { - styleJSON = JSON.parse(styleJSON); - } catch (error) { - console.log(colors.blue(`* Error while parsing ${op[1]}: ${error}`)); - return; - } - - localizeStyleURLs(styleJSON); - - op[1] = styleJSON; - op[2] = { diff: false }; - } - }); - } + return localizeURLs(style, port); } }; -} +}; diff --git a/test/integration/package.json b/test/integration/package.json deleted file mode 100644 index 9afea8cef14..00000000000 --- a/test/integration/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@mapbox/mapbox-gl-test-suite", - "description": "Rendering tests for Mapbox GL", - "version": "0.0.0", - "license": "BSD", - "main": "index.js", - "dependencies": { - "@mapbox/mvt-fixtures": "^3.5.1", - "chalk": "^2.4.2", - "d3-queue": "^3.0.7", - "diff": "^4.0.1", - "json-stringify-pretty-compact": "^2.0.0", - "lodash.template": "^4.4.0", - "mapbox-gl-styles": "2.0.2", - "pixelmatch": "^5.0.2", - "pngjs": "^3.4.0", - "shuffle-seed": "^1.1.6", - "st": "^1.2.2", - "glob": "^7.1.4" - } -} diff --git a/test/integration/query-tests/evaluated/line-width/expected.json b/test/integration/query-tests/evaluated/line-width/expected.json new file mode 100644 index 00000000000..e53c8e492ae --- /dev/null +++ b/test/integration/query-tests/evaluated/line-width/expected.json @@ -0,0 +1,33 @@ +[ + { + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 0, + 0 + ], + [ + 5.009765625, + 14.987239525774243 + ] + ] + }, + "type": "Feature", + "properties": {}, + "id": 1, + "layer": { + "id": "line", + "type": "line", + "source": "mapbox", + "paint": { + "line-width": 20 + }, + "layout": {} + }, + "source": "mapbox", + "state": { + "big": true + } + } +] diff --git a/test/integration/query-tests/evaluated/line-width/style.json b/test/integration/query-tests/evaluated/line-width/style.json new file mode 100644 index 00000000000..2e30e2dee4a --- /dev/null +++ b/test/integration/query-tests/evaluated/line-width/style.json @@ -0,0 +1,62 @@ +{ + "version": 8, + "metadata": { + "skipLayerDelete": true, + "test": { + "width": 64, + "height": 64, + "operations": [ + [ + "wait" + ], + [ + "setFeatureState", + { "source": "mapbox", "id": 1}, + { "big": true } + ], + [ + "wait" + ] + ], + "queryGeometry": [ + 32, + 16 + ] + } + }, + "sources": { + "mapbox": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "id": 1, + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, 0], + [ 5, 15] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "line", + "type": "line", + "source": "mapbox", + "paint": { + "line-width": ["case", + ["boolean", ["feature-state", "big"], false], + ["number", 20], + ["number", 1] + ] + } + } + ] +} diff --git a/test/integration/query-tests/regressions/mapbox-gl-js#3534/style.json b/test/integration/query-tests/regressions/mapbox-gl-js#3534/style.json index a48e146804f..5c0b63b7269 100644 --- a/test/integration/query-tests/regressions/mapbox-gl-js#3534/style.json +++ b/test/integration/query-tests/regressions/mapbox-gl-js#3534/style.json @@ -7,7 +7,7 @@ "height": 500, "queryGeometry": [ 266, - 271 + 275 ], "queryOptions": { "layers": [ diff --git a/test/integration/query-tests/regressions/mapbox-gl-js#8999-2/expected.json b/test/integration/query-tests/regressions/mapbox-gl-js#8999-2/expected.json new file mode 100644 index 00000000000..aa6b91a9b11 --- /dev/null +++ b/test/integration/query-tests/regressions/mapbox-gl-js#8999-2/expected.json @@ -0,0 +1,37 @@ +[ + { + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -19.9951171875, + -40.01078714046552 + ], + [ + -19.9951171875, + 40.01078714046551 + ], + [ + -19.9951171875, + 59.99898612060443 + ], + [ + 19.9951171875, + 20.014645445341372 + ], + [ + -19.9951171875, + -40.01078714046552 + ] + ] + ] + }, + "type": "Feature", + "properties": { + "layer": "extrusion_colinear_points" + }, + "source": "extrusion_colinear_points", + "state": {} + } +] \ No newline at end of file diff --git a/test/integration/query-tests/regressions/mapbox-gl-js#8999-2/style.json b/test/integration/query-tests/regressions/mapbox-gl-js#8999-2/style.json new file mode 100644 index 00000000000..3dcf313c594 --- /dev/null +++ b/test/integration/query-tests/regressions/mapbox-gl-js#8999-2/style.json @@ -0,0 +1,70 @@ +{ + "version": 8, + "metadata": { + "test": { + "debug": true, + "width": 200, + "height": 200, + "queryGeometry": [ + 100, + 40 + ] + } + }, + "pitch": 0, + "center": [ + 0, + 0 + ], + "zoom": 0, + "sources": { + "extrusion_colinear_points": { + "type": "geojson", + "tolerance": 0, + "data": { + "type": "Feature", + "properties": { + "layer": "extrusion_colinear_points" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -20, + -40 + ], + [ + -20, + 40 + ], + [ + -20, + 60 + ], + [ + 20, + 20 + ], + [ + -20, + -40 + ] + ] + ] + } + } + } + }, + "layers": [ + { + "id": "extrusion_colinear_points", + "type": "fill-extrusion", + "source": "extrusion_colinear_points", + "paint": { + "fill-extrusion-color": "#ecc", + "fill-extrusion-height": 0 + } + } + ] +} diff --git a/test/integration/query-tests/regressions/mapbox-gl-js#8999/expected.json b/test/integration/query-tests/regressions/mapbox-gl-js#8999/expected.json new file mode 100644 index 00000000000..dfff758fd3a --- /dev/null +++ b/test/integration/query-tests/regressions/mapbox-gl-js#8999/expected.json @@ -0,0 +1,33 @@ +[ + { + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -19.9951171875, + -40.01078714046552 + ], + [ + -19.9951171875, + 40.01078714046551 + ], + [ + 39.990234375, + 40.01078714046551 + ], + [ + -19.9951171875, + -40.01078714046552 + ] + ] + ] + }, + "type": "Feature", + "properties": { + "layer": "extrusion_three_points" + }, + "source": "extrusion_three_points", + "state": {} + } +] \ No newline at end of file diff --git a/test/integration/query-tests/regressions/mapbox-gl-js#8999/style.json b/test/integration/query-tests/regressions/mapbox-gl-js#8999/style.json new file mode 100644 index 00000000000..79ad18acab5 --- /dev/null +++ b/test/integration/query-tests/regressions/mapbox-gl-js#8999/style.json @@ -0,0 +1,65 @@ +{ + "version": 8, + "metadata": { + "test": { + "debug": true, + "width": 200, + "height": 200, + "queryGeometry": [ + 100, + 40 + ] + } + }, + "pitch": 0, + "center": [ + 0, + 0 + ], + "zoom": 0, + "sources": { + "extrusion_three_points": { + "type": "geojson", + "data": { + "type": "Feature", + "properties": { + "layer": "extrusion_three_points" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -20, + -40 + ], + [ + -20, + 40 + ], + [ + 40, + 40 + ], + [ + -20, + -40 + ] + ] + ] + } + } + } + }, + "layers": [ + { + "id": "extrusion_three_points", + "type": "fill-extrusion", + "source": "extrusion_three_points", + "paint": { + "fill-extrusion-color": "#ecc", + "fill-extrusion-height": 0 + } + } + ] +} diff --git a/test/integration/query-tests/symbol-features-in/tilted-outside/style.json b/test/integration/query-tests/symbol-features-in/tilted-outside/style.json index ad8f0abd2e6..ee2e0a493a5 100644 --- a/test/integration/query-tests/symbol-features-in/tilted-outside/style.json +++ b/test/integration/query-tests/symbol-features-in/tilted-outside/style.json @@ -7,12 +7,12 @@ "height": 500, "queryGeometry": [ [ - 230, - 250 + 160, + 120 ], [ - 300, - 300 + 220, + 160 ] ] } diff --git a/test/integration/query-tests/symbol/inside/style.json b/test/integration/query-tests/symbol/inside/style.json index b7fd69dbca0..af99de2cd48 100644 --- a/test/integration/query-tests/symbol/inside/style.json +++ b/test/integration/query-tests/symbol/inside/style.json @@ -6,8 +6,8 @@ "width": 500, "height": 500, "queryGeometry": [ - 266, - 271 + 265, + 267 ] } }, diff --git a/test/integration/query-tests/symbol/rotated-inside/style.json b/test/integration/query-tests/symbol/rotated-inside/style.json index 420555c5a63..e90cb1432fc 100644 --- a/test/integration/query-tests/symbol/rotated-inside/style.json +++ b/test/integration/query-tests/symbol/rotated-inside/style.json @@ -6,8 +6,8 @@ "width": 500, "height": 500, "queryGeometry": [ - 370, - 305 + 440, + 215 ] } }, diff --git a/test/integration/render-tests/circle-sort-key/literal/expected.png b/test/integration/render-tests/circle-sort-key/literal/expected.png index fa3c256c366..f9be1c32b0c 100644 Binary files a/test/integration/render-tests/circle-sort-key/literal/expected.png and b/test/integration/render-tests/circle-sort-key/literal/expected.png differ diff --git a/test/integration/render-tests/circle-sort-key/literal/style.json b/test/integration/render-tests/circle-sort-key/literal/style.json index c26e5870698..f34f0664012 100644 --- a/test/integration/render-tests/circle-sort-key/literal/style.json +++ b/test/integration/render-tests/circle-sort-key/literal/style.json @@ -7,7 +7,7 @@ "debug": true } }, - "center": [0, 30], + "center": [0.5, 30], "zoom": 1, "sources": { "geojson": { diff --git a/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/expected.png b/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/expected.png new file mode 100644 index 00000000000..32dc67dd0fd Binary files /dev/null and b/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/expected.png differ diff --git a/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/style.json b/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/style.json new file mode 100644 index 00000000000..ef63e9c3da0 --- /dev/null +++ b/test/integration/render-tests/combinations/fill-extrusion--fill-opaque/style.json @@ -0,0 +1,64 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "center": [ + -113.26903, + 35.9654 + ], + "zoom": 11, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [ + [ + [ + -113.27384948730469, + 35.962 + ], + [ + -113.26421051269531, + 35.962 + ], + [ + -113.26421051269531, + 35.97 + ], + [ + -113.27384948730469, + 35.97 + ], + [ + -113.27384948730469, + 35.962 + ] + ] + ] + } + } + }, + "layers": [ + { + "id": "fill-extrusion-translucent", + "type": "fill-extrusion", + "source": "geojson", + "paint": { + "fill-extrusion-color": "red" + } + }, + { + "id": "fill-opaque", + "type": "fill", + "source": "geojson", + "paint": { + "fill-color": "blue" + } + } + ] +} diff --git a/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/expected.png b/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/expected.png new file mode 100644 index 00000000000..b37e2ada066 Binary files /dev/null and b/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json b/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json new file mode 100644 index 00000000000..ba22d1e0b8d --- /dev/null +++ b/test/integration/render-tests/combinations/fill-extrusion--fill-translucent/style.json @@ -0,0 +1,65 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "center": [ + -113.26903, + 35.9654 + ], + "zoom": 11, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [ + [ + [ + -113.27384948730469, + 35.962 + ], + [ + -113.26421051269531, + 35.962 + ], + [ + -113.26421051269531, + 35.97 + ], + [ + -113.27384948730469, + 35.97 + ], + [ + -113.27384948730469, + 35.962 + ] + ] + ] + } + } + }, + "layers": [ + { + "id": "fill-extrusion-translucent", + "type": "fill-extrusion", + "source": "geojson", + "paint": { + "fill-extrusion-color": "red" + } + }, + { + "id": "fill-translucent", + "type": "fill", + "source": "geojson", + "paint": { + "fill-opacity": 0.5, + "fill-color": "blue" + } + } + ] +} diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json index ef63e9c3da0..776b6c86944 100644 --- a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json +++ b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-opaque/style.json @@ -49,6 +49,7 @@ "type": "fill-extrusion", "source": "geojson", "paint": { + "fill-extrusion-opacity": 0.5, "fill-extrusion-color": "red" } }, diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/expected.png b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/expected.png index b37e2ada066..84c0263e05c 100644 Binary files a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/expected.png and b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/expected.png differ diff --git a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json index ba22d1e0b8d..04fe1149d95 100644 --- a/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json +++ b/test/integration/render-tests/combinations/fill-extrusion-translucent--fill-translucent/style.json @@ -49,6 +49,7 @@ "type": "fill-extrusion", "source": "geojson", "paint": { + "fill-extrusion-opacity": 0.5, "fill-extrusion-color": "red" } }, diff --git a/test/integration/render-tests/debug/collision-icon-text-line-translate/expected.png b/test/integration/render-tests/debug/collision-icon-text-line-translate/expected.png new file mode 100644 index 00000000000..dcb0727a4f1 Binary files /dev/null and b/test/integration/render-tests/debug/collision-icon-text-line-translate/expected.png differ diff --git a/test/integration/render-tests/debug/collision-icon-text-line-translate/style.json b/test/integration/render-tests/debug/collision-icon-text-line-translate/style.json new file mode 100644 index 00000000000..15ba4c6086b --- /dev/null +++ b/test/integration/render-tests/debug/collision-icon-text-line-translate/style.json @@ -0,0 +1,81 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "height": 1000, + "width" : 1000 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 12, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [ + 0, + 0 + ], + [ + 0.5, + 0.5 + ] + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "translate", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": "fav-airport-18", + "text-field": "abc", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line", + "symbol-spacing": 50 + }, + "paint": { + "icon-opacity": 1, + "text-color": "hsl(0, 82%, 48%)", + "icon-translate": [ + "interpolate", + ["exponential", 2.0], + ["zoom"], + 9, + ["literal", [0, 0]], + 14, + ["literal", [-130, -130]] + ], + "text-translate": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 9, + ["literal", [0, 0]], + 13, + ["literal", [0, -130]] + ] + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/debug/collision-icon-text-point-translate/expected.png b/test/integration/render-tests/debug/collision-icon-text-point-translate/expected.png new file mode 100644 index 00000000000..bb2a67c4964 Binary files /dev/null and b/test/integration/render-tests/debug/collision-icon-text-point-translate/expected.png differ diff --git a/test/integration/render-tests/debug/collision-icon-text-point-translate/style.json b/test/integration/render-tests/debug/collision-icon-text-point-translate/style.json new file mode 100644 index 00000000000..3103b50a10c --- /dev/null +++ b/test/integration/render-tests/debug/collision-icon-text-point-translate/style.json @@ -0,0 +1,75 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "height": 256, + "width" : 256 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 12, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "translate", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": "fav-airport-18", + "text-field": "abc", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "point", + "symbol-spacing": 20 + }, + "paint": { + "icon-opacity": 1, + "text-color": "hsl(0, 82%, 48%)", + "icon-translate": [ + "interpolate", + ["exponential", 2.0], + ["zoom"], + 9, + ["literal", [0, 0]], + 14, + ["literal", [-130, -130]] + ], + "text-translate": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 9, + ["literal", [0, 0]], + 13, + ["literal", [0, -130]] + ] + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/debug/collision-lines-large-font/expected.png b/test/integration/render-tests/debug/collision-lines-large-font/expected.png new file mode 100644 index 00000000000..17828d650fd Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-large-font/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-large-font/style.json b/test/integration/render-tests/debug/collision-lines-large-font/style.json new file mode 100644 index 00000000000..27a720bd2d7 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-large-font/style.json @@ -0,0 +1,61 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 128 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -10, + 0 + ], + [ + 10, + 0 + ] + ] + } + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "Cover me in Circles", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-size": 36, + "symbol-placement": "line-center" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-notocjk/expected.png b/test/integration/render-tests/debug/collision-lines-notocjk/expected.png new file mode 100644 index 00000000000..bb94f1d5c48 Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-notocjk/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-notocjk/style.json b/test/integration/render-tests/debug/collision-lines-notocjk/style.json new file mode 100644 index 00000000000..c94c3800d64 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-notocjk/style.json @@ -0,0 +1,58 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 128 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -10, + 0 + ], + [ + 10, + 0 + ] + ] + } + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "光中輪的態指那差車", + "text-font": [ "NotoCJK" ], + "text-size": 24, + "symbol-placement": "line-center" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-overscaled/expected.png b/test/integration/render-tests/debug/collision-lines-overscaled/expected.png index 4c68f473ba3..b85bbcbd606 100644 Binary files a/test/integration/render-tests/debug/collision-lines-overscaled/expected.png and b/test/integration/render-tests/debug/collision-lines-overscaled/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-pitched-2/expected.png b/test/integration/render-tests/debug/collision-lines-pitched-2/expected.png new file mode 100644 index 00000000000..fc3cceeb79f Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-pitched-2/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-pitched-2/style.json b/test/integration/render-tests/debug/collision-lines-pitched-2/style.json new file mode 100644 index 00000000000..bc99bfa3536 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-pitched-2/style.json @@ -0,0 +1,76 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 512 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "pitch": 60, + "bearing": 90, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "Some sentence that is quite long" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -20, 4 ], [ 20, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "Another sentence that is even longer than the previous one" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, 0 ], [ 50, 0 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line", + "text-pitch-alignment": "map" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-pitched/expected.png b/test/integration/render-tests/debug/collision-lines-pitched/expected.png index bb2254df577..0a7568e32e6 100644 Binary files a/test/integration/render-tests/debug/collision-lines-pitched/expected.png and b/test/integration/render-tests/debug/collision-lines-pitched/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-simple-words-pitched/expected.png b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/expected.png new file mode 100644 index 00000000000..fc999d109a5 Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-simple-words-pitched/style.json b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/style.json new file mode 100644 index 00000000000..d484aa75f89 --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-simple-words-pitched/style.json @@ -0,0 +1,127 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 512 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "pitch": 60, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "a" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 4 ], [ -1, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "ab" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 0 ], [ -1, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abc" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, -4 ], [ -1, -4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcd" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 4 ], [ 5, 4 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcde" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 0 ], [ 5, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcdef" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, -4 ], [ 5, -4 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line-center", + "text-pitch-alignment": "viewport" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines-simple-words/expected.png b/test/integration/render-tests/debug/collision-lines-simple-words/expected.png new file mode 100644 index 00000000000..5cf9c50334d Binary files /dev/null and b/test/integration/render-tests/debug/collision-lines-simple-words/expected.png differ diff --git a/test/integration/render-tests/debug/collision-lines-simple-words/style.json b/test/integration/render-tests/debug/collision-lines-simple-words/style.json new file mode 100644 index 00000000000..e9f9e7c09fb --- /dev/null +++ b/test/integration/render-tests/debug/collision-lines-simple-words/style.json @@ -0,0 +1,126 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "width": 512, + "height": 128 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 4, + "sources": { + "geojson": { + "type": "geojson", + "maxzoom": 1, + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "properties": { + "name": "a" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 2 ], [ -1, 2 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "ab" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, 0 ], [ -1, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abc" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ -5, -2 ], [ -1, -2 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcd" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 2 ], [ 5, 2 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcde" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, 0 ], [ 5, 0 ] + ] + } + + }, + { + "type": "Feature", + "properties": { + "name": "abcdef" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ 1, -2 ], [ 5, -2 ] + ] + } + + }] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "{name}", + "symbol-spacing": 30, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "symbol-placement": "line-center" + } + } + ] +} diff --git a/test/integration/render-tests/debug/collision-lines/expected.png b/test/integration/render-tests/debug/collision-lines/expected.png index a2476e20f8c..f062d08c71a 100644 Binary files a/test/integration/render-tests/debug/collision-lines/expected.png and b/test/integration/render-tests/debug/collision-lines/expected.png differ diff --git a/test/integration/render-tests/debug/collision/expected.png b/test/integration/render-tests/debug/collision/expected.png index 9f1eeb37fb3..6dc313d9531 100644 Binary files a/test/integration/render-tests/debug/collision/expected.png and b/test/integration/render-tests/debug/collision/expected.png differ diff --git a/test/integration/render-tests/debug/padding/ease-to-btm-distort/expected.png b/test/integration/render-tests/debug/padding/ease-to-btm-distort/expected.png new file mode 100644 index 00000000000..f7ddba62f96 Binary files /dev/null and b/test/integration/render-tests/debug/padding/ease-to-btm-distort/expected.png differ diff --git a/test/integration/render-tests/debug/padding/ease-to-btm-distort/style.json b/test/integration/render-tests/debug/padding/ease-to-btm-distort/style.json new file mode 100644 index 00000000000..df80784d22b --- /dev/null +++ b/test/integration/render-tests/debug/padding/ease-to-btm-distort/style.json @@ -0,0 +1,112 @@ +{ + "version": 8, + "metadata": { + "test": { + "showPadding": true, + "height": 256, + "operations": [ + [ + "easeTo", + { + "padding": { + "top": 10, + "left": 50, + "bottom": 100, + "right": 10 + } + } + ], + [ + "wait", + 500 + ] + ] + } + }, + "center": [ 0, 0 ], + "zoom": 8, + "pitch": 60, + "sources": { + "northward-road": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, -25], + [ 0, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -0.2, -25], + [ -0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0.2, -25], + [ 0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0.2], + [ 25, 0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, -0.2], + [ 25, -0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0], + [ 25, 0] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "line", + "source": "northward-road", + "layout": {}, + "paint": { + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/debug/padding/ease-to-left-distort/expected.png b/test/integration/render-tests/debug/padding/ease-to-left-distort/expected.png new file mode 100644 index 00000000000..2103cffb96c Binary files /dev/null and b/test/integration/render-tests/debug/padding/ease-to-left-distort/expected.png differ diff --git a/test/integration/render-tests/debug/padding/ease-to-left-distort/style.json b/test/integration/render-tests/debug/padding/ease-to-left-distort/style.json new file mode 100644 index 00000000000..9f9d70ad524 --- /dev/null +++ b/test/integration/render-tests/debug/padding/ease-to-left-distort/style.json @@ -0,0 +1,112 @@ +{ + "version": 8, + "metadata": { + "test": { + "showPadding": true, + "height": 256, + "operations": [ + [ + "easeTo", + { + "padding": { + "top": 20, + "left": 250, + "bottom": 10, + "right": 15 + } + } + ], + [ + "wait", + 500 + ] + ] + } + }, + "center": [ 0, 0 ], + "zoom": 8, + "pitch": 60, + "sources": { + "northward-road": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, -25], + [ 0, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -0.2, -25], + [ -0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0.2, -25], + [ 0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0.2], + [ 25, 0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, -0.2], + [ 25, -0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0], + [ 25, 0] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "line", + "source": "northward-road", + "layout": {}, + "paint": { + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/debug/padding/ease-to-no-distort/expected.png b/test/integration/render-tests/debug/padding/ease-to-no-distort/expected.png new file mode 100644 index 00000000000..e709e1c98ed Binary files /dev/null and b/test/integration/render-tests/debug/padding/ease-to-no-distort/expected.png differ diff --git a/test/integration/render-tests/debug/padding/ease-to-no-distort/style.json b/test/integration/render-tests/debug/padding/ease-to-no-distort/style.json new file mode 100644 index 00000000000..46ec2f25030 --- /dev/null +++ b/test/integration/render-tests/debug/padding/ease-to-no-distort/style.json @@ -0,0 +1,127 @@ +{ + "version": 8, + "metadata": { + "test": { + "showPadding": true, + "height": 256, + "operations": [ + [ + "easeTo", + { + "padding": { + "top": 20, + "left": 50, + "bottom": 10, + "right": 250 + } + } + ], + [ + "wait", + 500 + ], + [ + "easeTo", + { + "padding": { + "top": 10, + "left": 10, + "bottom": 10, + "right": 10 + } + } + ], + [ + "wait", + 500 + ] + ] + } + }, + "center": [ 0, 0 ], + "zoom": 8, + "pitch": 60, + "sources": { + "northward-road": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, -25], + [ 0, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -0.2, -25], + [ -0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0.2, -25], + [ 0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0.2], + [ 25, 0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, -0.2], + [ 25, -0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0], + [ 25, 0] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "line", + "source": "northward-road", + "layout": {}, + "paint": { + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/debug/padding/ease-to-right-distort/expected.png b/test/integration/render-tests/debug/padding/ease-to-right-distort/expected.png new file mode 100644 index 00000000000..ddf26422755 Binary files /dev/null and b/test/integration/render-tests/debug/padding/ease-to-right-distort/expected.png differ diff --git a/test/integration/render-tests/debug/padding/ease-to-right-distort/style.json b/test/integration/render-tests/debug/padding/ease-to-right-distort/style.json new file mode 100644 index 00000000000..ccc36c279f8 --- /dev/null +++ b/test/integration/render-tests/debug/padding/ease-to-right-distort/style.json @@ -0,0 +1,112 @@ +{ + "version": 8, + "metadata": { + "test": { + "showPadding": true, + "height": 256, + "operations": [ + [ + "easeTo", + { + "padding": { + "top": 20, + "left": 50, + "bottom": 10, + "right": 250 + } + } + ], + [ + "wait", + 500 + ] + ] + } + }, + "center": [ 0, 0 ], + "zoom": 8, + "pitch": 60, + "sources": { + "northward-road": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, -25], + [ 0, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -0.2, -25], + [ -0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0.2, -25], + [ 0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0.2], + [ 25, 0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, -0.2], + [ 25, -0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0], + [ 25, 0] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "line", + "source": "northward-road", + "layout": {}, + "paint": { + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/debug/padding/ease-to-top-distort/expected.png b/test/integration/render-tests/debug/padding/ease-to-top-distort/expected.png new file mode 100644 index 00000000000..57adfa9d76a Binary files /dev/null and b/test/integration/render-tests/debug/padding/ease-to-top-distort/expected.png differ diff --git a/test/integration/render-tests/debug/padding/ease-to-top-distort/style.json b/test/integration/render-tests/debug/padding/ease-to-top-distort/style.json new file mode 100644 index 00000000000..183d7da9c15 --- /dev/null +++ b/test/integration/render-tests/debug/padding/ease-to-top-distort/style.json @@ -0,0 +1,112 @@ +{ + "version": 8, + "metadata": { + "test": { + "showPadding": true, + "height": 256, + "operations": [ + [ + "easeTo", + { + "padding": { + "top": 100, + "left": 50, + "bottom": 10, + "right": 250 + } + } + ], + [ + "wait", + 500 + ] + ] + } + }, + "center": [ 0, 0 ], + "zoom": 8, + "pitch": 60, + "sources": { + "northward-road": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, -25], + [ 0, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -0.2, -25], + [ -0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0.2, -25], + [ 0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0.2], + [ 25, 0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, -0.2], + [ 25, -0.2] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -25, 0], + [ 25, 0] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "line", + "source": "northward-road", + "layout": {}, + "paint": { + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/debug/padding/set-padding/expected.png b/test/integration/render-tests/debug/padding/set-padding/expected.png new file mode 100644 index 00000000000..c1d5e83e1eb Binary files /dev/null and b/test/integration/render-tests/debug/padding/set-padding/expected.png differ diff --git a/test/integration/render-tests/debug/padding/set-padding/style.json b/test/integration/render-tests/debug/padding/set-padding/style.json new file mode 100644 index 00000000000..c54c836ed35 --- /dev/null +++ b/test/integration/render-tests/debug/padding/set-padding/style.json @@ -0,0 +1,82 @@ +{ + "version": 8, + "metadata": { + "test": { + "showPadding": true, + "height": 256, + "operations": [ + [ + "setPadding", + { + "top": 20, + "left": 125, + "bottom": 10, + "right": 15 + } + ], + [ + "wait" + ] + ] + } + }, + "center": [ 0, 0 ], + "zoom": 8, + "pitch": 60, + "sources": { + "northward-road": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0, -25], + [ 0, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ -0.2, -25], + [ -0.2, 25] + ] + } + },{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ 0.2, -25], + [ 0.2, 25] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line", + "type": "line", + "source": "northward-road", + "layout": {}, + "paint": { + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/debug/raster/expected.png b/test/integration/render-tests/debug/raster/expected.png index b3308e5126b..04f45dc70c9 100644 Binary files a/test/integration/render-tests/debug/raster/expected.png and b/test/integration/render-tests/debug/raster/expected.png differ diff --git a/test/integration/render-tests/debug/raster/style.json b/test/integration/render-tests/debug/raster/style.json index bcd9988a49f..9cc0d03cf9f 100644 --- a/test/integration/render-tests/debug/raster/style.json +++ b/test/integration/render-tests/debug/raster/style.json @@ -3,7 +3,8 @@ "metadata": { "test": { "debug": true, - "height": 256 + "height": 256, + "allowed": 0.0062 } }, "center": [ diff --git a/test/integration/render-tests/debug/tile-overscaled/expected.png b/test/integration/render-tests/debug/tile-overscaled/expected.png index 1d123bd64a3..8ea8baa3839 100644 Binary files a/test/integration/render-tests/debug/tile-overscaled/expected.png and b/test/integration/render-tests/debug/tile-overscaled/expected.png differ diff --git a/test/integration/render-tests/debug/tile-overscaled/style.json b/test/integration/render-tests/debug/tile-overscaled/style.json index 5e81317f233..3d7fce91ec6 100644 --- a/test/integration/render-tests/debug/tile-overscaled/style.json +++ b/test/integration/render-tests/debug/tile-overscaled/style.json @@ -3,7 +3,8 @@ "metadata": { "test": { "debug": true, - "height": 256 + "height": 256, + "allowed": 0.0039 } }, "center": [ diff --git a/test/integration/render-tests/debug/tile/expected.png b/test/integration/render-tests/debug/tile/expected.png index 03993d0c483..12c0ba92834 100644 Binary files a/test/integration/render-tests/debug/tile/expected.png and b/test/integration/render-tests/debug/tile/expected.png differ diff --git a/test/integration/render-tests/debug/tile/style.json b/test/integration/render-tests/debug/tile/style.json index cd2240afff3..fc6888bc79a 100644 --- a/test/integration/render-tests/debug/tile/style.json +++ b/test/integration/render-tests/debug/tile/style.json @@ -3,7 +3,8 @@ "metadata": { "test": { "debug": true, - "height": 256 + "height": 256, + "allowed": 0.0022 } }, "center": [ @@ -12,6 +13,14 @@ ], "zoom": 14, "sources": { + "satellite": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.satellite.png" + ], + "maxzoom": 1, + "tileSize": 256 + }, "mapbox": { "type": "vector", "maxzoom": 14, @@ -30,6 +39,14 @@ "background-color": "white" } }, + { + "id": "raster", + "type": "raster", + "source": "satellite", + "paint": { + "raster-fade-duration": 0 + } + }, { "id": "line", "type": "symbol", diff --git a/test/integration/render-tests/extent/1024-symbol/expected.png b/test/integration/render-tests/extent/1024-symbol/expected.png index f8386467f42..851526dda65 100644 Binary files a/test/integration/render-tests/extent/1024-symbol/expected.png and b/test/integration/render-tests/extent/1024-symbol/expected.png differ diff --git a/test/integration/render-tests/feature-state/promote-id-circle/expected.png b/test/integration/render-tests/feature-state/promote-id-circle/expected.png new file mode 100644 index 00000000000..1587818fee0 Binary files /dev/null and b/test/integration/render-tests/feature-state/promote-id-circle/expected.png differ diff --git a/test/integration/render-tests/feature-state/promote-id-circle/style.json b/test/integration/render-tests/feature-state/promote-id-circle/style.json new file mode 100644 index 00000000000..109309279d7 --- /dev/null +++ b/test/integration/render-tests/feature-state/promote-id-circle/style.json @@ -0,0 +1,99 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32, + "operations": [ + [ + "setFeatureState", + { + "source": "geojson", + "id": "9007199254740992" + }, + { + "color": "red" + } + ], + [ + "setFeatureState", + { + "source": "geojson", + "id": "1.2" + }, + { + "color": "blue" + } + ], + [ + "wait" + ] + ] + } + }, + "zoom": 2, + "sources": { + "geojson": { + "type": "geojson", + "promoteId": "foo", + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + }, + "properties": { + "foo": "9007199254740992" + } + }, { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + 3, + 0 + ] + }, + "properties": { + "foo": "9007199254740993" + } + }, { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + -3, + 0 + ] + }, + "properties": { + "foo": "1.2" + } + }] + } + } + }, + "layers": [ + { + "id": "circle", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 5, + "circle-color": [ + "coalesce", + [ + "feature-state", + "color" + ], + "black" + ] + } + } + ] +} diff --git a/test/integration/render-tests/feature-state/promote-id-fill-extrusion/expected.png b/test/integration/render-tests/feature-state/promote-id-fill-extrusion/expected.png new file mode 100644 index 00000000000..e702d4b422f Binary files /dev/null and b/test/integration/render-tests/feature-state/promote-id-fill-extrusion/expected.png differ diff --git a/test/integration/render-tests/feature-state/promote-id-fill-extrusion/style.json b/test/integration/render-tests/feature-state/promote-id-fill-extrusion/style.json new file mode 100644 index 00000000000..a4a31d62dfa --- /dev/null +++ b/test/integration/render-tests/feature-state/promote-id-fill-extrusion/style.json @@ -0,0 +1,161 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 512, + "operations": [ + [ + "setFeatureState", + { + "source": "geojson", + "id": "9007199254740992" + }, + { + "color": "red" + } + ], + [ + "setFeatureState", + { + "source": "geojson", + "id": "1.2" + }, + { + "color": "blue" + } + ], + [ + "wait" + ] + ] + } + }, + "sources": { + "geojson": { + "type": "geojson", + "promoteId": "foo", + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -0.0005, + -0.0001 + ], + [ + -0.0005, + 0.0001 + ], + [ + -0.0003, + 0.0001 + ], + [ + -0.0003, + -0.0001 + ], + [ + -0.0005, + -0.0001 + ] + ] + ] + }, + "properties": { + "foo": "9007199254740992" + } + }, { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -0.0001, + -0.0001 + ], + [ + -0.0001, + 0.0001 + ], + [ + 0.0001, + 0.0001 + ], + [ + 0.0001, + -0.0001 + ], + [ + -0.0001, + -0.0001 + ] + ] + ] + }, + "properties": { + "foo": "9007199254740993" + } + }, { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0003, + -0.0001 + ], + [ + 0.0003, + 0.0001 + ], + [ + 0.0005, + 0.0001 + ], + [ + 0.0005, + -0.0001 + ], + [ + 0.0003, + -0.0001 + ] + ] + ] + }, + "properties": { + "foo": "1.2" + } + }] + } + } + }, + "pitch": 60, + "zoom": 18, + "layers": [ + { + "id": "fill-extrusion", + "type": "fill-extrusion", + "source": "geojson", + "paint": { + "fill-extrusion-height": 10, + "fill-extrusion-base": 0, + "fill-extrusion-color": [ + "coalesce", + [ + "feature-state", + "color" + ], + "black" + ] + } + } + ] +} diff --git a/test/integration/render-tests/feature-state/promote-id-fill/expected.png b/test/integration/render-tests/feature-state/promote-id-fill/expected.png new file mode 100644 index 00000000000..aa7e7f3f27b Binary files /dev/null and b/test/integration/render-tests/feature-state/promote-id-fill/expected.png differ diff --git a/test/integration/render-tests/feature-state/promote-id-fill/style.json b/test/integration/render-tests/feature-state/promote-id-fill/style.json new file mode 100644 index 00000000000..31514683e4d --- /dev/null +++ b/test/integration/render-tests/feature-state/promote-id-fill/style.json @@ -0,0 +1,114 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32, + "operations": [ + [ + "setFeatureState", + { + "source": "geojson", + "id": "9007199254740992" + }, + { + "color": "red" + } + ], + [ + "setFeatureState", + { + "source": "geojson", + "id": "1.2" + }, + { + "color": "blue" + } + ], + [ + "wait" + ] + ] + } + }, + "zoom": 2, + "sources": { + "geojson": { + "type": "geojson", + "promoteId": "foo", + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ -5, -1 ], + [ -5, 1 ], + [ -3, 1 ], + [ -3, -1 ], + [ -5, -1 ] + ] + ] + }, + "properties": { + "foo": "9007199254740992" + } + }, { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ -1, -1 ], + [ -1, 1 ], + [ 1, 1 ], + [ 1, -1 ], + [ -0.5, -1 ] + ] + ] + }, + "properties": { + "foo": "9007199254740993" + } + }, { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ 3, -1 ], + [ 3, 1 ], + [ 5, 1 ], + [ 5, -1 ], + [ 3, -1 ] + ] + ] + }, + "properties": { + "foo": "1.2" + } + }] + } + } + }, + "layers": [ + { + "id": "fill", + "type": "fill", + "source": "geojson", + "paint": { + "fill-antialias": false, + "fill-color": [ + "coalesce", + [ + "feature-state", + "color" + ], + "black" + ] + } + } + ] +} diff --git a/test/integration/render-tests/feature-state/promote-id-line/expected.png b/test/integration/render-tests/feature-state/promote-id-line/expected.png new file mode 100644 index 00000000000..55bfc9fa640 Binary files /dev/null and b/test/integration/render-tests/feature-state/promote-id-line/expected.png differ diff --git a/test/integration/render-tests/feature-state/promote-id-line/style.json b/test/integration/render-tests/feature-state/promote-id-line/style.json new file mode 100644 index 00000000000..b2ec7836cde --- /dev/null +++ b/test/integration/render-tests/feature-state/promote-id-line/style.json @@ -0,0 +1,116 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32, + "operations": [ + [ + "setFeatureState", + { + "source": "geojson", + "id": "9007199254740992" + }, + { + "color": "red" + } + ], + [ + "setFeatureState", + { + "source": "geojson", + "id": "1.2" + }, + { + "color": "blue" + } + ], + [ + "wait" + ] + ] + } + }, + "sources": { + "geojson": { + "type": "geojson", + "promoteId": "foo", + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -10, + -10 + ], + [ + -10, + 10 + ] + ] + }, + "properties": { + "foo": "9007199254740992" + } + }, { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 0, + -10 + ], + [ + 0, + 10 + ] + ] + }, + "properties": { + "foo": "9007199254740993" + } + }, { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 10, + -10 + ], + [ + 10, + 10 + ] + ] + }, + "properties": { + "foo": "1.2" + } + }] + } + } + }, + "layers": [ + { + "id": "line", + "type": "line", + "source": "geojson", + "paint": { + "line-width": 5, + "line-color": [ + "coalesce", + [ + "feature-state", + "color" + ], + "black" + ] + } + } + ] +} diff --git a/test/integration/render-tests/feature-state/promote-id-symbol/expected.png b/test/integration/render-tests/feature-state/promote-id-symbol/expected.png new file mode 100644 index 00000000000..3c3d132c91a Binary files /dev/null and b/test/integration/render-tests/feature-state/promote-id-symbol/expected.png differ diff --git a/test/integration/render-tests/feature-state/promote-id-symbol/style.json b/test/integration/render-tests/feature-state/promote-id-symbol/style.json new file mode 100644 index 00000000000..374dc13e84e --- /dev/null +++ b/test/integration/render-tests/feature-state/promote-id-symbol/style.json @@ -0,0 +1,103 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32, + "operations": [ + [ + "setFeatureState", + { + "source": "geojson", + "id": "9007199254740992" + }, + { + "color": "red" + } + ], + [ + "setFeatureState", + { + "source": "geojson", + "id": "1.2" + }, + { + "color": "blue" + } + ], + [ + "wait" + ] + ] + } + }, + "zoom": 2, + "sprite": "local://sprites/sprite", + "sources": { + "geojson": { + "type": "geojson", + "promoteId": "foo", + "data": { + "type": "FeatureCollection", + "features": [{ + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + }, + "properties": { + "foo": "9007199254740992" + } + }, { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + 3, + 0 + ] + }, + "properties": { + "foo": "9007199254740993" + } + }, { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + -3, + 0 + ] + }, + "properties": { + "foo": "1.2" + } + }] + } + } + }, + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": "dot.sdf", + "icon-allow-overlap": true + }, + "paint": { + "icon-color": [ + "coalesce", + [ + "feature-state", + "color" + ], + "black" + ] + } + } + ] +} diff --git a/test/integration/render-tests/fill-extrusion-base/property-function/expected.png b/test/integration/render-tests/fill-extrusion-base/property-function/expected.png index 65da9bc3c45..8c0a222d01d 100644 Binary files a/test/integration/render-tests/fill-extrusion-base/property-function/expected.png and b/test/integration/render-tests/fill-extrusion-base/property-function/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-base/zoom-and-property-function/expected.png b/test/integration/render-tests/fill-extrusion-base/zoom-and-property-function/expected.png index 441dc0f0173..e215a543852 100644 Binary files a/test/integration/render-tests/fill-extrusion-base/zoom-and-property-function/expected.png and b/test/integration/render-tests/fill-extrusion-base/zoom-and-property-function/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-multiple/multiple/expected.png b/test/integration/render-tests/fill-extrusion-multiple/multiple/expected.png index 42faa2bc3fd..462388936d2 100644 Binary files a/test/integration/render-tests/fill-extrusion-multiple/multiple/expected.png and b/test/integration/render-tests/fill-extrusion-multiple/multiple/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-opacity/default/expected.png b/test/integration/render-tests/fill-extrusion-opacity/default/expected.png index 06fac49b6c4..f3e842403e1 100644 Binary files a/test/integration/render-tests/fill-extrusion-opacity/default/expected.png and b/test/integration/render-tests/fill-extrusion-opacity/default/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-opacity/function/expected.png b/test/integration/render-tests/fill-extrusion-opacity/function/expected.png index 98c4fa5563c..92d92fc0a4f 100644 Binary files a/test/integration/render-tests/fill-extrusion-opacity/function/expected.png and b/test/integration/render-tests/fill-extrusion-opacity/function/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-opacity/literal/expected.png b/test/integration/render-tests/fill-extrusion-opacity/literal/expected.png index 1b853944e23..4f37e45d541 100644 Binary files a/test/integration/render-tests/fill-extrusion-opacity/literal/expected.png and b/test/integration/render-tests/fill-extrusion-opacity/literal/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-pattern/1.5x-on-1x-add-image/expected.png b/test/integration/render-tests/fill-extrusion-pattern/1.5x-on-1x-add-image/expected.png new file mode 100644 index 00000000000..554e1afa3a2 Binary files /dev/null and b/test/integration/render-tests/fill-extrusion-pattern/1.5x-on-1x-add-image/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-pattern/1.5x-on-1x-add-image/style.json b/test/integration/render-tests/fill-extrusion-pattern/1.5x-on-1x-add-image/style.json new file mode 100644 index 00000000000..833132a7a65 --- /dev/null +++ b/test/integration/render-tests/fill-extrusion-pattern/1.5x-on-1x-add-image/style.json @@ -0,0 +1,93 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "width": 256, + "pixelRatio": 1, + "operations": [ + [ + "wait" + ], + [ + "addImage", + "pattern", + "./image/marker.png", + { + "pixelRatio": 1.5 + } + ], + [ + "wait" + ], + [ + "addSource", + "geojson", + { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "property": 20 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -0.0001, + -0.0001 + ], + [ + -0.0001, + 0.0001 + ], + [ + 0.0001, + 0.0001 + ], + [ + 0.0001, + -0.0001 + ], + [ + -0.0001, + -0.0001 + ] + ] + ] + } + } + ] + } + } + ], + [ + "wait" + ], + [ + "addLayer", + { + "id": "extrusion", + "type": "fill-extrusion", + "source": "geojson", + "paint": { + "fill-extrusion-pattern": "pattern", + "fill-extrusion-height": 10 + } + } + ], + [ + "wait" + ] + ] + } + }, + "pitch": 60, + "zoom": 19, + "sources": {}, + "layers": [] +} diff --git a/test/integration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/expected.png b/test/integration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/expected.png new file mode 100644 index 00000000000..589f07ac825 Binary files /dev/null and b/test/integration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/style.json b/test/integration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/style.json new file mode 100644 index 00000000000..24a0e344303 --- /dev/null +++ b/test/integration/render-tests/fill-extrusion-pattern/2x-on-1x-add-image-dds/style.json @@ -0,0 +1,97 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "width": 256, + "pixelRatio": 1, + "operations": [ + [ + "wait" + ], + [ + "addImage", + "pattern", + "./image/marker.png", + { + "pixelRatio": 2 + } + ], + [ + "wait" + ], + [ + "addSource", + "geojson", + { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "height": 10 + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -0.0001, + -0.0001 + ], + [ + -0.0001, + 0.0001 + ], + [ + 0.0001, + 0.0001 + ], + [ + 0.0001, + -0.0001 + ], + [ + -0.0001, + -0.0001 + ] + ] + ] + } + } + ] + } + } + ], + [ + "wait" + ], + [ + "addLayer", + { + "id": "extrusion", + "type": "fill-extrusion", + "source": "geojson", + "paint": { + "fill-extrusion-pattern": { + "property": "height", + "type": "interval", + "stops": [[0, "pattern"]] + }, + "fill-extrusion-height": 10 + } + } + ], + [ + "wait" + ] + ] + } + }, + "pitch": 60, + "zoom": 19, + "sources": {}, + "layers": [] +} diff --git a/test/integration/render-tests/fill-extrusion-pattern/feature-expression/expected.png b/test/integration/render-tests/fill-extrusion-pattern/feature-expression/expected.png index d7573106f76..e8051b28c0e 100644 Binary files a/test/integration/render-tests/fill-extrusion-pattern/feature-expression/expected.png and b/test/integration/render-tests/fill-extrusion-pattern/feature-expression/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-pattern/function/expected.png b/test/integration/render-tests/fill-extrusion-pattern/function/expected.png index e60cd56c3a6..4d75055649a 100644 Binary files a/test/integration/render-tests/fill-extrusion-pattern/function/expected.png and b/test/integration/render-tests/fill-extrusion-pattern/function/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-pattern/literal/expected.png b/test/integration/render-tests/fill-extrusion-pattern/literal/expected.png index 8f4c7eb60d7..4d75055649a 100644 Binary files a/test/integration/render-tests/fill-extrusion-pattern/literal/expected.png and b/test/integration/render-tests/fill-extrusion-pattern/literal/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-pattern/opacity/expected.png b/test/integration/render-tests/fill-extrusion-pattern/opacity/expected.png index 31f8fb76e34..7b38bfdfbb6 100644 Binary files a/test/integration/render-tests/fill-extrusion-pattern/opacity/expected.png and b/test/integration/render-tests/fill-extrusion-pattern/opacity/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-translate/default/expected.png b/test/integration/render-tests/fill-extrusion-translate/default/expected.png index 6b2ddaabc09..32c7fcc0b2a 100644 Binary files a/test/integration/render-tests/fill-extrusion-translate/default/expected.png and b/test/integration/render-tests/fill-extrusion-translate/default/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-vertical-gradient/default/expected.png b/test/integration/render-tests/fill-extrusion-vertical-gradient/default/expected.png index ce1c4f52c99..051c62a6002 100644 Binary files a/test/integration/render-tests/fill-extrusion-vertical-gradient/default/expected.png and b/test/integration/render-tests/fill-extrusion-vertical-gradient/default/expected.png differ diff --git a/test/integration/render-tests/fill-extrusion-vertical-gradient/false/expected.png b/test/integration/render-tests/fill-extrusion-vertical-gradient/false/expected.png index 1ce43e1d89c..48ddf5ab016 100644 Binary files a/test/integration/render-tests/fill-extrusion-vertical-gradient/false/expected.png and b/test/integration/render-tests/fill-extrusion-vertical-gradient/false/expected.png differ diff --git a/test/integration/render-tests/fill-pattern/3x-on-2x-add-image/expected.png b/test/integration/render-tests/fill-pattern/3x-on-2x-add-image/expected.png new file mode 100644 index 00000000000..3116105e8eb Binary files /dev/null and b/test/integration/render-tests/fill-pattern/3x-on-2x-add-image/expected.png differ diff --git a/test/integration/render-tests/fill-pattern/3x-on-2x-add-image/style.json b/test/integration/render-tests/fill-pattern/3x-on-2x-add-image/style.json new file mode 100644 index 00000000000..485b531f73f --- /dev/null +++ b/test/integration/render-tests/fill-pattern/3x-on-2x-add-image/style.json @@ -0,0 +1,79 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "pixelRatio": 2, + "operations": [ + [ + "wait" + ], + [ + "addImage", + "pattern", + "./image/marker.png", + { + "pixelRatio": 3 + } + ], + [ + "wait" + ], + [ + "addSource", + "geojson", + { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [ + [ + [ + -10, + -10 + ], + [ + -10, + 10 + ], + [ + 10, + 10 + ], + [ + 10, + -10 + ], + [ + -10, + -10 + ] + ] + ] + } + } + ], + [ + "wait" + ], + [ + "addLayer", + { + "id": "fill", + "type": "fill", + "source": "geojson", + "paint": { + "fill-pattern": "pattern" + } + } + ], + [ + "wait" + ] + ] + } + }, + "sources": {}, + "layers": [] +} diff --git a/test/integration/render-tests/fill-pattern/update-feature-state/expected.png b/test/integration/render-tests/fill-pattern/update-feature-state/expected.png index d619e74c765..bccb3e19cf6 100644 Binary files a/test/integration/render-tests/fill-pattern/update-feature-state/expected.png and b/test/integration/render-tests/fill-pattern/update-feature-state/expected.png differ diff --git a/test/integration/render-tests/fill-pattern/update-feature-state/style.json b/test/integration/render-tests/fill-pattern/update-feature-state/style.json index 5df29c73990..4b534505751 100644 --- a/test/integration/render-tests/fill-pattern/update-feature-state/style.json +++ b/test/integration/render-tests/fill-pattern/update-feature-state/style.json @@ -27,34 +27,42 @@ "geojson": { "type": "geojson", "data": { - "type": "Polygon", - "id": 1, - "properties": { - "pattern": "generic_icon" - }, - "coordinates": [ - [ - [ - -10, - -10 - ], - [ - -10, - 10 - ], - [ - 10, - 10 - ], - [ - 10, - -10 - ], - [ - -10, - -10 - ] - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": 1, + "properties": { + "pattern": "generic_icon" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -10, + -10 + ], + [ + -10, + 10 + ], + [ + 10, + 10 + ], + [ + 10, + -10 + ], + [ + -10, + -10 + ] + ] + ] + } + } ] } } diff --git a/test/integration/render-tests/filter/in/expected.png b/test/integration/render-tests/filter/in/expected.png new file mode 100644 index 00000000000..8886ddfa061 Binary files /dev/null and b/test/integration/render-tests/filter/in/expected.png differ diff --git a/test/integration/render-tests/filter/in/style.json b/test/integration/render-tests/filter/in/style.json new file mode 100644 index 00000000000..67c01c41248 --- /dev/null +++ b/test/integration/render-tests/filter/in/style.json @@ -0,0 +1,99 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "sources": { + "quadrants": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name": "ABC", + "color": "red" + }, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [-180, -90], + [-180, 0], + [0, 0], + [0, -90], + [-180, -90] + ]] + } + }, + { + "type": "Feature", + "properties": { + "name": "DEF", + "color": "#00ff00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [-180, 90], + [-180, 0], + [0, 0], + [0, 90], + [-180, 90] + ]] + } + }, + { + "type": "Feature", + "properties": { + "name": "GHI", + "color": "#0000ff" + }, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [180, -90], + [180, 0], + [0, 0], + [0, -90], + [180, -90] + ]] + } + }, + { + "type": "Feature", + "properties": { + "name": "GHI", + "color": "#ffff00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [180, 90], + [180, 0], + [0, 0], + [0, 90], + [180, 90] + ]] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "colors", + "type": "fill", + "source": "quadrants", + "filter": ["in", "#", ["get", "color"]], + "paint": { + "fill-color": ["get", "color"] + } + } + ] +} diff --git a/test/integration/render-tests/icon-image/icon-sdf-non-sdf-one-layer/expected.png b/test/integration/render-tests/icon-image/icon-sdf-non-sdf-one-layer/expected.png new file mode 100644 index 00000000000..4861e66a75c Binary files /dev/null and b/test/integration/render-tests/icon-image/icon-sdf-non-sdf-one-layer/expected.png differ diff --git a/test/integration/render-tests/icon-image/icon-sdf-non-sdf-one-layer/style.json b/test/integration/render-tests/icon-image/icon-sdf-non-sdf-one-layer/style.json new file mode 100644 index 00000000000..4970e0005fc --- /dev/null +++ b/test/integration/render-tests/icon-image/icon-sdf-non-sdf-one-layer/style.json @@ -0,0 +1,62 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width" : 128 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 0, + "sources": { + "geojson": + { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [0, 0] + }, + "properties": { + "icon": "squares-18" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [20, 20] + }, + "properties": { + "icon": "dot.sdf" + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "background", + "type": "background", + "paint": {"background-color": "white"} + + }, + { + "id": "sdf-icon-mix", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": ["get", "icon"] + } + } + ] +} diff --git a/test/integration/render-tests/icon-image/image-expression/expected.png b/test/integration/render-tests/icon-image/image-expression/expected.png new file mode 100644 index 00000000000..0cd32ecc454 Binary files /dev/null and b/test/integration/render-tests/icon-image/image-expression/expected.png differ diff --git a/test/integration/render-tests/icon-image/image-expression/style.json b/test/integration/render-tests/icon-image/image-expression/style.json new file mode 100644 index 00000000000..7f0390b0e92 --- /dev/null +++ b/test/integration/render-tests/icon-image/image-expression/style.json @@ -0,0 +1,32 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 64, + "width": 64 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": ["coalesce", ["image", "dot.sdf"], ["image", "foo"]] + } + } + ] +} diff --git a/test/integration/render-tests/icon-image/stretchable-content/expected.png b/test/integration/render-tests/icon-image/stretchable-content/expected.png new file mode 100644 index 00000000000..04453e4b961 Binary files /dev/null and b/test/integration/render-tests/icon-image/stretchable-content/expected.png differ diff --git a/test/integration/render-tests/icon-image/stretchable-content/style.json b/test/integration/render-tests/icon-image/stretchable-content/style.json new file mode 100644 index 00000000000..b4914406fd6 --- /dev/null +++ b/test/integration/render-tests/icon-image/stretchable-content/style.json @@ -0,0 +1,41 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "zoom": 0.5, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": "nine-part", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-image/stretchable/expected.png b/test/integration/render-tests/icon-image/stretchable/expected.png new file mode 100644 index 00000000000..5a8e5d5b41a Binary files /dev/null and b/test/integration/render-tests/icon-image/stretchable/expected.png differ diff --git a/test/integration/render-tests/icon-image/stretchable/style.json b/test/integration/render-tests/icon-image/stretchable/style.json new file mode 100644 index 00000000000..56edb0c4305 --- /dev/null +++ b/test/integration/render-tests/icon-image/stretchable/style.json @@ -0,0 +1,41 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "zoom": 0.5, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "layout": { + "icon-image": "nine-part-content", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor-text-fit/expected.png b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor-text-fit/expected.png new file mode 100644 index 00000000000..1e46bda35fe Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor-text-fit/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor-text-fit/style.json b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor-text-fit/style.json new file mode 100644 index 00000000000..df1eb8aa177 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor-text-fit/style.json @@ -0,0 +1,73 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "allowed": 0.00025 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -8 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -8 ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABC", + "text-anchor": "top", + "text-offset": [0, 0.5], + "text-variable-anchor": ["left", "right"], + "text-radial-offset": 0.3, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "motorway_lg_6", + "icon-text-fit": "both", + "icon-text-fit-padding": [0, 4, 0, 4] + } + }, + { + "id": "symbol_with_offset", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABC", + "text-offset": [0, -1.5], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "motorway_lg_6", + "icon-text-fit": "both", + "icon-text-fit-padding": [0, 4, 0, 4] + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor/expected.png b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor/expected.png new file mode 100644 index 00000000000..08b51c9337f Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor/style.json b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor/style.json new file mode 100644 index 00000000000..c1f2213864a --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-collision-variable-anchor/style.json @@ -0,0 +1,70 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "allowed": 0.00025 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -8 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -8 ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABC", + "text-anchor": "top", + "text-offset": [0, 0.5], + "text-variable-anchor": ["left", "right"], + "text-radial-offset": 0.1, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "symbol_with_offset", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABC", + "text-offset": [0, -1.5], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "motorway_lg_6", + "icon-text-fit": "both", + "icon-text-fit-padding": [0, 4, 0, 4] + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-collision/expected.png b/test/integration/render-tests/icon-text-fit/both-collision/expected.png new file mode 100644 index 00000000000..5c069e64a82 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-collision/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-collision/style.json b/test/integration/render-tests/icon-text-fit/both-collision/style.json new file mode 100644 index 00000000000..7296ab56940 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-collision/style.json @@ -0,0 +1,56 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + -4 + ] + } + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABC", + "text-anchor": "top", + "text-offset": [0, 0.5], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "motorway_lg_6" + } + }, + { + "id": "symbol_with_offset", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABC", + "text-offset": [0, -1.5], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "motorway_lg_6", + "icon-text-fit": "both", + "icon-text-fit-padding": [0, 4, 0, 4] + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-padding/expected.png b/test/integration/render-tests/icon-text-fit/both-padding/expected.png index 488099e3dbf..fb545001ce7 100644 Binary files a/test/integration/render-tests/icon-text-fit/both-padding/expected.png and b/test/integration/render-tests/icon-text-fit/both-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-1x-image-2x-screen/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor-1x-image-2x-screen/expected.png new file mode 100644 index 00000000000..69a22d5e171 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor-1x-image-2x-screen/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-1x-image-2x-screen/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor-1x-image-2x-screen/style.json new file mode 100644 index 00000000000..087a99dd604 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor-1x-image-2x-screen/style.json @@ -0,0 +1,193 @@ +{ + "version": 8, + "metadata": { + "test": { + "pixelRatio": 2, + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit-1x", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-1x-screen/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-1x-screen/expected.png new file mode 100644 index 00000000000..6b27859c39e Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-1x-screen/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-1x-screen/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-1x-screen/style.json new file mode 100644 index 00000000000..d21af0963b4 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-1x-screen/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit-2x", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-2x-screen/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-2x-screen/expected.png new file mode 100644 index 00000000000..585b0d15857 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-2x-screen/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-2x-screen/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-2x-screen/style.json new file mode 100644 index 00000000000..1e75952eb13 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor-2x-image-2x-screen/style.json @@ -0,0 +1,194 @@ +{ + "version": 8, + "metadata": { + "test": { + "pixelRatio": 2, + "width": 200, + "height": 150, + "allowed": 0.001 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-anchor/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-anchor/expected.png new file mode 100644 index 00000000000..95ca30121e0 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-anchor/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-anchor/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-anchor/style.json new file mode 100644 index 00000000000..354b691aa72 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-anchor/style.json @@ -0,0 +1,201 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true, + "icon-anchor": "top-left" + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-offset/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-offset/expected.png new file mode 100644 index 00000000000..6f2af350db5 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-offset/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-offset/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-offset/style.json new file mode 100644 index 00000000000..9218b731040 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor-icon-offset/style.json @@ -0,0 +1,201 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-offset": [ 4, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-padding/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor-padding/expected.png new file mode 100644 index 00000000000..ed953be8afb Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor-padding/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor-padding/style.json new file mode 100644 index 00000000000..3be058e38f8 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor-padding/style.json @@ -0,0 +1,201 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor/expected.png b/test/integration/render-tests/icon-text-fit/both-text-anchor/expected.png new file mode 100644 index 00000000000..95ca30121e0 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/both-text-anchor/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/both-text-anchor/style.json b/test/integration/render-tests/icon-text-fit/both-text-anchor/style.json new file mode 100644 index 00000000000..b3a3e0b7772 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/both-text-anchor/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/both/expected.png b/test/integration/render-tests/icon-text-fit/both/expected.png index 293d3854925..809bdcbd86c 100644 Binary files a/test/integration/render-tests/icon-text-fit/both/expected.png and b/test/integration/render-tests/icon-text-fit/both/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/enlargen-both-padding/expected.png b/test/integration/render-tests/icon-text-fit/enlargen-both-padding/expected.png new file mode 100644 index 00000000000..7541ddfcb74 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/enlargen-both-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/enlargen-both-padding/style.json b/test/integration/render-tests/icon-text-fit/enlargen-both-padding/style.json new file mode 100644 index 00000000000..2114e648b4f --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/enlargen-both-padding/style.json @@ -0,0 +1,42 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 150, + "height": 64, + "allowed": 0.005 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABCD efgh", + "text-size": 24, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "small-box", + "icon-text-fit": "both", + "icon-text-fit-padding": [ 12, 8, 4, 2 ] + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/enlargen-both/expected.png b/test/integration/render-tests/icon-text-fit/enlargen-both/expected.png new file mode 100644 index 00000000000..26e70320f9e Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/enlargen-both/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/enlargen-both/style.json b/test/integration/render-tests/icon-text-fit/enlargen-both/style.json new file mode 100644 index 00000000000..7c76c51f153 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/enlargen-both/style.json @@ -0,0 +1,41 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 128, + "height": 64, + "allowed": 0.004 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABCD efgh", + "text-size": 24, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "small-box", + "icon-text-fit": "both" + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/enlargen-height/expected.png b/test/integration/render-tests/icon-text-fit/enlargen-height/expected.png new file mode 100644 index 00000000000..e4950716277 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/enlargen-height/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/enlargen-height/style.json b/test/integration/render-tests/icon-text-fit/enlargen-height/style.json new file mode 100644 index 00000000000..2cf205f0b6d --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/enlargen-height/style.json @@ -0,0 +1,40 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 128, + "height": 64 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABCD efgh", + "text-size": 24, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "small-box", + "icon-text-fit": "height" + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/enlargen-width/expected.png b/test/integration/render-tests/icon-text-fit/enlargen-width/expected.png new file mode 100644 index 00000000000..ad9c5ca6e6f Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/enlargen-width/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/enlargen-width/style.json b/test/integration/render-tests/icon-text-fit/enlargen-width/style.json new file mode 100644 index 00000000000..00f0e293488 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/enlargen-width/style.json @@ -0,0 +1,41 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 128, + "height": 64, + "allowed": 0.002 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-field": "ABCD efgh", + "text-size": 24, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "small-box", + "icon-text-fit": "width" + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/height-padding/expected.png b/test/integration/render-tests/icon-text-fit/height-padding/expected.png index 1cc77cba5c2..ac07d82e7ca 100644 Binary files a/test/integration/render-tests/icon-text-fit/height-padding/expected.png and b/test/integration/render-tests/icon-text-fit/height-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/height-padding/style.json b/test/integration/render-tests/icon-text-fit/height-padding/style.json index fe1d98bf618..377ef31c01c 100644 --- a/test/integration/render-tests/icon-text-fit/height-padding/style.json +++ b/test/integration/render-tests/icon-text-fit/height-padding/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "width": 64, + "width": 96, "height": 64 } }, diff --git a/test/integration/render-tests/icon-text-fit/height-text-anchor-padding/expected.png b/test/integration/render-tests/icon-text-fit/height-text-anchor-padding/expected.png new file mode 100644 index 00000000000..301592014d9 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/height-text-anchor-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/height-text-anchor-padding/style.json b/test/integration/render-tests/icon-text-fit/height-text-anchor-padding/style.json new file mode 100644 index 00000000000..253b546ff42 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/height-text-anchor-padding/style.json @@ -0,0 +1,201 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/height-text-anchor/expected.png b/test/integration/render-tests/icon-text-fit/height-text-anchor/expected.png new file mode 100644 index 00000000000..2b6e781e52d Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/height-text-anchor/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/height-text-anchor/style.json b/test/integration/render-tests/icon-text-fit/height-text-anchor/style.json new file mode 100644 index 00000000000..582d02aab07 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/height-text-anchor/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/height/expected.png b/test/integration/render-tests/icon-text-fit/height/expected.png index 678eade07cd..5c743d5773c 100644 Binary files a/test/integration/render-tests/icon-text-fit/height/expected.png and b/test/integration/render-tests/icon-text-fit/height/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/height/style.json b/test/integration/render-tests/icon-text-fit/height/style.json index 238fd32ea89..58263210f9f 100644 --- a/test/integration/render-tests/icon-text-fit/height/style.json +++ b/test/integration/render-tests/icon-text-fit/height/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "width": 64, + "width": 96, "height": 64 } }, diff --git a/test/integration/render-tests/icon-text-fit/none/expected.png b/test/integration/render-tests/icon-text-fit/none/expected.png index e0d0152e778..cb6040cdd9d 100644 Binary files a/test/integration/render-tests/icon-text-fit/none/expected.png and b/test/integration/render-tests/icon-text-fit/none/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/none/style.json b/test/integration/render-tests/icon-text-fit/none/style.json index fa87941aaa4..d5a1ea09179 100644 --- a/test/integration/render-tests/icon-text-fit/none/style.json +++ b/test/integration/render-tests/icon-text-fit/none/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "width": 64, + "width": 96, "height": 64 } }, diff --git a/test/integration/render-tests/icon-text-fit/placement-line/expected.png b/test/integration/render-tests/icon-text-fit/placement-line/expected.png index 8c0f2ba16f1..0de83fd974a 100644 Binary files a/test/integration/render-tests/icon-text-fit/placement-line/expected.png and b/test/integration/render-tests/icon-text-fit/placement-line/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-fifteen-part/expected.png b/test/integration/render-tests/icon-text-fit/stretch-fifteen-part/expected.png new file mode 100644 index 00000000000..e9a97643789 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-fifteen-part/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-fifteen-part/style.json b/test/integration/render-tests/icon-text-fit/stretch-fifteen-part/style.json new file mode 100644 index 00000000000..f06d1490eeb --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-fifteen-part/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "fifteen-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-@2x/expected.png b/test/integration/render-tests/icon-text-fit/stretch-nine-part-@2x/expected.png new file mode 100644 index 00000000000..fe56e368c01 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-nine-part-@2x/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-@2x/style.json b/test/integration/render-tests/icon-text-fit/stretch-nine-part-@2x/style.json new file mode 100644 index 00000000000..d7ebfbd8afc --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-nine-part-@2x/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-@2x", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-content-collision/expected.png b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content-collision/expected.png new file mode 100644 index 00000000000..efa33d5b53a Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content-collision/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-content-collision/style.json b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content-collision/style.json new file mode 100644 index 00000000000..b7d16e7207c --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content-collision/style.json @@ -0,0 +1,156 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "icon-image": "nine-part-content", + "icon-text-fit": "both" + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-content/expected.png b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content/expected.png new file mode 100644 index 00000000000..87b0ca1431c Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-content/style.json b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content/style.json new file mode 100644 index 00000000000..f0babee1c58 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-nine-part-content/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ABC", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part-content", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-height/expected.png b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-height/expected.png new file mode 100644 index 00000000000..cedb6506279 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-height/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-height/style.json b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-height/style.json new file mode 100644 index 00000000000..650f9a9e169 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-height/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "height", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-width/expected.png b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-width/expected.png new file mode 100644 index 00000000000..0d59496c399 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-width/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-width/style.json b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-width/style.json new file mode 100644 index 00000000000..9776d8cc4dd --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-nine-part-just-width/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDFASDF", + "text-size": 10, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part/expected.png b/test/integration/render-tests/icon-text-fit/stretch-nine-part/expected.png new file mode 100644 index 00000000000..8a035589456 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-nine-part/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-nine-part/style.json b/test/integration/render-tests/icon-text-fit/stretch-nine-part/style.json new file mode 100644 index 00000000000..547817396e9 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-nine-part/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "nine-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-three-part/expected.png b/test/integration/render-tests/icon-text-fit/stretch-three-part/expected.png new file mode 100644 index 00000000000..eee29df9f9d Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-three-part/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-three-part/style.json b/test/integration/render-tests/icon-text-fit/stretch-three-part/style.json new file mode 100644 index 00000000000..30cebd99ce9 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-three-part/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-two-part/expected.png b/test/integration/render-tests/icon-text-fit/stretch-two-part/expected.png new file mode 100644 index 00000000000..f218020df93 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-two-part/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-two-part/style.json b/test/integration/render-tests/icon-text-fit/stretch-two-part/style.json new file mode 100644 index 00000000000..5c45313726d --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-two-part/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "ASDF", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "two-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/stretch-underscale/expected.png b/test/integration/render-tests/icon-text-fit/stretch-underscale/expected.png new file mode 100644 index 00000000000..f6e32fca763 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/stretch-underscale/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/stretch-underscale/style.json b/test/integration/render-tests/icon-text-fit/stretch-underscale/style.json new file mode 100644 index 00000000000..a658c727bc6 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/stretch-underscale/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/stretch", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "A", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "three-part", + "icon-text-fit": "both", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/text-variable-anchor-overlap/expected.png b/test/integration/render-tests/icon-text-fit/text-variable-anchor-overlap/expected.png new file mode 100644 index 00000000000..abc7219feb3 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/text-variable-anchor-overlap/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/text-variable-anchor-overlap/style.json b/test/integration/render-tests/icon-text-fit/text-variable-anchor-overlap/style.json new file mode 100644 index 00000000000..73c869feb54 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/text-variable-anchor-overlap/style.json @@ -0,0 +1,61 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "allowed": 0.0005 + } + }, + "center": [ + 13.417, + 52.502 + ], + "zoom": 16, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "road", + "type": "symbol", + "source": "mapbox", + "source-layer": "road_label", + "layout": { + "text-variable-anchor": ["left", "right", "bottom", "top"], + "text-field": "{name}", + "text-allow-overlap": true, + "icon-allow-overlap": true, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "label", + "icon-text-fit": "both", + "icon-text-fit-padding": [ + 5, + 10, + 5, + 10 + ] + }, + "paint": { + "icon-opacity": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/text-variable-anchor-tile-map-mode/expected.png b/test/integration/render-tests/icon-text-fit/text-variable-anchor-tile-map-mode/expected.png new file mode 100644 index 00000000000..1017418a59b Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/text-variable-anchor-tile-map-mode/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/text-variable-anchor-tile-map-mode/style.json b/test/integration/render-tests/icon-text-fit/text-variable-anchor-tile-map-mode/style.json new file mode 100644 index 00000000000..5cb9c085643 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/text-variable-anchor-tile-map-mode/style.json @@ -0,0 +1,60 @@ +{ + "version": 8, + "metadata": { + "test": { + "allowed": 0.0005, + "mapMode": "tile", + "debug": true + } + }, + "center": [ + 13.417, + 52.502 + ], + "zoom": 14, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "road", + "type": "symbol", + "source": "mapbox", + "source-layer": "road_label", + "layout": { + "text-variable-anchor": ["left", "right", "bottom", "top"], + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "label", + "icon-text-fit": "both", + "icon-text-fit-padding": [ + 5, + 10, + 5, + 10 + ] + }, + "paint": { + "icon-opacity": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/text-variable-anchor/expected.png b/test/integration/render-tests/icon-text-fit/text-variable-anchor/expected.png new file mode 100644 index 00000000000..93fe892b0ea Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/text-variable-anchor/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/text-variable-anchor/style.json b/test/integration/render-tests/icon-text-fit/text-variable-anchor/style.json new file mode 100644 index 00000000000..e27f39374e8 --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/text-variable-anchor/style.json @@ -0,0 +1,59 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256, + "allowed": 0.0005 + } + }, + "center": [ + 13.417, + 52.502 + ], + "zoom": 14, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "road", + "type": "symbol", + "source": "mapbox", + "source-layer": "road_label", + "layout": { + "text-variable-anchor": ["left", "right", "bottom", "top"], + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "label", + "icon-text-fit": "both", + "icon-text-fit-padding": [ + 5, + 10, + 5, + 10 + ] + }, + "paint": { + "icon-opacity": 1 + } + } + ] +} diff --git a/test/integration/render-tests/icon-text-fit/width-padding/expected.png b/test/integration/render-tests/icon-text-fit/width-padding/expected.png index 24d57024d2c..0e00bbbcae1 100644 Binary files a/test/integration/render-tests/icon-text-fit/width-padding/expected.png and b/test/integration/render-tests/icon-text-fit/width-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/width-text-anchor-padding/expected.png b/test/integration/render-tests/icon-text-fit/width-text-anchor-padding/expected.png new file mode 100644 index 00000000000..770743fd738 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/width-text-anchor-padding/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/width-text-anchor-padding/style.json b/test/integration/render-tests/icon-text-fit/width-text-anchor-padding/style.json new file mode 100644 index 00000000000..0bfc7214cdb --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/width-text-anchor-padding/style.json @@ -0,0 +1,201 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-text-fit-padding": [ 2, 4, 6, 8 ], + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/width-text-anchor/expected.png b/test/integration/render-tests/icon-text-fit/width-text-anchor/expected.png new file mode 100644 index 00000000000..f5f29a8cd95 Binary files /dev/null and b/test/integration/render-tests/icon-text-fit/width-text-anchor/expected.png differ diff --git a/test/integration/render-tests/icon-text-fit/width-text-anchor/style.json b/test/integration/render-tests/icon-text-fit/width-text-anchor/style.json new file mode 100644 index 00000000000..783b19cdd0d --- /dev/null +++ b/test/integration/render-tests/icon-text-fit/width-text-anchor/style.json @@ -0,0 +1,192 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 200, + "height": 150 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": "local://geojson/anchors.json" + } + }, + "sprite": "local://sprites/icon-text-fit", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "anchor-center", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "center"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "center", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-top-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "top-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "top-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-left", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-left"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-left", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchor-bottom-right", + "type": "symbol", + "source": "geojson", + "filter": ["==", "anchor", "bottom-right"], + "layout": { + "text-field": "Ügt", + "text-size": 20, + "text-anchor": "bottom-right", + "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ], + "text-allow-overlap": true, + "text-ignore-placement": true, + "icon-image": "small-box", + "icon-text-fit": "width", + "icon-allow-overlap": true, + "icon-ignore-placement": true + } + }, + { + "id": "anchors", + "type": "circle", + "source": "geojson", + "paint": { + "circle-radius": 2, + "circle-color": "green", + "circle-stroke-color": "white", + "circle-stroke-width": 1 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/icon-text-fit/width/expected.png b/test/integration/render-tests/icon-text-fit/width/expected.png index cd08e53a6d6..cab1f66b207 100644 Binary files a/test/integration/render-tests/icon-text-fit/width/expected.png and b/test/integration/render-tests/icon-text-fit/width/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/case/butt/expected.png b/test/integration/render-tests/line-dasharray/case/butt/expected.png new file mode 100644 index 00000000000..1b532d4b7be Binary files /dev/null and b/test/integration/render-tests/line-dasharray/case/butt/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/case/butt/style.json b/test/integration/render-tests/line-dasharray/case/butt/style.json new file mode 100644 index 00000000000..add14b42983 --- /dev/null +++ b/test/integration/render-tests/line-dasharray/case/butt/style.json @@ -0,0 +1,70 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 200, + "width": 200 + } + }, + "center": [ + 0.0, + 0.0 + ], + "zoom": 15, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -0.001, + -0.001 + ], + [ + 0.001, + 0.001 + ] + ] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "case", + "type": "line", + "source": "geojson", + "paint": { + "line-color": "blue", + "line-dasharray": [ + 1.666666, + 1.666666 + ], + "line-width": 12 + } + }, + { + "id": "dash", + "type": "line", + "source": "geojson", + "paint": { + "line-color": "red", + "line-dasharray": [ + 2.5, + 2.5 + ], + "line-width": 8 + } + } + ] +} diff --git a/test/integration/render-tests/line-dasharray/case/round/expected.png b/test/integration/render-tests/line-dasharray/case/round/expected.png new file mode 100644 index 00000000000..701bdce7e06 Binary files /dev/null and b/test/integration/render-tests/line-dasharray/case/round/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/case/round/style.json b/test/integration/render-tests/line-dasharray/case/round/style.json new file mode 100644 index 00000000000..448eda173ad --- /dev/null +++ b/test/integration/render-tests/line-dasharray/case/round/style.json @@ -0,0 +1,76 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 200, + "width": 200 + } + }, + "center": [ + 0.0, + 0.0 + ], + "zoom": 15, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -0.001, + -0.001 + ], + [ + 0.001, + 0.001 + ] + ] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "case", + "type": "line", + "source": "geojson", + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "blue", + "line-dasharray": [ + 1.666666, + 1.666666 + ], + "line-width": 12 + } + }, + { + "id": "dash", + "type": "line", + "source": "geojson", + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "red", + "line-dasharray": [ + 2.5, + 2.5 + ], + "line-width": 8 + } + } + ] +} diff --git a/test/integration/render-tests/line-dasharray/case/square/expected.png b/test/integration/render-tests/line-dasharray/case/square/expected.png new file mode 100644 index 00000000000..950a308bc81 Binary files /dev/null and b/test/integration/render-tests/line-dasharray/case/square/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/case/square/style.json b/test/integration/render-tests/line-dasharray/case/square/style.json new file mode 100644 index 00000000000..65024b51f33 --- /dev/null +++ b/test/integration/render-tests/line-dasharray/case/square/style.json @@ -0,0 +1,76 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 200, + "width": 200 + } + }, + "center": [ + 0.0, + 0.0 + ], + "zoom": 15, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -0.001, + -0.001 + ], + [ + 0.001, + 0.001 + ] + ] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "case", + "type": "line", + "source": "geojson", + "layout": { + "line-cap": "square" + }, + "paint": { + "line-color": "blue", + "line-dasharray": [ + 1.666666, + 1.666666 + ], + "line-width": 12 + } + }, + { + "id": "dash", + "type": "line", + "source": "geojson", + "layout": { + "line-cap": "square" + }, + "paint": { + "line-color": "red", + "line-dasharray": [ + 2.5, + 2.5 + ], + "line-width": 8 + } + } + ] +} diff --git a/test/integration/render-tests/line-dasharray/round/segments/expected.png b/test/integration/render-tests/line-dasharray/round/segments/expected.png new file mode 100644 index 00000000000..1f63286776c Binary files /dev/null and b/test/integration/render-tests/line-dasharray/round/segments/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/round/segments/style.json b/test/integration/render-tests/line-dasharray/round/segments/style.json new file mode 100644 index 00000000000..0ef061e46ae --- /dev/null +++ b/test/integration/render-tests/line-dasharray/round/segments/style.json @@ -0,0 +1,85 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 128, + "height": 64 + } + }, + "zoom": 0, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "property": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -18 ], [ 40, -18 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 2 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -10 ], [ 40, -10 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 3 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -2 ], [ 40, -2 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, 7 ], [ 40, 7 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 8 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, 18 ], [ 40, 18 ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "road", + "type": "line", + "source": "geojson", + "layout": { + "line-cap": "round" + }, + "paint": { + "line-width": ["get", "property"], + "line-dasharray": [1, 2, 0, 4] + } + } + ] +} diff --git a/test/integration/render-tests/line-dasharray/round/zero-gap-width/expected.png b/test/integration/render-tests/line-dasharray/round/zero-gap-width/expected.png new file mode 100644 index 00000000000..3c33d025b26 Binary files /dev/null and b/test/integration/render-tests/line-dasharray/round/zero-gap-width/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/round/zero-gap-width/style.json b/test/integration/render-tests/line-dasharray/round/zero-gap-width/style.json new file mode 100644 index 00000000000..1f25935b670 --- /dev/null +++ b/test/integration/render-tests/line-dasharray/round/zero-gap-width/style.json @@ -0,0 +1,85 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 128, + "height": 64 + } + }, + "zoom": 0, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "property": 1 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -18 ], [ 40, -18 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 2 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -10 ], [ 40, -10 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 3 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -2 ], [ 40, -2 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 6 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, 7 ], [ 40, 7 ] ] + } + }, + { + "type": "Feature", + "properties": { + "property": 8 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, 18 ], [ 40, 18 ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "road", + "type": "line", + "source": "geojson", + "layout": { + "line-cap": "round" + }, + "paint": { + "line-width": ["get", "property"], + "line-dasharray": [0, 2] + } + } + ] +} diff --git a/test/integration/render-tests/line-dasharray/zero-length-gap/expected.png b/test/integration/render-tests/line-dasharray/zero-length-gap/expected.png new file mode 100644 index 00000000000..004d3873e7c Binary files /dev/null and b/test/integration/render-tests/line-dasharray/zero-length-gap/expected.png differ diff --git a/test/integration/render-tests/line-dasharray/zero-length-gap/style.json b/test/integration/render-tests/line-dasharray/zero-length-gap/style.json new file mode 100644 index 00000000000..4efa605913f --- /dev/null +++ b/test/integration/render-tests/line-dasharray/zero-length-gap/style.json @@ -0,0 +1,108 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 128, + "height": 132 + } + }, + "zoom": 0, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "width": 2, + "offset": 0 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -18 ], [ 40, -18 ] ] + } + }, + { + "type": "Feature", + "properties": { + "width": 4, + "offset": 0 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -10 ], [ 40, -10 ] ] + } + }, + { + "type": "Feature", + "properties": { + "width": 6, + "offset": 0 + }, + "geometry": { + "type": "LineString", + "coordinates": [ [ -40, -2 ], [ 40, -2 ] ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "road0", + "type": "line", + "source": "geojson", + "paint": { + "line-width": ["get", "width"], + "line-offset": ["+", ["get", "offset"], 32], + "line-dasharray": [1, 0, 1, 1], + "line-color": "red" + } + }, + { + "id": "road1", + "type": "line", + "source": "geojson", + "paint": { + "line-width": ["get", "width"], + "line-offset": ["-", ["get", "offset"], 32], + "line-dasharray": [1, 1, 0], + "line-color": "green" + } + }, + { + "id": "road2", + "type": "line", + "source": "geojson", + "paint": { + "line-width": ["get", "width"], + "line-offset": ["-", ["get", "offset"], 64], + "line-dasharray": [1, 0, 1], + "line-color": "blue" + } + }, + { + "id": "road3", + "type": "line", + "source": "geojson", + "paint": { + "line-width": ["get", "width"], + "line-dasharray": [1, 0], + "line-color": "yellow" + } + }, + { + "id": "road4", + "type": "line", + "source": "geojson", + "paint": { + "line-width": ["get", "width"], + "line-dasharray": [0, 1], + "line-color": "black" + } + } + ] +} diff --git a/test/integration/render-tests/line-gradient/gradient-tile-boundaries/expected.png b/test/integration/render-tests/line-gradient/gradient-tile-boundaries/expected.png new file mode 100644 index 00000000000..e85d8986b31 Binary files /dev/null and b/test/integration/render-tests/line-gradient/gradient-tile-boundaries/expected.png differ diff --git a/test/integration/render-tests/line-gradient/gradient-tile-boundaries/style.json b/test/integration/render-tests/line-gradient/gradient-tile-boundaries/style.json new file mode 100644 index 00000000000..106da0da967 --- /dev/null +++ b/test/integration/render-tests/line-gradient/gradient-tile-boundaries/style.json @@ -0,0 +1,56 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 128 + } + }, + "center": [ + -77.02803308586635, + 38.891047607560125 + ], + "zoom": 18, + "sources": { + "gradient": { + "type": "geojson", + "data": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-77.028035, 38.890600 ], + [-77.028035, 38.891088 ] + ] + } + }, + "lineMetrics": true + } + }, + "layers": [ + { + "id": "line", + "type": "line", + "source": "gradient", + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-width": 15, + "line-gradient": [ + "interpolate", + ["linear"], + ["line-progress"], + 0, "rgba(0, 0, 255, 0)", + 0.1, "royalblue", + 0.3, "cyan", + 0.5, "lime", + 0.7, "yellow", + 1, "red" + ] + } + } + ] +} diff --git a/test/integration/render-tests/line-pattern/3x-on-2x-add-image/expected.png b/test/integration/render-tests/line-pattern/3x-on-2x-add-image/expected.png new file mode 100644 index 00000000000..b3a33bba570 Binary files /dev/null and b/test/integration/render-tests/line-pattern/3x-on-2x-add-image/expected.png differ diff --git a/test/integration/render-tests/line-pattern/3x-on-2x-add-image/style.json b/test/integration/render-tests/line-pattern/3x-on-2x-add-image/style.json new file mode 100644 index 00000000000..425c467c887 --- /dev/null +++ b/test/integration/render-tests/line-pattern/3x-on-2x-add-image/style.json @@ -0,0 +1,66 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32, + "pixelRatio": 2, + "operations": [ + [ + "wait" + ], + [ + "addImage", + "pattern", + "./image/marker.png", + { + "pixelRatio": 3 + } + ], + [ + "wait" + ], + [ + "addSource", + "geojson", + { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [ + -20, + 0 + ], + [ + 20, + 0 + ] + ] + } + } + ], + [ + "wait" + ], + [ + "addLayer", + { + "id": "a", + "type": "line", + "source": "geojson", + "paint": { + "line-width": 8, + "line-pattern": "pattern" + } + } + ], + [ + "wait" + ] + ] + } + }, + "sources": {}, + "layers": [] +} diff --git a/test/integration/render-tests/line-pattern/@2x/expected.png b/test/integration/render-tests/line-pattern/@2x/expected.png index 9aefa026012..278297b6619 100644 Binary files a/test/integration/render-tests/line-pattern/@2x/expected.png and b/test/integration/render-tests/line-pattern/@2x/expected.png differ diff --git a/test/integration/render-tests/line-pattern/literal/expected.png b/test/integration/render-tests/line-pattern/literal/expected.png index c93c29a5cca..1c13f9bac30 100644 Binary files a/test/integration/render-tests/line-pattern/literal/expected.png and b/test/integration/render-tests/line-pattern/literal/expected.png differ diff --git a/test/integration/render-tests/line-pattern/opacity/expected.png b/test/integration/render-tests/line-pattern/opacity/expected.png index b94d13b4c36..f0a12d94eda 100644 Binary files a/test/integration/render-tests/line-pattern/opacity/expected.png and b/test/integration/render-tests/line-pattern/opacity/expected.png differ diff --git a/test/integration/render-tests/line-pattern/overscaled/expected.png b/test/integration/render-tests/line-pattern/overscaled/expected.png index 9397519221a..858bce70b78 100644 Binary files a/test/integration/render-tests/line-pattern/overscaled/expected.png and b/test/integration/render-tests/line-pattern/overscaled/expected.png differ diff --git a/test/integration/render-tests/line-pattern/pitch/expected.png b/test/integration/render-tests/line-pattern/pitch/expected.png index 44174f9118d..b3f8eebeda0 100644 Binary files a/test/integration/render-tests/line-pattern/pitch/expected.png and b/test/integration/render-tests/line-pattern/pitch/expected.png differ diff --git a/test/integration/render-tests/line-pattern/property-function/expected.png b/test/integration/render-tests/line-pattern/property-function/expected.png index 65fc1687d2b..8d7e3876ff8 100644 Binary files a/test/integration/render-tests/line-pattern/property-function/expected.png and b/test/integration/render-tests/line-pattern/property-function/expected.png differ diff --git a/test/integration/render-tests/line-pattern/step-curve/expected.png b/test/integration/render-tests/line-pattern/step-curve/expected.png index 5d384c00ec1..16dad2a367f 100644 Binary files a/test/integration/render-tests/line-pattern/step-curve/expected.png and b/test/integration/render-tests/line-pattern/step-curve/expected.png differ diff --git a/test/integration/render-tests/line-pattern/with-dasharray/expected.png b/test/integration/render-tests/line-pattern/with-dasharray/expected.png new file mode 100644 index 00000000000..1c13f9bac30 Binary files /dev/null and b/test/integration/render-tests/line-pattern/with-dasharray/expected.png differ diff --git a/test/integration/render-tests/line-pattern/with-dasharray/style.json b/test/integration/render-tests/line-pattern/with-dasharray/style.json new file mode 100644 index 00000000000..5e7a6cfbcab --- /dev/null +++ b/test/integration/render-tests/line-pattern/with-dasharray/style.json @@ -0,0 +1,92 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "sources": { + "a": { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [ + -10, + -10 + ], + [ + 10, + -10 + ] + ] + } + }, + "b": { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [ + -10, + 0 + ], + [ + 10, + 0 + ] + ] + } + }, + "c": { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [ + -10, + 10 + ], + [ + 10, + 10 + ] + ] + } + } + }, + "sprite": "local://sprites/emerald", + "layers": [ + { + "id": "a", + "type": "line", + "source": "a", + "paint": { + "line-width": 2, + "line-dasharray": [2, 4], + "line-pattern": "generic_icon" + } + }, + { + "id": "b", + "type": "line", + "source": "b", + "paint": { + "line-width": 4, + "line-dasharray": [2, 4], + "line-pattern": "generic_icon" + } + }, + { + "id": "c", + "type": "line", + "source": "c", + "paint": { + "line-width": 8, + "line-dasharray": [2, 4], + "line-pattern": "generic_icon" + } + } + ] +} diff --git a/test/integration/render-tests/line-pattern/zoom-expression/expected.png b/test/integration/render-tests/line-pattern/zoom-expression/expected.png new file mode 100644 index 00000000000..ff9cc38206b Binary files /dev/null and b/test/integration/render-tests/line-pattern/zoom-expression/expected.png differ diff --git a/test/integration/render-tests/line-pattern/zoom-expression/style.json b/test/integration/render-tests/line-pattern/zoom-expression/style.json new file mode 100644 index 00000000000..bf6e5f3deac --- /dev/null +++ b/test/integration/render-tests/line-pattern/zoom-expression/style.json @@ -0,0 +1,101 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "zoom": 2, + "sprite": "local://sprites/emerald", + "sources": { + "a": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "class": "trunk" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 10, + -10 + ], + [ + -10, + -10 + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "class": "path" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -10, + 0 + ], + [ + 10, + 0 + ] + ] + } + }, + { + "type": "Feature", + "properties": { + "class": "street" + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -10, + 10 + ], + [ + 10, + 10 + ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "road", + "type": "line", + "source": "a", + "paint": { + "line-width": 10, + "line-pattern": [ + "step", ["zoom"], + "generic_icon", + 2, + "generic_metro" + ] + } + } + ] +} diff --git a/test/integration/render-tests/projection/perspective/expected.png b/test/integration/render-tests/projection/perspective/expected.png index 0e7750741a4..9f38cb37ba5 100644 Binary files a/test/integration/render-tests/projection/perspective/expected.png and b/test/integration/render-tests/projection/perspective/expected.png differ diff --git a/test/integration/render-tests/raster-masking/overlapping-vector/expected.png b/test/integration/render-tests/raster-masking/overlapping-vector/expected.png new file mode 100644 index 00000000000..043b1fdab05 Binary files /dev/null and b/test/integration/render-tests/raster-masking/overlapping-vector/expected.png differ diff --git a/test/integration/render-tests/raster-masking/overlapping-vector/style.json b/test/integration/render-tests/raster-masking/overlapping-vector/style.json new file mode 100644 index 00000000000..d5253448cf3 --- /dev/null +++ b/test/integration/render-tests/raster-masking/overlapping-vector/style.json @@ -0,0 +1,90 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 256 + } + }, + "center": [ + -122.48, + 37.84 + ], + "zoom": 14, + "sources": { + "contour": { + "type": "raster", + "tiles": [ + "local://tiles/{z}-{x}-{y}.contour.png" + ], + "maxzoom": 17, + "tileSize": 256 + }, + "geojson": { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [ + [ + [ + -123, + 37.839 + ], + [ + -123, + 37.843 + ], + [ + -122, + 37.843 + ], + [ + -122, + 37.839 + ], + [ + -123, + 37.839 + ] + ] + ] + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "raster", + "type": "raster", + "source": "contour", + "paint": { + "raster-fade-duration": 0 + } + }, + { + "id": "fill", + "type": "fill", + "source": "geojson", + "paint": { + "fill-antialias": false, + "fill-color": "green", + "fill-opacity": 0.2 + } + }, + { + "id": "raster-transparent", + "type": "raster", + "source": "contour", + "paint": { + "raster-fade-duration": 0, + "raster-opacity": 0.5, + "raster-hue-rotate": 90 + } + } + ] +} diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5171/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#5171/expected.png new file mode 100644 index 00000000000..8784429cebc Binary files /dev/null and b/test/integration/render-tests/regressions/mapbox-gl-js#5171/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5171/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#5171/style.json new file mode 100644 index 00000000000..bbcbe066ed0 --- /dev/null +++ b/test/integration/render-tests/regressions/mapbox-gl-js#5171/style.json @@ -0,0 +1,35 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 32 + } + }, + "center": [-0.63938, 44.77458], + "zoom": 18, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "LineString", + "coordinates": [ + [-0.639208, 44.774651], + [-0.639605, 44.774487], + [-0.639605, 44.774487] + ] + } + } + }, + "layers": [ + { + "id": "line", + "type": "line", + "source": "geojson", + "paint": { + "line-color": "#f44336", + "line-width": 10 + } + } + ] +} diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png index 54f96ca198f..eb535e2022f 100644 Binary files a/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png and b/test/integration/render-tests/regressions/mapbox-gl-js#5631/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5911a/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#5911a/expected.png index 7dd35ba9bf5..3aa0e1cd5a8 100644 Binary files a/test/integration/render-tests/regressions/mapbox-gl-js#5911a/expected.png and b/test/integration/render-tests/regressions/mapbox-gl-js#5911a/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5978/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#5978/expected.png index b0c9aab7879..fc7030e7a2c 100644 Binary files a/test/integration/render-tests/regressions/mapbox-gl-js#5978/expected.png and b/test/integration/render-tests/regressions/mapbox-gl-js#5978/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#8273/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#8273/expected.png index 5b2447069be..61de2851470 100644 Binary files a/test/integration/render-tests/regressions/mapbox-gl-js#8273/expected.png and b/test/integration/render-tests/regressions/mapbox-gl-js#8273/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#8817/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#8817/expected.png new file mode 100644 index 00000000000..b36e37b0862 Binary files /dev/null and b/test/integration/render-tests/regressions/mapbox-gl-js#8817/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#8817/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#8817/style.json new file mode 100644 index 00000000000..7799971f603 --- /dev/null +++ b/test/integration/render-tests/regressions/mapbox-gl-js#8817/style.json @@ -0,0 +1,68 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "comment": "The `pauseSource` prevents new tiles from loading and forces the map to use tiles outside of their ideal zoom range.", + "operations": [ + ["pauseSource", "geojson"], + ["setZoom", 2], + ["wait"] + ] + } + }, + "zoom": 0, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [ + [ + [ + -10, + -10 + ], + [ + -10, + 10 + ], + [ + 10, + 10 + ], + [ + 10, + -10 + ], + [ + -10, + -10 + ] + ] + ] + } + } + }, + "layers": [ + { + "id": "fill", + "type": "fill", + "source": "geojson", + "paint": { + "fill-antialias": false, + "fill-color": "green", + "fill-opacity": [ + "interpolate", + ["linear"], + ["zoom"], + 0.5, + 0, + 1, + ["match", ["get", "fakeproptotriggercompositeexpression"], "nope", 1, 1] + ] + } + } + ] +} diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#9009/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#9009/expected.png new file mode 100644 index 00000000000..c6f451504a0 Binary files /dev/null and b/test/integration/render-tests/regressions/mapbox-gl-js#9009/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#9009/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#9009/style.json new file mode 100644 index 00000000000..f6c9625ad2e --- /dev/null +++ b/test/integration/render-tests/regressions/mapbox-gl-js#9009/style.json @@ -0,0 +1,45 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 100, + "width": 100 + } + }, + "center": [ + 0, + 0 + ], + "zoom": 18, + "sources": { + "line": { + "type": "geojson", + "maxzoom": 10, + "data": { + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [[-180, 70], [0, 0], [100, 80]] + } + } + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "road", + "type": "line", + "source": "line", + "paint": { + "line-width": 20, + "line-color": "#000" + } + } + ] +} diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#9518/expected.png b/test/integration/render-tests/regressions/mapbox-gl-js#9518/expected.png new file mode 100644 index 00000000000..1ed60094c40 Binary files /dev/null and b/test/integration/render-tests/regressions/mapbox-gl-js#9518/expected.png differ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#9518/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#9518/style.json new file mode 100644 index 00000000000..a7d66de5770 --- /dev/null +++ b/test/integration/render-tests/regressions/mapbox-gl-js#9518/style.json @@ -0,0 +1,27 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 8, + "height": 8 + } + }, + "zoom": 3, + "sources": {}, + "sprite": "local://sprites/emerald", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-pattern": [ + "step", + ["zoom"], + "", + 5, + "cemetery_icon" + ] + } + } + ] +} diff --git a/test/integration/render-tests/regressions/mapbox-gl-native#9976/expected.png b/test/integration/render-tests/regressions/mapbox-gl-native#9976/expected.png index 19244c5fc39..ddcc259d5d4 100644 Binary files a/test/integration/render-tests/regressions/mapbox-gl-native#9976/expected.png and b/test/integration/render-tests/regressions/mapbox-gl-native#9976/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/image-add-remove-add/expected.png b/test/integration/render-tests/runtime-styling/image-add-remove-add/expected.png new file mode 100644 index 00000000000..94d4b5440aa Binary files /dev/null and b/test/integration/render-tests/runtime-styling/image-add-remove-add/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/image-add-remove-add/style.json b/test/integration/render-tests/runtime-styling/image-add-remove-add/style.json new file mode 100644 index 00000000000..e9c0403b608 --- /dev/null +++ b/test/integration/render-tests/runtime-styling/image-add-remove-add/style.json @@ -0,0 +1,52 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "operations": [ + [ + "addImage", + "marker", + "./sprites/1x.png" + ], + [ + "addLayer", + { + "id": "geometry", + "type": "symbol", + "source": "geometry", + "layout": { + "icon-image": "marker" + } + } + ], + [ + "wait" + ], + [ + "removeImage", + "marker" + ], + [ + "addImage", + "marker", + "./sprites/dark.png" + ], + [ + "wait" + ] + ] + } + }, + "sources": { + "geometry": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [0, 0] + } + } + }, + "layers": [] +} diff --git a/test/integration/render-tests/runtime-styling/pattern-add-remove-add/expected.png b/test/integration/render-tests/runtime-styling/pattern-add-remove-add/expected.png new file mode 100644 index 00000000000..8325b5ef81a Binary files /dev/null and b/test/integration/render-tests/runtime-styling/pattern-add-remove-add/expected.png differ diff --git a/test/integration/render-tests/runtime-styling/pattern-add-remove-add/style.json b/test/integration/render-tests/runtime-styling/pattern-add-remove-add/style.json new file mode 100644 index 00000000000..35610cc1bd4 --- /dev/null +++ b/test/integration/render-tests/runtime-styling/pattern-add-remove-add/style.json @@ -0,0 +1,52 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "operations": [ + [ + "addImage", + "marker", + "./sprites/dark.png" + ], + [ + "addLayer", + { + "id": "geometry", + "type": "fill", + "source": "geometry", + "paint": { + "fill-pattern": "marker" + } + } + ], + [ + "wait" + ], + [ + "removeImage", + "marker" + ], + [ + "addImage", + "marker", + "./sprites/1x.png" + ], + [ + "wait" + ] + ] + } + }, + "sources": { + "geometry": { + "type": "geojson", + "data": { + "type": "Polygon", + "coordinates": [[[-180, 80], [180, 80], [180, -80], [-180, -80]]] + } + } + }, + "layers": [] +} diff --git a/test/integration/render-tests/symbol-placement/line-center-buffer-tile-map-mode/expected.png b/test/integration/render-tests/symbol-placement/line-center-buffer-tile-map-mode/expected.png new file mode 100644 index 00000000000..06156ec40e1 Binary files /dev/null and b/test/integration/render-tests/symbol-placement/line-center-buffer-tile-map-mode/expected.png differ diff --git a/test/integration/render-tests/symbol-placement/line-center-buffer-tile-map-mode/style.json b/test/integration/render-tests/symbol-placement/line-center-buffer-tile-map-mode/style.json new file mode 100644 index 00000000000..bc64ab3b6f1 --- /dev/null +++ b/test/integration/render-tests/symbol-placement/line-center-buffer-tile-map-mode/style.json @@ -0,0 +1,60 @@ +{ + "version": 8, + "metadata": { + "test": { + "debug": true, + "mapMode": "tile" + } + }, + "center": [ + -73, + 15 + ], + "zoom": 4, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/mapbox.mapbox-streets-v7/{z}-{x}-{y}.mvt" + ] + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line-center", + "type": "symbol", + "source": "mapbox", + "source-layer": "marine_label", + "layout": { + "text-field": "{name_en}", + "symbol-placement": "line-center", + "text-allow-overlap": true, + "text-size": 35, + "text-letter-spacing": 0.4, + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-max-width": 0 + } + }, + { + "id": "line", + "type": "line", + "source": "mapbox", + "source-layer": "marine_label", + "paint": { + "line-width": 1 + } + } + ] +} diff --git a/test/integration/render-tests/symbol-placement/line-center-buffer/style.json b/test/integration/render-tests/symbol-placement/line-center-buffer/style.json index d873e86d1f4..4f517d88b86 100644 --- a/test/integration/render-tests/symbol-placement/line-center-buffer/style.json +++ b/test/integration/render-tests/symbol-placement/line-center-buffer/style.json @@ -45,7 +45,8 @@ "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" - ] + ], + "text-max-width": 0 } }, { diff --git a/test/integration/render-tests/symbol-placement/line-center-tile-map-mode/expected.png b/test/integration/render-tests/symbol-placement/line-center-tile-map-mode/expected.png new file mode 100644 index 00000000000..0ef674e2a20 Binary files /dev/null and b/test/integration/render-tests/symbol-placement/line-center-tile-map-mode/expected.png differ diff --git a/test/integration/render-tests/symbol-placement/line-center-tile-map-mode/style.json b/test/integration/render-tests/symbol-placement/line-center-tile-map-mode/style.json new file mode 100644 index 00000000000..ec89964d3dc --- /dev/null +++ b/test/integration/render-tests/symbol-placement/line-center-tile-map-mode/style.json @@ -0,0 +1,71 @@ +{ + "version": 8, + "metadata": { + "test": { + "collisionDebug": true, + "debug": true, + "mapMode": "tile" + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 15, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "line-center", + "type": "symbol", + "source": "mapbox", + "source-layer": "road_label", + "layout": { + "text-field": ".", + "symbol-placement": "line-center", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "road", + "type": "line", + "source": "mapbox", + "source-layer": "road_label", + "paint": { + "line-width": 1, + "line-color": ["match", + ["%", ["to-number", ["id"]], 10], + 0, ["to-color", "red"], + 1, ["to-color", "blue"], + 2, ["to-color", "yellow"], + 3, ["to-color", "black"], + 4, ["to-color", "grey"], + 5, ["to-color", "purple"], + 6, ["to-color", "green"], + 7, ["to-color", "orange"], + 8, ["to-color", "brown"], + 9, ["to-color", "lime"], + ["to-color", "magenta"] + ] + } + } + ] +} diff --git a/test/integration/render-tests/symbol-placement/line-center/expected.png b/test/integration/render-tests/symbol-placement/line-center/expected.png index 07af2a7cbad..ea7fabda29e 100644 Binary files a/test/integration/render-tests/symbol-placement/line-center/expected.png and b/test/integration/render-tests/symbol-placement/line-center/expected.png differ diff --git a/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-left-then-right/expected.png b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-left-then-right/expected.png new file mode 100644 index 00000000000..a452d65d9d1 Binary files /dev/null and b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-left-then-right/expected.png differ diff --git a/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-left-then-right/style.json b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-left-then-right/style.json new file mode 100644 index 00000000000..b87ab32bc9a --- /dev/null +++ b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-left-then-right/style.json @@ -0,0 +1,75 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 64, + "width": 64 + } + }, + "center": [0, 30], + "zoom": 1, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "sort-key": 0, + "image": "bank-12" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -1, + 34 + ] + } + }, + { + "type": "Feature", + "properties": { + "sort-key": 2, + "image": "bank-12" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -1, + 30 + ] + } + }, + { + "type": "Feature", + "properties": { + "sort-key": 1, + "image": "fav-campsite-18" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1, + 32 + ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "icon", + "type": "symbol", + "source": "geojson", + "layout": { + "symbol-sort-key": ["get", "sort-key"], + "icon-image": ["get", "image"] + } + } + ] +} diff --git a/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-right-then-left/expected.png b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-right-then-left/expected.png new file mode 100644 index 00000000000..d1e4899a146 Binary files /dev/null and b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-right-then-left/expected.png differ diff --git a/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-right-then-left/style.json b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-right-then-left/style.json new file mode 100644 index 00000000000..d739f41a9e5 --- /dev/null +++ b/test/integration/render-tests/symbol-sort-key/placement-tile-boundary-right-then-left/style.json @@ -0,0 +1,75 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 64, + "width": 64 + } + }, + "center": [0, 30], + "zoom": 1, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "sort-key": 0, + "image": "bank-12" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1, + 34 + ] + } + }, + { + "type": "Feature", + "properties": { + "sort-key": 2, + "image": "bank-12" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1, + 30 + ] + } + }, + { + "type": "Feature", + "properties": { + "sort-key": 1, + "image": "fav-campsite-18" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -1, + 32 + ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "icon", + "type": "symbol", + "source": "geojson", + "layout": { + "symbol-sort-key": ["get", "sort-key"], + "icon-image": ["get", "image"] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-arabic/expected.png b/test/integration/render-tests/text-field/formatted-arabic/expected.png index fa904bda075..cbb7afa2252 100644 Binary files a/test/integration/render-tests/text-field/formatted-arabic/expected.png and b/test/integration/render-tests/text-field/formatted-arabic/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-constant-size/expected.png b/test/integration/render-tests/text-field/formatted-images-constant-size/expected.png new file mode 100644 index 00000000000..cc27f0bcdce Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images-constant-size/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-constant-size/style.json b/test/integration/render-tests/text-field/formatted-images-constant-size/style.json new file mode 100644 index 00000000000..64be0e32c3d --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images-constant-size/style.json @@ -0,0 +1,59 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 20 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald@2x", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-offset": [0.1, 0], + "text-field": ["format", "Square ", ["image", "default_1"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "images", + "type": "symbol", + "source": "point", + "layout": { + "text-offset": [0, 1.2], + "text-size": 30, + "text-field": ["format", "Square ", ["image", "default_1"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-images-line/expected.png b/test/integration/render-tests/text-field/formatted-images-line/expected.png new file mode 100644 index 00000000000..5fefdc0490e Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images-line/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-line/style.json b/test/integration/render-tests/text-field/formatted-images-line/style.json new file mode 100644 index 00000000000..2b5ad09a887 --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images-line/style.json @@ -0,0 +1,82 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 160, + "width": 100 + } + }, + "center": [ -0.0055, 0.0065 ], + "zoom": 14, + "bearing": 60, + "sources": { + "line": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "geometry": { + "coordinates": [ + [ + -0.008778156849501784, + 0.004124676107977621 + ], + [ + -0.00581685092268458, + 0.007085982020228698 + ], + [ + -0.0037016324048408933, + 0.0072975038696938554 + ], + [ + -0.0007403264791605579, + 0.006239894618133235 + ], + [ + 0.0009518483364558961, + 0.004336197959602828 + ] + ], + "type": "LineString" + }, + "type": "Feature", + "properties": {} + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald", + "layers": [ + { + "id": "line", + "type": "symbol", + "source": "line", + "layout": { + "symbol-placement": "line", + "symbol-spacing": 100, + "text-field": ["format", "London", + ["image", "london-overground"], + ["image", "london-underground"], + ["image", "national-rail"], + ["image", "dlr"] + ], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "outline", + "type": "line", + "source": "line", + "paint": { + "line-opacity": 0.2 + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-images-multiline/expected.png b/test/integration/render-tests/text-field/formatted-images-multiline/expected.png new file mode 100644 index 00000000000..1d2c7701d60 Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images-multiline/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-multiline/style.json b/test/integration/render-tests/text-field/formatted-images-multiline/style.json new file mode 100644 index 00000000000..7f71170e9b0 --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images-multiline/style.json @@ -0,0 +1,75 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "multiline": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 30 ] + } + } + ] + } + }, + "multiline_with_scale": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -18 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald", + "layers": [ + { + "id": "multiline", + "type": "symbol", + "source": "multiline", + "layout": { + "text-max-width": 4, + "text-field": ["format", "London", ["image", "london-underground.national-rail"], + "Berlin", ["image", "s-bahn.u-bahn"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "multiline_with_scale", + "type": "symbol", + "source": "multiline_with_scale", + "layout": { + "text-max-width": 8, + "text-field": ["format", "Paris", ["image", "rer.transilien"], + "USA", ["image", "interstate_1"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-images-variable-anchors-justification/expected.png b/test/integration/render-tests/text-field/formatted-images-variable-anchors-justification/expected.png new file mode 100644 index 00000000000..18696d91b95 Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images-variable-anchors-justification/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-variable-anchors-justification/style.json b/test/integration/render-tests/text-field/formatted-images-variable-anchors-justification/style.json new file mode 100644 index 00000000000..9db78cb894c --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images-variable-anchors-justification/style.json @@ -0,0 +1,103 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 160, + "width": 200 + } + }, + "center": [ 0.1, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald@2x", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-justify": "auto", + "text-radial-offset": 2.55, + "text-variable-anchor": ["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"], + "text-field": ["format", "Square", "\n", ["image", "default_1"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-images-vertical/expected.png b/test/integration/render-tests/text-field/formatted-images-vertical/expected.png new file mode 100644 index 00000000000..db1901df9e2 Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images-vertical/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-vertical/style.json b/test/integration/render-tests/text-field/formatted-images-vertical/style.json new file mode 100644 index 00000000000..7b8e34555a9 --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images-vertical/style.json @@ -0,0 +1,46 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 168, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "vertical": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald", + "layers": [ + { + "id": "vertical", + "type": "symbol", + "source": "vertical", + "layout": { + "text-writing-mode": ["vertical"], + "text-field": ["format", "London", ["image", "london-overground.london-underground.national-rail"], + "IH", ["image", "interstate_1"], ["image", "government_icon"], "ッ",{"font-scale": 1.8}], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-images-zoom-dependent-size/expected.png b/test/integration/render-tests/text-field/formatted-images-zoom-dependent-size/expected.png new file mode 100644 index 00000000000..69caad5f216 Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images-zoom-dependent-size/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images-zoom-dependent-size/style.json b/test/integration/render-tests/text-field/formatted-images-zoom-dependent-size/style.json new file mode 100644 index 00000000000..343c4e05fa9 --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images-zoom-dependent-size/style.json @@ -0,0 +1,69 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128, + "allowed": 0.014 + } + }, + "center": [ 0, 0 ], + "zoom": 12, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald@2x", + "layers": [ + { + "id": "text_zoom_constant", + "type": "symbol", + "source": "point", + "layout": { + "text-offset": [0, -1], + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 11, + 8, + 13, + 34 + ], + "text-field": ["format", "Zoom", ["image", "rer"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "text_zoom_dependent", + "type": "symbol", + "source": "point", + "layout": { + "text-offset": [0, 1], + "text-size": 21, + "text-field": ["format", "Zoom", ["image", "rer"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-images/expected.png b/test/integration/render-tests/text-field/formatted-images/expected.png new file mode 100644 index 00000000000..dd6707b6877 Binary files /dev/null and b/test/integration/render-tests/text-field/formatted-images/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-images/style.json b/test/integration/render-tests/text-field/formatted-images/style.json new file mode 100644 index 00000000000..bcae63e6548 --- /dev/null +++ b/test/integration/render-tests/text-field/formatted-images/style.json @@ -0,0 +1,64 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 20 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald@2x", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "icon-image": ["image", "london-overground"], + "icon-offset": [0, -20], + "text-field": ["format", "London", ["image", "london-underground"]], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "images", + "type": "symbol", + "source": "point", + "layout": { + "text-offset": [0, 2], + "text-size": 20, + "text-field": ["format", ["image", "london-overground"], + ["image", "london-underground"], + ["image", "dlr"], + ["image", "u-bahn"] + ], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/expected.png b/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/expected.png index 25fe68213ca..43a2bb54add 100644 Binary files a/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/expected.png and b/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/style.json b/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/style.json index abec25c59c6..7825f9b797e 100644 --- a/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/style.json +++ b/test/integration/render-tests/text-field/formatted-text-color-overrides-nested-expression/style.json @@ -41,6 +41,7 @@ "one", ["format", "Green", { "text-color": "green" }, "\n", {}, "Turquoise", {}], "default" ], + "text-offset": [0, -1.4], "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" @@ -50,6 +51,32 @@ "paint": { "text-color": "turquoise" } + }, + { + "id": "text-case", + "type": "symbol", + "source": "point", + "layout": { + "text-size": 12, + "text-offset": [0, 1.4], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-field": [ + "case", ["!=", ["get", "case"], "one"], + [ + "case", ["==", ["get", "case"], "one"], + "", + ["format", "Should", { "text-color": "red" }, "Not", {}, "See", {}] + ], + [ + "case", ["==", ["get", "case"], "two"], + "", + ["format", "Red", { "text-color": "red" }, "\n", {}, "Black", {}] + ] + ] + } } ] } diff --git a/test/integration/render-tests/text-field/formatted-text-color/expected.png b/test/integration/render-tests/text-field/formatted-text-color/expected.png index 41c8bde1166..03a96d89cde 100644 Binary files a/test/integration/render-tests/text-field/formatted-text-color/expected.png and b/test/integration/render-tests/text-field/formatted-text-color/expected.png differ diff --git a/test/integration/render-tests/text-field/formatted/expected.png b/test/integration/render-tests/text-field/formatted/expected.png index 08f856cb509..c120b5a0662 100644 Binary files a/test/integration/render-tests/text-field/formatted/expected.png and b/test/integration/render-tests/text-field/formatted/expected.png differ diff --git a/test/integration/render-tests/text-keep-upright/line-placement-true-pitched/expected.png b/test/integration/render-tests/text-keep-upright/line-placement-true-pitched/expected.png index 3b9d23158e9..981724f542c 100644 Binary files a/test/integration/render-tests/text-keep-upright/line-placement-true-pitched/expected.png and b/test/integration/render-tests/text-keep-upright/line-placement-true-pitched/expected.png differ diff --git a/test/integration/render-tests/text-max-width/unlimited/expected.png b/test/integration/render-tests/text-max-width/unlimited/expected.png deleted file mode 100644 index 8b525273c51..00000000000 Binary files a/test/integration/render-tests/text-max-width/unlimited/expected.png and /dev/null differ diff --git a/test/integration/render-tests/text-max-width/zero-width-point-placement/expected.png b/test/integration/render-tests/text-max-width/zero-width-point-placement/expected.png new file mode 100644 index 00000000000..953f78a2dbc Binary files /dev/null and b/test/integration/render-tests/text-max-width/zero-width-point-placement/expected.png differ diff --git a/test/integration/render-tests/text-max-width/unlimited/style.json b/test/integration/render-tests/text-max-width/zero-width-point-placement/style.json similarity index 100% rename from test/integration/render-tests/text-max-width/unlimited/style.json rename to test/integration/render-tests/text-max-width/zero-width-point-placement/style.json diff --git a/test/integration/render-tests/text-pitch-alignment/auto-text-rotation-alignment-map/expected.png b/test/integration/render-tests/text-pitch-alignment/auto-text-rotation-alignment-map/expected.png index 124e31a9bcc..79deb753886 100644 Binary files a/test/integration/render-tests/text-pitch-alignment/auto-text-rotation-alignment-map/expected.png and b/test/integration/render-tests/text-pitch-alignment/auto-text-rotation-alignment-map/expected.png differ diff --git a/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map/expected.png b/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map/expected.png index 124e31a9bcc..79deb753886 100644 Binary files a/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map/expected.png and b/test/integration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map/expected.png differ diff --git a/test/integration/render-tests/text-pitch-alignment/viewport-overzoomed/expected.png b/test/integration/render-tests/text-pitch-alignment/viewport-overzoomed/expected.png index f2b0fe8404e..584ad04f0bc 100644 Binary files a/test/integration/render-tests/text-pitch-alignment/viewport-overzoomed/expected.png and b/test/integration/render-tests/text-pitch-alignment/viewport-overzoomed/expected.png differ diff --git a/test/integration/render-tests/text-pitch-scaling/line-half/expected.png b/test/integration/render-tests/text-pitch-scaling/line-half/expected.png index 9e703607656..bdaf1617a64 100644 Binary files a/test/integration/render-tests/text-pitch-scaling/line-half/expected.png and b/test/integration/render-tests/text-pitch-scaling/line-half/expected.png differ diff --git a/test/integration/render-tests/text-size/nan/expected.png b/test/integration/render-tests/text-size/nan/expected.png new file mode 100644 index 00000000000..d27ef2f5c97 Binary files /dev/null and b/test/integration/render-tests/text-size/nan/expected.png differ diff --git a/test/integration/render-tests/text-size/nan/style.json b/test/integration/render-tests/text-size/nan/style.json new file mode 100644 index 00000000000..ca4ffb6c311 --- /dev/null +++ b/test/integration/render-tests/text-size/nan/style.json @@ -0,0 +1,37 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-size": ["sqrt", -1], + "text-field": "ABC", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-size/zero/expected.png b/test/integration/render-tests/text-size/zero/expected.png new file mode 100644 index 00000000000..e1aea4e90d6 Binary files /dev/null and b/test/integration/render-tests/text-size/zero/expected.png differ diff --git a/test/integration/render-tests/text-size/zero/style.json b/test/integration/render-tests/text-size/zero/style.json new file mode 100644 index 00000000000..125e3465045 --- /dev/null +++ b/test/integration/render-tests/text-size/zero/style.json @@ -0,0 +1,43 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64, + "description": "Tests that zero text-size values are properly handled.", + "operations": [ + ["wait"], + ["setZoom", 18] + ] + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "zoom": 17, + "layers": [ + { + "id": "symbol", + "type": "symbol", + "source": "geojson", + "layout": { + "text-size": ["interpolate",["linear"],["zoom"],17.0,0.0,18.0,10.0,22.0,12.5], + "text-field": "ABC", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png index 9ea2fb269d1..3d000a12eb0 100644 Binary files a/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png and b/test/integration/render-tests/text-variable-anchor/all-anchors-icon-text-fit/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode/expected.png new file mode 100644 index 00000000000..22bb9c87953 Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode/style.json new file mode 100644 index 00000000000..7fb8b4faf3b --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-labels-priority-tile-map-mode/style.json @@ -0,0 +1,99 @@ +{ + "version": 8, + "metadata": { + "test": { + "debug": true, + "collisionDebug": true, + "mapMode": "tile" + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 14, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "low-priority", + "type": "symbol", + "source": "mapbox", + "source-layer": "poi_label", + "filter": [ + "==", + "maki", + "restaurant" + ], + "layout": { + "text-field": "Low", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-max-width": 5, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ] + }, + "paint": { + "text-color": "red" + } + }, + { + "id": "high-priority", + "type": "symbol", + "source": "mapbox", + "source-layer": "poi_label", + "filter": [ + "==", + "maki", + "restaurant" + ], + "layout": { + "text-field": "High", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-max-width": 5, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ] + } + }] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-offset-zero/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-offset-zero/expected.png new file mode 100644 index 00000000000..bed8c64a7aa Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-offset-zero/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-offset-zero/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-offset-zero/style.json new file mode 100644 index 00000000000..73fd84ade25 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-offset-zero/style.json @@ -0,0 +1,122 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": "x", + "text-size": 20, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "text-radial-offset": 0, + "text-offset": [2, 2], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "anchor", + "type": "circle", + "source": "point", + "paint" :{ + "circle-radius": 2 + } + } + ] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-offset/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-offset/expected.png index a820ca32692..784d063b996 100644 Binary files a/test/integration/render-tests/text-variable-anchor/all-anchors-offset/expected.png and b/test/integration/render-tests/text-variable-anchor/all-anchors-offset/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-offset/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-offset/style.json index 254adef41cf..95d193fe95b 100644 --- a/test/integration/render-tests/text-variable-anchor/all-anchors-offset/style.json +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-offset/style.json @@ -2,8 +2,8 @@ "version": 8, "metadata": { "test": { - "height": 256, - "width": 256 + "height": 128, + "width": 128 } }, "center": [ 0, 0 ], diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-radial-offset-zero/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-radial-offset-zero/expected.png new file mode 100644 index 00000000000..31a3a20875c Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-radial-offset-zero/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-radial-offset-zero/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-radial-offset-zero/style.json new file mode 100644 index 00000000000..4817d45a2c4 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-radial-offset-zero/style.json @@ -0,0 +1,121 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": "x", + "text-size": 20, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "text-offset": [2, 1.5], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "anchor", + "type": "circle", + "source": "point", + "paint" :{ + "circle-radius": 2 + } + } + ] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-tile-map-mode/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-tile-map-mode/expected.png new file mode 100644 index 00000000000..ef5e7864e78 Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-tile-map-mode/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-tile-map-mode/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-tile-map-mode/style.json new file mode 100644 index 00000000000..6acc08a573c --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-tile-map-mode/style.json @@ -0,0 +1,65 @@ +{ + "version": 8, + "metadata": { + "test": { + "debug": true, + "mapMode": "tile", + "height": 256 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 14, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "top", + "type": "symbol", + "source": "mapbox", + "source-layer": "poi_label", + "filter": [ + "==", + "maki", + "restaurant" + ], + "layout": { + "text-field": "Test Test Test", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-max-width": 5, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ] + } + }] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-negative/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-negative/expected.png new file mode 100644 index 00000000000..8b9cb4b8894 Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-negative/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-negative/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-negative/style.json new file mode 100644 index 00000000000..5d8de72a017 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-negative/style.json @@ -0,0 +1,121 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": "x", + "text-size": 20, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "text-offset": [2, -1], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "anchor", + "type": "circle", + "source": "point", + "paint" :{ + "circle-radius": 2 + } + } + ] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-zero/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-zero/expected.png new file mode 100644 index 00000000000..9e71ac16b38 Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-zero/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-zero/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-zero/style.json new file mode 100644 index 00000000000..e9e2988e1e1 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset-zero/style.json @@ -0,0 +1,121 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": "x", + "text-size": 20, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "text-offset": [2, 0], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "anchor", + "type": "circle", + "source": "point", + "paint" :{ + "circle-radius": 2 + } + } + ] +} diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset/expected.png b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset/expected.png new file mode 100644 index 00000000000..31a3a20875c Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset/style.json b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset/style.json new file mode 100644 index 00000000000..4817d45a2c4 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/all-anchors-two-dimentional-offset/style.json @@ -0,0 +1,121 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 0 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": "x", + "text-size": 20, + "text-justify": "auto", + "text-variable-anchor": [ + "center", + "top", + "bottom", + "left", + "right", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "text-offset": [2, 1.5], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + }, + { + "id": "anchor", + "type": "circle", + "source": "point", + "paint" :{ + "circle-radius": 2 + } + } + ] +} diff --git a/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png index 8e76c3e2536..deb6c2b27ba 100644 Binary files a/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png and b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json index 08b27c445ce..7b9b16d09c8 100644 --- a/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json +++ b/test/integration/render-tests/text-variable-anchor/icon-text-fit-collision-box/style.json @@ -4,6 +4,7 @@ "test": { "height": 128, "width": 128, + "allowed": 0.0075, "collisionDebug": true } }, diff --git a/test/integration/render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode/expected.png b/test/integration/render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode/expected.png new file mode 100644 index 00000000000..2dad19da2ab Binary files /dev/null and b/test/integration/render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode/style.json b/test/integration/render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode/style.json new file mode 100644 index 00000000000..f6f75e66053 --- /dev/null +++ b/test/integration/render-tests/text-variable-anchor/left-top-right-bottom-offset-tile-map-mode/style.json @@ -0,0 +1,61 @@ +{ + "version": 8, + "metadata": { + "test": { + "debug": true, + "mapMode": "tile", + "allowed": 0.0005 + } + }, + "center": [ + 13.418056, + 52.499167 + ], + "zoom": 14, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "sprite": "local://sprites/sprite", + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "top", + "type": "symbol", + "source": "mapbox", + "source-layer": "poi_label", + "filter": [ + "==", + "maki", + "restaurant" + ], + "layout": { + "text-field": "{name}", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "icon-image": "bank-12", + "text-justify": "auto", + "text-radial-offset": 0.7, + "text-variable-anchor": [ + "left", + "top", + "right", + "bottom" + ] + } + }] +} diff --git a/test/integration/render-tests/text-variable-anchor/text-allow-overlap/expected.png b/test/integration/render-tests/text-variable-anchor/text-allow-overlap/expected.png index 2df9b51e027..418206d25ac 100644 Binary files a/test/integration/render-tests/text-variable-anchor/text-allow-overlap/expected.png and b/test/integration/render-tests/text-variable-anchor/text-allow-overlap/expected.png differ diff --git a/test/integration/render-tests/text-variable-anchor/text-allow-overlap/style.json b/test/integration/render-tests/text-variable-anchor/text-allow-overlap/style.json index 3fe9e73524a..ac5402a1d56 100644 --- a/test/integration/render-tests/text-variable-anchor/text-allow-overlap/style.json +++ b/test/integration/render-tests/text-variable-anchor/text-allow-overlap/style.json @@ -2,8 +2,8 @@ "version": 8, "metadata": { "test": { - "height": 256, - "width": 256 + "height": 128, + "width": 128 } }, "center": [ 0, 0 ], diff --git a/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png b/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png index 46897a3970a..3e3ce112ba2 100644 Binary files a/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png and b/test/integration/render-tests/text-writing-mode/point_label/cjk-variable-anchors-vertical-horizontal-mode-icon-text-fit/expected.png differ diff --git a/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png index e043607d2aa..374bd2ad0a8 100644 Binary files a/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png and b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/expected.png differ diff --git a/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json index 6721685d90e..b1ac643172f 100644 --- a/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json +++ b/test/integration/render-tests/text-writing-mode/point_label/mixed-multiline-vertical-horizontal-mode-icon-text-fit/style.json @@ -3,7 +3,8 @@ "metadata": { "test": { "height": 128, - "width": 128 + "width": 128, + "allowed": 0.0005 } }, "center": [ 0, 0 ], diff --git a/test/integration/render-tests/tile-mode/streets-v11/expected.png b/test/integration/render-tests/tile-mode/streets-v11/expected.png new file mode 100644 index 00000000000..7e377ab7324 Binary files /dev/null and b/test/integration/render-tests/tile-mode/streets-v11/expected.png differ diff --git a/test/integration/render-tests/tile-mode/streets-v11/style.json b/test/integration/render-tests/tile-mode/streets-v11/style.json new file mode 100644 index 00000000000..5eadb4b040f --- /dev/null +++ b/test/integration/render-tests/tile-mode/streets-v11/style.json @@ -0,0 +1,16 @@ +{ + "version": 8, + "metadata": { + "test": { + "mapMode":"tile", + "debug": "true", + "allowed": 0.0005, + "operations": [ + [ "setStyle", "mapbox://styles/mapbox/streets-v11"] + ], + "pixelRatio": 2 + } + }, + "center": [-73.9959, 40.7106], + "zoom": 13 +} diff --git a/test/integration/render-tests/within/filter-with-inlined-geojson/expected.png b/test/integration/render-tests/within/filter-with-inlined-geojson/expected.png new file mode 100644 index 00000000000..7f3f172cee2 Binary files /dev/null and b/test/integration/render-tests/within/filter-with-inlined-geojson/expected.png differ diff --git a/test/integration/render-tests/within/filter-with-inlined-geojson/style.json b/test/integration/render-tests/within/filter-with-inlined-geojson/style.json new file mode 100644 index 00000000000..be4e8fefdd5 --- /dev/null +++ b/test/integration/render-tests/within/filter-with-inlined-geojson/style.json @@ -0,0 +1,100 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 3, + "center": [2.5, 2.5], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.9775390625, + 2.3284603685731593 + ] + } + }, + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.7138671875, + -1.7136116598836224 + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [[0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0]] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "border", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "circle", + "type": "circle", + "source": "points", + "filter": ["within", { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + ], + "paint": { + "circle-radius": 5, + "circle-color": "red" + } + } + ] +} diff --git a/test/integration/render-tests/within/layout-text/expected.png b/test/integration/render-tests/within/layout-text/expected.png new file mode 100644 index 00000000000..ea25b5a0a40 Binary files /dev/null and b/test/integration/render-tests/within/layout-text/expected.png differ diff --git a/test/integration/render-tests/within/layout-text/style.json b/test/integration/render-tests/within/layout-text/style.json new file mode 100644 index 00000000000..f1d5655ca17 --- /dev/null +++ b/test/integration/render-tests/within/layout-text/style.json @@ -0,0 +1,111 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 2, + "center": [3.05, 3.25], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.9775390625, + 2.3284603685731593 + ] + } + }, + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 2.021484375, + 7.798078531355303 + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "border", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "symbol", + "type": "symbol", + "source": "points", + "layout": { + "icon-image": "", + "text-field": ["case", ["within", { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + }], "In", "Out"], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-size": 10 + }, + "paint" : { + "text-color": "red" + } + + } + ] + } + \ No newline at end of file diff --git a/test/integration/render-tests/within/paint-circle/expected.png b/test/integration/render-tests/within/paint-circle/expected.png new file mode 100644 index 00000000000..8906ad136fb Binary files /dev/null and b/test/integration/render-tests/within/paint-circle/expected.png differ diff --git a/test/integration/render-tests/within/paint-circle/style.json b/test/integration/render-tests/within/paint-circle/style.json new file mode 100644 index 00000000000..c7f27d00766 --- /dev/null +++ b/test/integration/render-tests/within/paint-circle/style.json @@ -0,0 +1,101 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 2, + "center": [3.25, 3.25], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.9775390625, + 2.3284603685731593 + ] + } + }, + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 2.021484375, + 7.798078531355303 + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "boarder", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "circle", + "type": "circle", + "source": "points", + "paint": { + "circle-radius": 5, + "circle-color": ["case", ["within", { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + ], "red", "blue"] + } + } + ] +} diff --git a/test/integration/render-tests/within/paint-icon/expected.png b/test/integration/render-tests/within/paint-icon/expected.png new file mode 100644 index 00000000000..c3a5dec3610 Binary files /dev/null and b/test/integration/render-tests/within/paint-icon/expected.png differ diff --git a/test/integration/render-tests/within/paint-icon/style.json b/test/integration/render-tests/within/paint-icon/style.json new file mode 100644 index 00000000000..6bdeaa21840 --- /dev/null +++ b/test/integration/render-tests/within/paint-icon/style.json @@ -0,0 +1,104 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 2, + "center": [3.25, 3.25], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.9775390625, + 2.3284603685731593 + ] + } + }, + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 2.021484375, + 7.798078531355303 + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + } + ] + } + } + }, + "sprite": "local://sprites/sprite", + "layers": [ + { + "id": "boarder", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "symbol", + "type": "symbol", + "source": "points", + "layout": { + "icon-image": "dot.sdf" + }, + "paint" : { + "icon-color": ["case", ["within", { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + ], "red", "blue"] + } + } + ] +} diff --git a/test/integration/render-tests/within/paint-line-with-simple-polygon/expected.png b/test/integration/render-tests/within/paint-line-with-simple-polygon/expected.png new file mode 100644 index 00000000000..9bf12be16d4 Binary files /dev/null and b/test/integration/render-tests/within/paint-line-with-simple-polygon/expected.png differ diff --git a/test/integration/render-tests/within/paint-line-with-simple-polygon/style.json b/test/integration/render-tests/within/paint-line-with-simple-polygon/style.json new file mode 100644 index 00000000000..bdd94246bc9 --- /dev/null +++ b/test/integration/render-tests/within/paint-line-with-simple-polygon/style.json @@ -0,0 +1,281 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 300, + "height": 200 + } + }, + "zoom": 3, + "center": [ + -20, + -19.55 + ], + "sources": { + "line": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -25.13671875, + -20.879342971957897 + ], + [ + -24.873046874999996, + -18.22935133838667 + ], + [ + -22.412109375, + -17.72775860985227 + ], + [ + -19.6875, + -17.560246503294888 + ], + [ + -18.80859375, + -15.453680224345835 + ], + [ + -16.787109375, + -15.876809064146757 + ], + [ + -14.853515625, + -18.396230138028812 + ], + [ + -15.99609375, + -20.879342971957897 + ], + [ + -14.326171874999998, + -22.350075806124853 + ], + [ + -12.041015625, + -21.207458730482642 + ], + [ + -12.480468749999998, + -19.062117883514652 + ], + [ + -13.974609375, + -16.8886597873816 + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -23.8623046875, + -22.43134015636061 + ], + [ + -15.99609375, + -23.039297747769726 + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -19.951171875, + -25.045792240303435 + ], + [ + -21.357421875, + -13.410994034321702 + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -25.5322265625, + -25.28443774698303 + ], + [ + -16.435546875, + -25.839449402063185 + ] + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -25.3125, + -14.944784875088372 + ], + [ + -28.4765625, + -18.47960905583197 + ], + [ + -28.652343749999996, + -21.453068633086772 + ], + [ + -24.08203125, + -24.367113562651262 + ], + [ + -20.214843749999996, + -20.13847031245114 + ], + [ + -17.75390625, + -19.31114335506464 + ], + [ + -17.05078125, + -24.846565348219734 + ], + [ + -10.72265625, + -24.846565348219734 + ], + [ + -10.8984375, + -18.312810846425442 + ], + [ + -15.468749999999998, + -14.264383087562637 + ], + [ + -25.3125, + -14.944784875088372 + ] + ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "border", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "draw", + "type": "line", + "source": "line", + "paint": { + "line-color": [ + "case", + [ + "within", + { + "type": "Polygon", + "coordinates": [ + [ + [ + -25.3125, + -14.944784875088372 + ], + [ + -28.4765625, + -18.47960905583197 + ], + [ + -28.652343749999996, + -21.453068633086772 + ], + [ + -24.08203125, + -24.367113562651262 + ], + [ + -20.214843749999996, + -20.13847031245114 + ], + [ + -17.75390625, + -19.31114335506464 + ], + [ + -17.05078125, + -24.846565348219734 + ], + [ + -10.72265625, + -24.846565348219734 + ], + [ + -10.8984375, + -18.312810846425442 + ], + [ + -15.468749999999998, + -14.264383087562637 + ], + [ + -25.3125, + -14.944784875088372 + ] + ] + ] + } + ], + "red", + "blue" + ] + } + }, + { + "id": "circle", + "type": "circle", + "source": "line", + "paint": { + "circle-color": "yellow", + "circle-radius": 2 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/within/paint-line/expected.png b/test/integration/render-tests/within/paint-line/expected.png new file mode 100644 index 00000000000..3aaf75a74bf Binary files /dev/null and b/test/integration/render-tests/within/paint-line/expected.png differ diff --git a/test/integration/render-tests/within/paint-line/style.json b/test/integration/render-tests/within/paint-line/style.json new file mode 100644 index 00000000000..405b892218c --- /dev/null +++ b/test/integration/render-tests/within/paint-line/style.json @@ -0,0 +1,199 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 125, + "height": 125 + } + }, + "zoom": 2, + "center": [ + -24, + -32 + ], + "sources": { + "line": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -30.805664062500004, + -31.84023266790935 + ], + [ + -20.56640625, + -32.026706293336126 + ] + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -30.629882812499996, + -28.420391085674304 + ], + [ + -18.544921875, + -28.92163128242129 + ], + [ + -18.369140624999996, + -36.49197347059368 + ], + [ + -27.24609375, + -36.77409249464194 + ] + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -31.9921875, + -27.137368359795584 + ], + [ + -32.255859375, + -35.49645605658415 + ], + [ + -22.9833984375, + -35.7465122599185 + ], + [ + -22.5, + -30.67571540416773 + ], + [ + -29.003906249999996, + -30.29701788337204 + ], + [ + -28.9599609375, + -37.64903402157864 + ], + [ + -16.1279296875, + -37.89219554724435 + ], + [ + -16.5673828125, + -26.82407078047018 + ], + [ + -31.9921875, + -27.137368359795584 + ] + ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "border", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "draw", + "type": "line", + "source": "line", + "paint": { + "line-color": [ + "case", + [ + "within", + { + "type": "Polygon", + "coordinates": [ + [ + [ + -31.9921875, + -27.137368359795584 + ], + [ + -32.255859375, + -35.49645605658415 + ], + [ + -22.9833984375, + -35.7465122599185 + ], + [ + -22.5, + -30.67571540416773 + ], + [ + -29.003906249999996, + -30.29701788337204 + ], + [ + -28.9599609375, + -37.64903402157864 + ], + [ + -16.1279296875, + -37.89219554724435 + ], + [ + -16.5673828125, + -26.82407078047018 + ], + [ + -31.9921875, + -27.137368359795584 + ] + ] + ] + } + ], + "red", + "blue" + ] + } + }, + { + "id": "circle", + "type": "circle", + "source": "line", + "paint": { + "circle-color": "yellow", + "circle-radius": 2 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/within/paint-text/expected.png b/test/integration/render-tests/within/paint-text/expected.png new file mode 100644 index 00000000000..d0eeffe0d49 Binary files /dev/null and b/test/integration/render-tests/within/paint-text/expected.png differ diff --git a/test/integration/render-tests/within/paint-text/style.json b/test/integration/render-tests/within/paint-text/style.json new file mode 100644 index 00000000000..09a9571d34f --- /dev/null +++ b/test/integration/render-tests/within/paint-text/style.json @@ -0,0 +1,109 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 2, + "center": [3.25, 3.25], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.9775390625, + 2.3284603685731593 + ] + } + }, + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "Point", + "coordinates": [ + 2.021484375, + 7.798078531355303 + ] + } + } + ] + } + }, + "border": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "border", + "type": "fill", + "source": "border", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "symbol", + "type": "symbol", + "source": "points", + "layout": { + "text-field": "Text", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-size": 10 + }, + "paint": { + "text-color": ["case", ["within", { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + } + ], "red", "blue"] + } + } + ] +} diff --git a/test/integration/render-tests/within/within-feature-collection-geojson/expected.png b/test/integration/render-tests/within/within-feature-collection-geojson/expected.png new file mode 100644 index 00000000000..076ce2fd6a4 Binary files /dev/null and b/test/integration/render-tests/within/within-feature-collection-geojson/expected.png differ diff --git a/test/integration/render-tests/within/within-feature-collection-geojson/style.json b/test/integration/render-tests/within/within-feature-collection-geojson/style.json new file mode 100644 index 00000000000..55aef92253f --- /dev/null +++ b/test/integration/render-tests/within/within-feature-collection-geojson/style.json @@ -0,0 +1,207 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 125, + "height": 125 + } + }, + "zoom": 2, + "center": [ + -24, + -36,5 + ], + "sources": { + "line": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [ + -23.5546875, + -34.59704151614416 + ], + [ + -23.642578125, + -36.87962060502676 + ] + ], + [ + [ + -30.585937499999996, + -38.34165619279593 + ], + [ + -21.62109375, + -39.70718665682654 + ] + ], + [ + [ + -24.960937499999996, + -34.813803317113134 + ], + [ + -27.24609375, + -41.96765920367816 + ] + ] + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -28.388671875, + -33.06392419812064 + ], + [ + -28.564453125, + -38.13455657705412 + ], + [ + -22.148437499999996, + -37.64903402157864 + ], + [ + -19.86328125, + -33.35806161277886 + ], + [ + -28.388671875, + -33.06392419812064 + ] + ] + ], [ + [ + [ + -31.113281249999996, + -39.16414104768742 + ], + [ + -27.861328125, + -43.580390855607845 + ], + [ + -21.884765625, + -41.640078384678915 + ], + [ + -31.113281249999996, + -39.16414104768742 + ] + ] + ]] + } + } + ] + } + } + }, + "layers": [ + { + "id": "border", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "draw", + "type": "line", + "source": "line", + "paint": { + "line-color": [ + "case", + [ + "within", + { + "type": "MultiPolygon", + "coordinates": + [ + [ + [ + [ + -28.388671875, + -33.06392419812064 + ], + [ + -28.564453125, + -38.13455657705412 + ], + [ + -22.148437499999996, + -37.64903402157864 + ], + [ + -19.86328125, + -33.35806161277886 + ], + [ + -28.388671875, + -33.06392419812064 + ] + ] + ], + [ + [ + [ + -31.113281249999996, + -39.16414104768742 + ], + [ + -27.861328125, + -43.580390855607845 + ], + [ + -21.884765625, + -41.640078384678915 + ], + [ + -31.113281249999996, + -39.16414104768742 + ] + ] + ] + ] + } + ], + "red", + "blue" + ] + } + }, + { + "id": "circle", + "type": "circle", + "source": "line", + "paint": { + "circle-color": "red", + "circle-radius": 2 + } + } + ] +} \ No newline at end of file diff --git a/test/integration/render-tests/within/within-feature-geojson/expected.png b/test/integration/render-tests/within/within-feature-geojson/expected.png new file mode 100644 index 00000000000..6a18483facd Binary files /dev/null and b/test/integration/render-tests/within/within-feature-geojson/expected.png differ diff --git a/test/integration/render-tests/within/within-feature-geojson/style.json b/test/integration/render-tests/within/within-feature-geojson/style.json new file mode 100644 index 00000000000..76db109ccad --- /dev/null +++ b/test/integration/render-tests/within/within-feature-geojson/style.json @@ -0,0 +1,89 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 2, + "center": [3.25, 3.25], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + }, + "geometry": { + "type": "MultiPoint", + "coordinates": [[ + 1.9775390625, + 2.3284603685731593 + ], + [ + 2.021484375, + 7.798078531355303 + ]] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], [0, 5], [5, 5], [5, 0], [0, 0] + ] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "boarder", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "circle", + "type": "circle", + "source": "points", + "paint": { + "circle-radius": 5, + "circle-color": ["case", ["within", { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], [0, 5], [5, 5], [5, 0], [0, 0] + ] + ] + } + } + ], "red", "blue"] + } + } + ] +} diff --git a/test/integration/render-tests/within/within-in-complex-filter/expected.png b/test/integration/render-tests/within/within-in-complex-filter/expected.png new file mode 100644 index 00000000000..7f3f172cee2 Binary files /dev/null and b/test/integration/render-tests/within/within-in-complex-filter/expected.png differ diff --git a/test/integration/render-tests/within/within-in-complex-filter/style.json b/test/integration/render-tests/within/within-in-complex-filter/style.json new file mode 100644 index 00000000000..f6c69364438 --- /dev/null +++ b/test/integration/render-tests/within/within-in-complex-filter/style.json @@ -0,0 +1,102 @@ +{ + "version": 8, + "metadata": { + "test": { + "width": 64, + "height": 64 + } + }, + "zoom": 3, + "center": [2.5, 2.5], + "sources": { + "points": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "number": [5] + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.9775390625, + 2.3284603685731593 + ] + } + }, + { + "type": "Feature", + "properties": { + "number": [5] + }, + "geometry": { + "type": "Point", + "coordinates": [ + 1.7138671875, + -1.7136116598836224 + ] + } + } + ] + } + }, + "polygon": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [[0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0]] + ] + } + } + ] + } + } + }, + "layers": [ + { + "id": "border", + "type": "fill", + "source": "polygon", + "paint": { + "fill-color": "black", + "fill-opacity": 0.5 + } + }, + { + "id": "circle", + "type": "circle", + "source": "points", + "filter": ["all", ["in", 5, ["get", "number"]], ["==", ["within", { + "type": "Polygon", + "coordinates": [ + [ + [0, 0], + [0, 5], + [5, 5], + [5, 0], + [0, 0] + ] + ] + }], true] + ], + "paint": { + "circle-radius": 5, + "circle-color": "red" + } + } + ] +} diff --git a/test/integration/render-tests/zoomed-fill/negative-zoom/expected.png b/test/integration/render-tests/zoomed-fill/negative-zoom/expected.png new file mode 100644 index 00000000000..93fd1c7b186 Binary files /dev/null and b/test/integration/render-tests/zoomed-fill/negative-zoom/expected.png differ diff --git a/test/integration/render-tests/zoomed-fill/negative-zoom/style.json b/test/integration/render-tests/zoomed-fill/negative-zoom/style.json new file mode 100644 index 00000000000..e197e225241 --- /dev/null +++ b/test/integration/render-tests/zoomed-fill/negative-zoom/style.json @@ -0,0 +1,42 @@ +{ + "version": 8, + "metadata": { + "test": { + "allowed": 0.0002, + "width": 256, + "height": 256 + } + }, + "center": [ + 0, + 0 + ], + "zoom": -1, + "sources": { + "mapbox": { + "type": "vector", + "maxzoom": 14, + "tiles": [ + "local://tiles/{z}-{x}-{y}.mvt" + ] + } + }, + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "fill", + "type": "fill", + "source": "mapbox", + "source-layer": "water", + "paint": { + "fill-color": "black" + } + } + ] +} diff --git a/test/integration/rollup.config.test.js b/test/integration/rollup.config.test.js new file mode 100644 index 00000000000..f8e347cea28 --- /dev/null +++ b/test/integration/rollup.config.test.js @@ -0,0 +1,14 @@ +import {plugins} from '../../build/rollup_plugins'; + +export default { + input: 'test/integration/lib/query-browser.js', + output: { + name: 'queryTests', + format: 'iife', + sourcemap: 'inline', + indent: false, + file: 'test/integration/dist/query-test.js' + }, + plugins: plugins(false, false), + external: [ 'tape', 'mapboxgl' ] +}; diff --git a/test/integration/sprites/icon-text-fit-1x@2x.json b/test/integration/sprites/icon-text-fit-1x@2x.json new file mode 120000 index 00000000000..db5790782a6 --- /dev/null +++ b/test/integration/sprites/icon-text-fit-1x@2x.json @@ -0,0 +1 @@ +icon-text-fit.json \ No newline at end of file diff --git a/test/integration/sprites/icon-text-fit-1x@2x.png b/test/integration/sprites/icon-text-fit-1x@2x.png new file mode 120000 index 00000000000..061acc5577a --- /dev/null +++ b/test/integration/sprites/icon-text-fit-1x@2x.png @@ -0,0 +1 @@ +icon-text-fit.png \ No newline at end of file diff --git a/test/integration/sprites/icon-text-fit-2x.json b/test/integration/sprites/icon-text-fit-2x.json new file mode 120000 index 00000000000..718350fa8a0 --- /dev/null +++ b/test/integration/sprites/icon-text-fit-2x.json @@ -0,0 +1 @@ +icon-text-fit@2x.json \ No newline at end of file diff --git a/test/integration/sprites/icon-text-fit-2x.png b/test/integration/sprites/icon-text-fit-2x.png new file mode 120000 index 00000000000..d551ece5d84 --- /dev/null +++ b/test/integration/sprites/icon-text-fit-2x.png @@ -0,0 +1 @@ +icon-text-fit@2x.png \ No newline at end of file diff --git a/test/integration/sprites/icon-text-fit.json b/test/integration/sprites/icon-text-fit.json index 70f1102ee8e..4668f96c82a 100644 --- a/test/integration/sprites/icon-text-fit.json +++ b/test/integration/sprites/icon-text-fit.json @@ -2,8 +2,24 @@ "label": { "x": 0, "y": 0, - "width": 240, - "height": 60, + "width": 76, + "height": 38, + "pixelRatio": 1, + "sdf": false + }, + "small-box": { + "x": 76, + "y": 0, + "width": 18, + "height": 10, + "pixelRatio": 1, + "sdf": false + }, + "tall-box": { + "x": 76, + "y": 10, + "width": 18, + "height": 28, "pixelRatio": 1, "sdf": false } diff --git a/test/integration/sprites/icon-text-fit.png b/test/integration/sprites/icon-text-fit.png index 167aa2086cf..1d77af78428 100644 Binary files a/test/integration/sprites/icon-text-fit.png and b/test/integration/sprites/icon-text-fit.png differ diff --git a/test/integration/sprites/icon-text-fit.svg b/test/integration/sprites/icon-text-fit.svg index 20f3a90967e..88f78c6cebc 100644 --- a/test/integration/sprites/icon-text-fit.svg +++ b/test/integration/sprites/icon-text-fit.svg @@ -1,14 +1,9 @@ - - - - - - image/svg+xml - - - - - - + + + + + + + diff --git a/test/integration/sprites/icon-text-fit@2x.json b/test/integration/sprites/icon-text-fit@2x.json new file mode 100644 index 00000000000..fb63fa138c9 --- /dev/null +++ b/test/integration/sprites/icon-text-fit@2x.json @@ -0,0 +1,26 @@ +{ + "label": { + "x": 0, + "y": 0, + "width": 152, + "height": 76, + "pixelRatio": 2, + "sdf": false + }, + "small-box": { + "x": 152, + "y": 0, + "width": 36, + "height": 20, + "pixelRatio": 2, + "sdf": false + }, + "tall-box": { + "x": 152, + "y": 20, + "width": 36, + "height": 56, + "pixelRatio": 2, + "sdf": false + } +} diff --git a/test/integration/sprites/icon-text-fit@2x.png b/test/integration/sprites/icon-text-fit@2x.png new file mode 100644 index 00000000000..52bc078f35e Binary files /dev/null and b/test/integration/sprites/icon-text-fit@2x.png differ diff --git a/test/integration/sprites/stretch.json b/test/integration/sprites/stretch.json new file mode 100644 index 00000000000..35b03bec863 --- /dev/null +++ b/test/integration/sprites/stretch.json @@ -0,0 +1,61 @@ +{ + "nine-part": { + "x": 0, + "y": 0, + "width": 40, + "height": 40, + "pixelRatio": 1, + "stretchX": [[10, 30]], + "stretchY": [[10, 30]], + "sdf": false + }, + "nine-part-content": { + "x": 0, + "y": 0, + "width": 40, + "height": 40, + "pixelRatio": 2, + "stretchX": [[10, 30]], + "stretchY": [[10, 30]], + "sdf": false, + "content": [10, 10, 30, 30] + }, + "fifteen-part": { + "x": 50, + "y": 0, + "width": 70, + "height": 40, + "pixelRatio": 1, + "stretchX": [[10, 30], [40, 60]], + "stretchY": [[10, 30]], + "sdf": false + }, + "three-part": { + "x": 150, + "y": 0, + "width": 60, + "height": 10, + "pixelRatio": 1, + "stretchX": [[20, 40]], + "sdf": false + }, + "two-part": { + "x": 250, + "y": 0, + "width": 30, + "height": 10, + "pixelRatio": 1, + "stretchX": [[10, 20]], + "sdf": false + }, + "nine-part-@2x": { + "x": 300, + "y": 0, + "width": 80, + "height": 80, + "pixelRatio": 2, + "stretchX": [[20, 60]], + "stretchY": [[20, 60]], + "sdf": false + } +} diff --git a/test/integration/sprites/stretch.png b/test/integration/sprites/stretch.png new file mode 100644 index 00000000000..36685591c28 Binary files /dev/null and b/test/integration/sprites/stretch.png differ diff --git a/test/integration/testem.js b/test/integration/testem.js new file mode 100644 index 00000000000..ec262ff7b0d --- /dev/null +++ b/test/integration/testem.js @@ -0,0 +1,169 @@ +/* eslint-disable no-global-assign */ +/* eslint-disable import/no-commonjs */ +/* eslint-disable flowtype/require-valid-file-annotation */ +require = require("esm")(module); +const {generateFixtureJson, getAllFixtureGlobs} = require('./lib/generate-fixture-json'); +const createServer = require('./lib/server'); +const buildTape = require('../../build/test/build-tape'); +const runAll = require('npm-run-all'); +const chokidar = require('chokidar'); +const rollup = require('rollup'); +const notifier = require('node-notifier'); +const rollupDevConfig = require('../../rollup.config').default; +const rollupTestConfig = require('./rollup.config.test').default; + +const rootFixturePath = 'test/integration/'; +const suitePath = 'query-tests'; +const fixtureBuildInterval = 2000; + +let beforeHookInvoked = false; +let server; + +let fixtureWatcher; +const rollupWatchers = {}; + +module.exports = { + "test_page": "test/integration/testem_page.html", + "src_files": [ + "dist/mapbox-gl-dev.js", + "test/integration/dist/query-test.js" + ], + "launch_in_dev": [], + "launch_in_ci": [ "Chrome" ], + "browser_args": { + "Chrome": { + "mode": "ci", + "args": [ "--headless", "--disable-gpu", "--remote-debugging-port=9222" ] + } + }, + "proxies": { + "/tiles":{ + "target": "http://localhost:2900" + }, + "/glyphs":{ + "target": "http://localhost:2900" + }, + "/tilesets":{ + "target": "http://localhost:2900" + }, + "/sprites":{ + "target": "http://localhost:2900" + }, + "/data":{ + "target": "http://localhost:2900" + }, + "/write-file":{ + "target": "http://localhost:2900" + } + }, + "before_tests"(config, data, callback) { + if (!beforeHookInvoked) { + server = createServer(); + const buildPromise = config.appMode === 'ci' ? buildArtifactsCi() : buildArtifactsDev(); + buildPromise.then(() => { + server.listen(callback); + }).catch((e) => { + callback(e); + }); + + beforeHookInvoked = true; + } + }, + "after_tests"(config, data, callback) { + if (config.appMode === 'ci') { + server.close(callback); + } + } +}; + +// helper method that builds test artifacts when in CI mode. +// Retuns a promise that resolves when all artifacts are built +function buildArtifactsCi() { + //1. Compile fixture data into a json file, so it can be bundled + generateFixtureJson(rootFixturePath, suitePath); + //2. Build tape + const tapePromise = buildTape(); + //3. Build test artifacts in parallel + const rollupPromise = runAll(['build-query-suite', 'build-dev'], {parallel: true}); + + return Promise.all([tapePromise, rollupPromise]); +} + +// helper method that starts a bunch of build-watchers and returns a promise +// that resolves when all of them have had their first run. +function buildArtifactsDev() { + return buildTape().then(() => { + // A promise that resolves on the first build of fixtures.json + return new Promise((resolve, reject) => { + fixtureWatcher = chokidar.watch(getAllFixtureGlobs(rootFixturePath, suitePath)); + let needsRebuild = false; + fixtureWatcher.on('ready', () => { + generateFixtureJson(rootFixturePath, suitePath); + + //Throttle calls to `generateFixtureJson` to run every 2s + setInterval(() => { + if (needsRebuild) { + generateFixtureJson(rootFixturePath, suitePath); + needsRebuild = false; + } + }, fixtureBuildInterval); + + //Flag needs rebuild when anything changes + fixtureWatcher.on('all', () => { + needsRebuild = true; + }); + // Resolve promise once chokidar has finished first scan of fixtures + resolve(); + }); + + fixtureWatcher.on('error', (e) => reject(e)); + }); + }).then(() => { + //Helper function that starts a rollup watcher + //returns a promise that resolves when the first bundle has finished + function startRollupWatcher(name, config) { + return new Promise((resolve, reject) => { + const watcher = rollup.watch(silenceWarnings(config)); + rollupWatchers[name] = watcher; + + watcher.on('event', (e) => { + if (e.code === 'START') { + notify('Query Tests', `${name} bundle started`); + } + if (e.code === 'END') { + notify('Query Tests', `${name} bundle finished`); + resolve(); + } + if (e.code === 'FATAL') { + reject(e); + } + }); + + }); + } + + return Promise.all([ + startRollupWatcher('mapbox-gl', rollupDevConfig), + startRollupWatcher('query-suite', rollupTestConfig), + ]); + }); +} + +function silenceWarnings(config) { + function addEmptyWarningHandler(configObj) { + configObj["onwarn"] = function() {}; + return configObj; + } + + if (Array.isArray(config)) { + return config.map(addEmptyWarningHandler); + } else { + return addEmptyWarningHandler(config); + } +} + +function notify(title, message) { + if (!process.env.DISABLE_BUILD_NOTIFICATIONS) { + notifier.notify({title, message}); + } +} diff --git a/test/integration/testem_page.html b/test/integration/testem_page.html new file mode 100644 index 00000000000..7cdc390cfa0 --- /dev/null +++ b/test/integration/testem_page.html @@ -0,0 +1,14 @@ + + + + Mapbox GL JS Integration Tests + + + + + + + + + + \ No newline at end of file diff --git a/test/integration/tiles/upgrade.js b/test/integration/tiles/upgrade.js index bb4ffd38f0a..5a096b99b45 100644 --- a/test/integration/tiles/upgrade.js +++ b/test/integration/tiles/upgrade.js @@ -2,7 +2,7 @@ const mapnik = require('mapnik'); const fs = require('fs'); -const queue = require('d3-queue').queue; +const queue = require('d3').queue; function upgrade(z, x, y, path, callback) { console.log('Updating ', path); @@ -18,7 +18,7 @@ function upgrade(z, x, y, path, callback) { function createExtent1024(callback) { console.log('Creating extent1024'); const buffer = fs.readFileSync('14-8802-5374.mvt'); - const vt = new mapnik.VectorTile(14, 8802, 5374, { tileSize: 1024 }); + const vt = new mapnik.VectorTile(14, 8802, 5374, {tileSize: 1024}); vt.addData(buffer, {validate: true}, (err) => { if (err) throw err; fs.writeFileSync('extent1024-14-8802-5374.mvt', vt.getDataSync()); diff --git a/test/release/README.md b/test/release/README.md new file mode 100644 index 00000000000..01e3605675c --- /dev/null +++ b/test/release/README.md @@ -0,0 +1,9 @@ +# Release testing + +This directory contains an HTML file that allows easier and faster access to test pages for smoke testing. It contains a list of examples from our documentation and allows paging through them quickly, as well as comparing it with older releases. + +To load this page, execute `npm run start-release` to build the required files, and to start the testing server. You can then access the page at http://localhost:9966/test/release/index.html. It will also be available on your local network. Scan the QR code printed to the console on a mobile device that is on the same network to access the test page. + +Alternatively, you can also access the test page on Circle CI. Find a job named `build`, click the "Artifacts" tab, and navigate to the `mapbox-gl-js/test/release/index.html` page. You'll have to enter your own access token there. Before sharing the URL, be aware that it will be stored in the hash of the URL. + +To add new pages to the list, add them to the `pages` object at the beginning of `index.js`. By default, it will load the HTML sample from https://github.com/mapbox/mapbox-gl-js-docs/tree/publisher-production/docs/pages/example using the ID. You can override this by specifying a custom `url` property next to the `title`. diff --git a/test/release/index.css b/test/release/index.css new file mode 100644 index 00000000000..10d3156ffde --- /dev/null +++ b/test/release/index.css @@ -0,0 +1,139 @@ +html, body { + margin:0; + padding:0; + height:100%; + width:100%; + position: fixed; +} + +body { + font-family:"Open Sans", sans-serif; +} + +#top { + height:60px; + background:#4264fb; + display:flex; + flex-direction: row; + flex-wrap: nowrap; + color:white; + overflow: hidden; +} + +#logo { + margin:10px; + display:flex; +} + +#title { + font-size:20px; + display:flex; + align-items:center; + padding:4px 20px; + line-height:0.9em; + text-overflow:ellipsis; +} + +.navbar-expand { + flex-grow:1; +} + +#buttons { + display:flex; +} + +a.button { + display:flex; + flex-direction:column; + height:48px; + min-width:32px; + max-width:48px; + border:0; + text-align:center; + background:none; + color:white; + font-size:12px; + padding:6px; + line-height:1.1em; +} + +a.button svg { + height:32px; +} + +a.button path { + fill:white; +} + +a.button.disabled { + opacity:0.25; +} + +.navbar-item .dropdown { + display:none; +} + +.navbar-item a { + cursor:pointer; +} + +.navbar-item.active { + background:rgba(255, 255, 255, 0.2); +} + +.navbar-item.active .dropdown { + position:absolute; + top:60px; + max-height:250px; + overflow-y:auto; + display:block; + background:rgba(255, 255, 255, 0.8); + color:#222; + /*min-width:250px;*/ + font-size:14px; +} + +.navbar-item.active .dropdown-left { + left:0; +} + +.navbar-item.active .dropdown-right { + right:0; +} + +.dropdown-item { + display:flex; + align-items:center; + padding:6px 12px; +} + +.dropdown-item:hover { + background:#4264fb; + color:white; +} + +.item-prerelase { + color:#555; +} + +.item-title { + flex-grow:1; +} + +.item-meta { + font-size:10px; + margin-left:10px; +} + +#container { + height:calc(100% - 60px); + max-height:768px; + display:flex; + background-color:#CCC; +} + +#container iframe { + flex-grow:1; + height:100%; + border:0; +} diff --git a/test/release/index.html b/test/release/index.html new file mode 100644 index 00000000000..2e081558144 --- /dev/null +++ b/test/release/index.html @@ -0,0 +1,32 @@ + + + + Mapbox GL JS release testing page + + + + + + + + + + + +
+ + diff --git a/test/release/index.js b/test/release/index.js new file mode 100644 index 00000000000..67e0da856f3 --- /dev/null +++ b/test/release/index.js @@ -0,0 +1,257 @@ +/* eslint-env browser */ +/* eslint-disable prefer-arrow-callback,prefer-template */ +/* eslint no-loop-func: "off" */ +/* eslint camelcase: "off" */ +/* global mapboxgl */ +/* global mapboxglVersions */ + +const pages = { + "geojson-markers": { + "title": "Add GeoJSON marker" + }, + "animate-point-along-line": { + "title": "Animate point" + }, + "queryrenderedfeatures": { + "title": "Get features under the mouse pointer" + }, + "scroll-fly-to": { + "title": "Fly to a location based on scroll position" + }, + "popup-on-click": { + "title": "Display a popup on click" + }, + "hover-styles": { + "title": "Create a hover effect" + }, + "satellite-map": { + "title": "Display a satellite map" + }, + "custom-marker-icons": { + "title": "Add custom icons with Markers" + }, + "filter-features-within-map-view": { + "title": "Filter features within map view" + }, + "video-on-a-map": { + "title": "Add a video" + }, + "custom-style-layer": { + "title": "Add a custom style layer" + }, + "adjust-layer-opacity": { + "title": "Adjust a layer's opacity" + }, + "check-for-support": { + "title": "Check for browser support" + }, + "mapbox-gl-geocoder": { + "title": "Add a geocoder" + }, + "mapbox-gl-directions": { + "title": "Display driving directions" + }, + "mapbox-gl-draw": { + "title": "Show drawn polygon area" + }, + "mapbox-gl-compare": { + "title": "Swipe between maps" + }, + "mapbox-gl-rtl-text": { + "title": "Add support for right-to-left scripts" + }, + "heatmap-layer": { + "title": "Add a heatmap layer" + } +}; + +const pageKeys = Object.keys(pages); + +const versions = { + 'latest': {} +}; + +Object.keys(mapboxglVersions).forEach(function(version) { + versions[version] = mapboxglVersions[version]; +}); + +document.addEventListener('DOMContentLoaded', function() { + const jsLatest = document.createElement("a"); + jsLatest.href = "../../dist/mapbox-gl.js"; + const cssLatest = document.createElement("a"); + cssLatest.href = "../../dist/mapbox-gl.css"; + + const titleItem = document.querySelector('#title'); + const titleElement = document.querySelector('#title-text'); + const titleDropdown = document.querySelector('#title .dropdown'); + const container = document.querySelector('#container'); + const versionButton = document.querySelector('#version'); + const versionItem = document.querySelector('#version-item'); + const versionDropdown = document.querySelector('#version-item .dropdown'); + const versionNumber = document.querySelector('#version-number'); + const prevButton = document.querySelector('#prev'); + const nextButton = document.querySelector('#next'); + + document.querySelector('.navbar-expand').addEventListener('click', function() { + versionItem.classList.remove('active'); + titleItem.classList.remove('active'); + }); + + const params = { + page: pages[0], + version: 'latest' + }; + + location.hash.substr(1).split('&').forEach(function (param) { + const entry = param.split('=', 2); + params[entry[0]] = entry[1]; + }); + + if (!params.access_token) { + if (mapboxgl.accessToken) { + params.access_token = mapboxgl.accessToken; + } else { + params.access_token = prompt("Access Token"); + } + } + + let pageIndex = pageKeys.indexOf(params.page); + if (pageIndex < 0) pageIndex = 0; + params.page = pageKeys[pageIndex]; + + titleElement.addEventListener('click', function() { + versionItem.classList.remove('active'); + titleItem.classList[titleItem.classList.contains('active') ? 'remove' : 'add']('active'); + }); + + Object.keys(pages).forEach(function(page) { + const item = document.createElement('a'); + item.classList.add('dropdown-item'); + const metadata = pages[page]; + item.innerHTML = '' + metadata.title + ''; + item.dataset.page = page; + item.addEventListener('click', function() { + params.page = this.dataset.page; + pageIndex = pageKeys.indexOf(this.dataset.page); + if (pageIndex < 0) pageIndex = 0; + params.page = pageKeys[pageIndex]; + titleItem.classList.remove('active'); + load(); + }); + titleDropdown.appendChild(item); + }); + + if (!(params.version in versions)) { + params.version = 'latest'; + } + + versionNumber.innerText = params.version; + versionButton.addEventListener('click', function() { + titleItem.classList.remove('active'); + versionItem.classList[versionItem.classList.contains('active') ? 'remove' : 'add']('active'); + }); + + Object.keys(versions).forEach(function(version) { + const item = document.createElement('a'); + item.classList.add('dropdown-item'); + const metadata = versions[version]; + if (metadata.prerelease) { + item.classList.add('item-prerelease'); + } + item.innerHTML = '' + version + ' ' + (metadata.released ? (new Date(metadata.released)).toISOString().substr(0, 10) : '<unknown>') + ''; + item.dataset.version = version; + item.addEventListener('click', function() { + params.version = this.dataset.version; + versionItem.classList.remove('active'); + load(); + }); + versionDropdown.appendChild(item); + }); + + let req; + let url; + + function load() { + if (req) { + req.abort(); + } + + while (container.firstChild) container.removeChild(container.firstChild); + + params.page = pageKeys[pageIndex]; + const page = params.page; + const version = params.version; + + const metadata = pages[page]; + titleElement.innerText = metadata.title; + versionNumber.innerText = params.version; + + req = new XMLHttpRequest(); + req.addEventListener("load", loadedHTML); + url = metadata.url ? metadata.url : 'https://raw.githubusercontent.com/mapbox/mapbox-gl-js-docs/publisher-production/docs/pages/example/' + page + '.html'; + req.open("GET", url); + req.send(); + + function loadedHTML() { + if (req.status !== 200) { + container.innerText = 'Failed to load ' + url + ': ' + req.statusText; + return; + } + const iframe = document.createElement('iframe'); + container.appendChild(iframe); + const iframeDoc = iframe.contentWindow.document.open("text/html", "replace"); + + const js = version === 'latest' ? jsLatest.href : 'https://api.mapbox.com/mapbox-gl-js/' + version + '/mapbox-gl.js'; + const css = version === 'latest' ? cssLatest.href : 'https://api.mapbox.com/mapbox-gl-js/' + version + '/mapbox-gl.css'; + + iframeDoc.write([ + '', + '', + '', + ' Mapbox GL JS debug page', + ' ', + ' ', + '