planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

554
node_modules/ol-mapbox-style/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,554 @@
# Changelog
## 8.2.1
* Updated dependencies
* CI changes
## 8.2.0
* More secure regular expression for property templates; simplified template handling
* Avoid unnecessary TileJSON fetches
* New `SpriteImage` type for the `transformRequest` option
## 8.1.2
* Add require field to package.json's exports to avoid ESLint complaints
## 8.1.1
* Add main field to package.json to avoid ESLint complaints (was meant to go into 8.1.0 already)
## 8.1.0
* Add support for `icon-ignore-placement` and `icon-allow-overlap`
* Add main field to package.json to avoid ESLint complaints
## 8.0.8
* Fix relative source url handling for GeoJSON sources
* Fix website examples
## 8.0.7
* Use rollup instead of webpack for creating bundles
## 8.0.6
* Remove `webfont-matcher` dependency. Instead, load Google fonts only when they are not available already.
* Normalize Arial font name to make sure it can be detected.
* Use `sans-serif` as fallback font.
## 8.0.5
* Do not advertise the `dist/olms.js` cjs bundle in `package.json`, because its imports from `ol` are not cjs compliant. This should resolve problems with old bundlers that pick the cjs bundle instead of the ejs bundle.
## 8.0.4
* Add `Accept: application/json` header to requests for jsons. This avoids e.g. problems with Esri servers returning HTML instead of JSON
* Reduce build size by stripping more fields from the style spec json.
## 8.0.3
* Fix `applyStyle()` regression that broke the function when no `sourceOrLayer` was provided
## 8.0.2
* Fix display of optional arguments in API docs
* Fix layer stack regression when layers from one source are spread across multiple OpenLayers layers
## 8.0.1
* Display API docs correctly on npmjs.com
## 8.0.0
### Breaking changes
* The package now provides two separate bundles for umd and ejs. `dist/olms.js` is the umd bundle, `dist/index.js` the ejs bundle. No other JavaScript files are provided in the `dist/` folder any more.
* Imports from the `dist/` folder are no longer supported. They need to be replaced with imports from the package, e.g. `import {stylefunction} from "ol-mapbox-style"` instead of `import stylefunction from "ol-mapbox-style/dist/stylefunction"`.
* The `apply()` function has been replaced with an alias of the default export. This means that `apply()` now returns a `Promise<Map>` instead of a `Map`.
* The auto-generated types are now stricter, because they reference OpenLayers types correctly, instead of using `any`.
### Other changes
* `apply()`, `applyStyle()` and `applyBackground()` now take an `options` argument, which can contain a `transformRequest` option. With that function, urls and requests for styles, sprites, tiles and data can be modified. This can be useful e.g. to fix relative urls or to add credentials.
* Another available option is `accessToken`. In combination with the new support for `mapbox://` urls, it has become much easier to use maps and styles from Mapbox.
* Finally, a set of resolutions can be configured in the `options`. This makes it much easier to work with layers or maps in projections other than Web Mercator.
* The `applyStyle()` function has become more powerful and can now create and populate the source of the provided layer.
* [`feature-state`](https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#feature-state) is now supported. The new functions `setFeatureState()` and `getFeatureState()` can be used to set and get the feature state.
* The build size is now at least 80 kB smaller because of pre-processing of the style specification from the `@mapbox/mapbox-gl-style-spec` package. The umd bundle no longer contains the OpenLayers code that has been there by accident for a few releases, which had unnecessarily increased the build size by almost 400 kB.
* The API docs are now generated with typedoc instead of documentation.js
## 7.1.1
* Do not use overflow for line labels
## 7.1.0
* Declutter also vector layers
* Allow text to overflow polygons
## 7.0.0
### Breaking changes
ol-mapbox-style now requires OpenLayers >= 6.13.
### All changes
* Add support for rich text labels (with OpenLayers v6.13+)
* Require ol >= 6.13
## 6.9.0
* Add support for the `icon-offset` layout property
* Fix `circle` layers with default radius
## 6.8.3
* Fix handling of fonts with two-word weights (e.g. "Semi Bold")
* Fix rendering of fill-outline when fill is fully transparent
## 6.8.2
* Use OpenLayers's fixed `ol/View#getProperties()` method, if available
* Avoid applying background if layout is none
## 6.8.1
* Fix color calculation for zero opacity when `renderTransparent(true)` is set.
## 6.8.0
* New `renderTransparent()` configuration option for more flexible hit detection
* Add `stylefunction` module functions to legacy build
* Better default view detection to avoid overwriting of view configurations
## 6.7.0
* `applyBackground()` now also accepts an OpenLayers >= 6.10 `VectorTile` layer as first argument.
## 6.6.0
* Publish declaration source maps
* Fix TileJSON handling of relative urls
* Cache functions and filters per `stylefunction` invocation
## 6.5.3
* Fix handling of `icon-color`
## 6.5.2
* Publish auto-generated `.d.ts` files for TypeScript
## 6.5.1
* Remove `ol` peer dependency from `package.json` for easier of use dev versions of `ol`
## 6.5.0
* Export `setupVectorSource()` for use in OpenLayers
## 6.4.2
* Fix import of `@mapbox/mapbox-gl-style-spec`
## 6.4.1
* Fix `webfont-matcher` import
## 6.4.0
* Change package to `"type": "module"`
* Updates to work seamlessly with ol > 6.5
## 6.3.2
* Support relative urls for TileJSON tiles (#320)
## 6.3.1
* Do not render icons when `icon-color` has zero opacity (#317)
## 6.3.0
* New `stylefunction.recordStyleLayer()` function to know which rendered layer a feature belongs to (#309)
## 6.2.1
* Improved support for relative urls in style documents (#307)
## 6.2.0
* Improved support for relative urls in style documents (#304)
* Allow empty spritesheets (#306)
* Added support for `fill-extrusion`, using a 2D fallback (#303)
## 6.1.4
* Fix OpenLayers version mismatch with legacy builds (was missing in 6.1.3) #291
## 6.1.3
* Added `Object.assign` polyfill for compatibility with old browsers #281
* Fix line wrapping of text labels #283 #284
* Fix OpenLayers version mismatch with legacy builds #291
## 6.1.2
* No more polyfills for `Object.assign` and `String#startsWith` needed #276
* Fixed issue with disappearing labels #273
* MultiLineString labeling improvements #272
* Improved developer experience with proper TypeScript configuration #270
## 6.1.1
* Fix version issue with @mapbox/mapbox-gl-style-spec
## 6.1.0
* Improvements and bug fixes for multi-line text and wrapping
* Support for running `stylefunction` in web workers
## 6.0.0
### Breaking changes
#### Module paths
ol-mapbox-style now ships with transpiled modules in the `dist/` folder, and sources in the `src/` folder. Previously, all modules were provided in the root directory.
When upgrading, the import paths need to be checked. For example,
```js
import stylefunction from 'ol-mapbox-style/stylefunction';
```
needs to be changed to
```js
import stylefunction from 'ol-mapbox-style/dist/stylefunction';
```
### Other changes
* Allow mapbox:// urls for all layer types, not just vector
## 5.0.2
* Update dependencies
* Use ol@6.0.1
* Do not fail when icons come from an expression
* Only set the maxResolution on a new view, instead of the whole resolutions array
## 5.0.0-beta.3
* Fix an issue with `icon-color´ handling
* Fix an issue with parsing Google font names
* Add support for the `icon-anchor` property
* More efficient handling or tilejson and shared vector tile sources
## 5.0.0-beta.2
* More efficient midpoint rendering
* Only include style spec once
* Trim the label-field string
* Round text size to integer pixels
## 5.0.0-beta.1
* Requires ol@6
* Uses new OpenLayers z-index ordering for decluttered content
* Support for the `text-rotation-alignment` property
* Better `max-angle` handling in combination with `text-letter-spacing`
## 4.3.0
* Load Google fonts with the correct weight and style
* Support for the `text-max-angle` layout property
* More efficient color handling without cache
* Improve text wrapping for to avoid short lines
* Apply default resolutions (Mapbox zoom levels) to the view
* Do not create layers for unsupported layer types
* Support for the `text-translate` paint property
* Improve performance for circle styles
## 4.2.1
* Smarter text wrapping. We now try to distribute text more evenly across lines
* Take letter spacing into account for calculating line breaks
* Add support for the `text-line-height` layout property
* Respect text halo for text anchor
* Fix how we interpret the `text-halo-width` paint property
* Respect `tileSize` for TileJSON when specified in the style doc
## 4.1.0
v4.1.0 brings a few performance improvements and bug fixes:
* More efficient font caching
* Always stroke polygons to be in line with the style spec
* Stroke polygons without drawing the outline a 2nd time
* Do not cache transparent colors, making hiding features more efficient
* Fix background opacity
* Respect minzoom from TileJSON sources, avoiding underzooming which can lead to loading thousands of tiles
## 4.0.0
### Breaking changes
#### Zoom handling
The way how we handle `zoom`, `minzoom` and `maxzoom` throughout the library has been reworked:
* When ol-mapbox-style creates an `ol/View` instance, it will be configured with the zoom level range that mapbox-gl uses. When updating from previous versions, you will notice that the zoom levels of the OpenLayers view will now match those in the Mapbox Style object. Previously OpenLayers zoom levels were higher by 1.
* When a Mapbox Style object is configured with a `zoom`, the zoom level will now be interpreted like in mapbox-gl, i.e. you will be zoomed in one level deeper than before the update.
* `minzoom` and `maxzoom` on a Mapbox Style layer were previously determined by the tile size of the underlying source. For raster sources with a tile size of 256, this means that `minzoom` and `maxzoom` are zoomed in one level deeper than before the update. For sources with a tile size of 512, nothing changes.
* `minzoom` and `maxzoom` on a Mapbox Style source now influence the `ol/tilegrid/TileGrid` that ol-mapbox-style creates for a source in a different way. The resolutions will always match mapbox-gl default zoom levels.
* `minzoom` and `maxzoom` on Mapbox Style layers no longer influences whether the `ol/layer/Layer` instance is set `visible` at a certain resolution. Instead, the layer's `maxResolution` and `minResolution` are set.
### Other changes
* Add support for `text-letter-spacing`
## 3.9.0
* Reduce garbage by reusing padding array
* Fix `getSource()`, `getLayer()` and `getLayers()` utility functions
* Add support for `text-padding`
## 3.8.0
* Add `getLayers()` utility function
## 3.7.2
* Use karma for tests
* Fix handling of relative paths
* Use CircleCI for continuous integration
* Do not limit raster layers to a `maxzoom` of 24
* Fix visibility handling
## 3.7.1
* Fix raster layer `minzoom` and `maxzoom`
## 3.7.0
* Support `minzoom` and `maxzoom` for raster layers
## 3.6.4
* Use TileJSON relative urls only when a TileJSON `url` was used
## 3.6.3
* Fix `icon-rotation`
## 3.6.2
* Fix standalone build
## 3.6.1
* Use TileJSON for all raster and vector sources
* Add support for TileJSON bounds
* Transfer copyright to the contributors
* Fix source/layer extent handling
* Add support for `raster-opacity`
## 3.5.0
* Do not set `zIndex` on layers
* Add support for `icon-rotation-alignment`: `'map'`
## 3.4.0
* Set layer properties only once and use first index as `zIndex`
## 3.3.0
* Improve docs, error handling and tests
* Stop using empty layer ids for `finalizeLayer()`
* Add default export that returns a `Promise` instead of an `ol/Map` instance
* Make layer ids for background unique
* Handle errors for unavailable TileJSON sources
* Factor out functions from `processStyle`'s monster loop
* Remove tile load transition for raster layers entirely
## 3.2.0
* Update dev dependencies
* Cleaned up `applyStyle()` and added tests
* Add support for `circle-stroke-opacity`
* Use block scope variables
## 3.1.0
* Use transpiled imports for mapbox-gl-style-spec
## 3.0.1
* Fix local font detection
## 3.0.0
* Add `mapbox-style` property to the `ol/Map` instance
* Add `getSource()` and `getLayer()` helper functions
* Move examples to ES6
* Allow users to specify custom resolutions
* Add support for `fill-pattern`
* Add support for filter expressions
* Smarter font stack handling
* Opacity transition only for the bottom layer
## 2.11.2
* README updates
* Fix imports
## 2.11.0
* Use webpack and babel instead of browserify
* Add continuous integration, coverage reports and use sonarqube for language quality
* Use jest for testing
* Add attribution to sources created by `apply`
* Depend on ol@5
* Move mapbox-to-ol-style package into this library
* Clear caches when `applyStyle` is called again
* Provide a standalone build
## 2.10.4
* Do not use isomorphic-fetch
* Fix typos in API docs
## 2.10.3
* Respect existing map view when setting `center` and `zoom`
* Run eslint on the code
## 2.10.2
* Set `maxResolution` on the layer, respecting `minzoom` of the source
## 2.10.0
* Update mapbox-to-ol-style and openlayers versions
## 2.9.1
* Fix background
## 2.9.0
* Do not fail when `setTarget(null)` is called on the map
* Set center and zoom when no view was created
## 2.8.4
* Fix background color
## 2.8.3
* Revert to older `mapbox-gl-style-spec` version
## 2.8.1
* Fix numeric interpolation
## 2.8.0
* Simplify web font handling
* Fix sprite urls
## 2.7.2
* Properly initialize path parts
## 2.7.1
* Only set extent when it has not been set before
* Update examples
## 2.7.0
* Fallback to low-res sprites when `@2x` spritesheet is not available
* Use native OpenLayers decluttering
## 2.6.6
* Make ESRI relative paths work with `apply()`
## 2.6.5
* Make examples mobile and cross-browser ready
## 2.6.2
* Cleanup and documentation improvements
## 2.6.1
* Performance improvements
## 2.6.0
* Decluttering of labels and symbols
* Added support for horizontal `text-anchor`
## 2.5.1
* Fixed a bug with function properties
## 2.5.0
* Respect `visibility` from all layers's `layout`
## 2.4.0
* Add support for raster and tilejson sources
## 2.3.0
* Fix a minor point styling issue
* Fix polygon outline leaks when using line styles on polygons
* Add optional `path` argument to `applyStyle()`
## 2.2.5
* Fix build on Windows
## 2.2.4
* Performance improvmeents from the `mapbox-to-ol-style` package
## 2.2.0
* Add support for `has` and `!has` filters
## 2.1.0
* Added new `apply() function, which drastically simplifies the API.
## 2.0.0
### Switch to the ol package
With version 2.x, ol-mapbox-style switched to the [`ol`](https://npmjs.com/package/ol) npm package for the OpenLayers dependency. Users of `dist/olms.js` will not notice this change. Applications that have been using the [`openlayers`](https://npmjs.com/package/openlayers) npm package should be migrated to the `ol` package too.
If switching to `ol` is not yet desired, it is still possible to use ol-mapbox-style with the `openlayers` package, with the help of [`standalonify`](https://www.npmjs.com/package/standalonify). You have to require OpenLayers as `global.ol = require('openlayers');`. To build the bundle, use a command like the following:
``` sh
$ node_modules/.bin/browserify -g [ babelify --plugins [ transform-es2015-modules-commonjs ] ] -p [ standalonify --name null --deps [ null --ol/style/style ol.style.Style --ol/style/fill ol.style.Fill --ol/style/stroke ol.style.Stroke --ol/style/circle ol.style.Circle --ol/style/icon ol.style.Icon --ol/style/text ol.style.Text ] ] example/index.js > example/bundle.js
```
### `getStyleFunction` moved to separate mapbox-to-ol-style package
For applications that do not need sprites and web fonts for their styles, a separate [`mapbox-to-ol-style`](https://npmjs.com/package/mapbox-to-ol-style) package with focus on small build size and minimal dependencies has been created. ol-mapbox-style depends on that package.
If you have previously been using the `getStyleFunction` function, you now have to import it from `mapbox-to-ol-style`. If you have not used anything else from ol-mapbox-style, you can uninstall it.
### Google fonts no longer need to be included in the html
ol-mapbox-style now automatically loads web fonts from Google. So in most cases, it is no longer necessary to scan the Mapbox Style for fonts and include them manually in the html of the application.

22
node_modules/ol-mapbox-style/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright 2016-present ol-mapbox-style contributors
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF 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.

53
node_modules/ol-mapbox-style/PUBLISHING.md generated vendored Normal file
View File

@@ -0,0 +1,53 @@
To create and publish a release, perform the following steps:
### Create a release branch
In order to make these release-related changes, create a branch in your repository clone.
Note that all the examples below use 2.11.0 as the release version, you'll want to use the appropriate version numbers for the release you're working toward.
git checkout -b v2.11.0 origin/main
### Bump the version in package.json
We use [semantic versioning](https://semver.org). Set the correct `"version"` in package.json. Run `npm install` so `package-lock.json` can pick up the changes.
Edit `CHANGELOG.md`: Add the version you are about to release just below the `## Next version` heading. Review the changes since the last release and document changes as appropriate.
Commit the changes.
git add package.json package-lock.json CHANGELOG.md
git commit -m "Set version to 2.11.0"
### Update README when API docs changed
To build the docs, run
npm run doc
When the above results in changes to README.md, commit these changes to master:
git add README.md
git commit -m "Update API docs in README"
### Merge the release branch
Create a pull request and merge the release branch. This allows for any final review of upgrade notes or other parts of the changelog.
### Publish to npm
Create build artifacts in the `dist` directory (ignored in git, but included in the npm package):
npm run build
Publish the package:
npm publish
### Create and push a tag
git tag -a v2.11.0 -m "2.11.0"
git push --tags origin
### Edit the release notes
The previous step creates a release on GitHub. Copy the changelog for the relese from `CHANGELOG.md` to the "Describe this release" field for the release notes on https://github.com/openlayers/ol-mapbox-style/releases.

609
node_modules/ol-mapbox-style/README.md generated vendored Normal file
View File

@@ -0,0 +1,609 @@
# ol-mapbox-style
Create [OpenLayers](https://openlayers.org/) maps from [Mapbox Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/) objects.
## Getting started
### Installation
To use the library in an application with an npm based dev environment, install it with
npm install ol-mapbox-style
When installed this way, just import the ol-mapbox-style module, like in the usage example below. To use a standalone build of ol-mapbox-style, just include 'dist/olms.js' on your HTML page, and access the exported functions from the global `olms` object (e.g. `olms.apply()`, `olms.applyBackground()`). Note that the standalone build depends on the legacy build of OpenLayers.
**ol-mapbox-style requires [OpenLayers](https://npmjs.com/package/ol) version >= 6.13.0 < 7**.
### Usage
**See the [API](#api) section for the full documentation.**
The code below creates an OpenLayers map from Mapbox's Bright v9 style, using a `https://` url:
```js
import apply from 'ol-mapbox-style';
apply('map', 'https://api.mapbox.com/styles/v1/mapbox/bright-v9?access_token=YOUR_MAPBOX_TOKEN');
```
To assign style and source to a layer only, use `applyStyle()`. `mapbox://` urls are also supported:
```js
import {applyStyle} from 'ol-mapbox-style';
import VectorTileLayer from 'ol/layer/VectorTile.js'
const layer = new VectorTileLayer({declutter: true});
applyStyle(layer, 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});
```
To apply the properties of the Mapbox Style's `background` layer to the map or a `VectorTile` layer, use the `applyBackground()` function.
There is also a low-level API available. To create a style function for individual OpenLayers vector or vector tile layers, use the `stylefunction` module:
```js
import {stylefunction} from 'ol-mapbox-style';
import VectorLayer from 'ol/layer/Vector.js';
import VectorSource from 'ol/source/Vector.js';
import GeoJSON from 'ol/format/GeoJSON.js';
const layer = new VectorLayer({
source: new VectorSource({
format: new GeoJSON(),
url: 'data/states.geojson'
})
});
fetch('data/states.json').then(function(response) {
response.json().then(function(glStyle) {
stylefunction(layer, glStyle, 'states');
});
});
```
Note that this low-level API does not create a source for the layer, and extra work is required to set up sprite handling for styles that use icons.
## Compatibility notes
### Font handling
Only commonly available system fonts and [Google Fonts](https://developers.google.com/fonts/) will automatically be available for any `text-font` defined in the Mapbox Style object. It is the responsibility of the application to load other fonts. Because `ol-mapbox-style` uses system and web fonts instead of PBF/SDF glyphs, the [font stack](https://www.mapbox.com/help/manage-fontstacks/) is treated a little different: style and weight are taken from the primary font (i.e. the first one in the font stack). Subsequent fonts in the font stack are only used if the primary font is not available/loaded, and they will be used with the style and weight of the primary font.
### Support for old browsers
Internet Explorer (version 11) and other old browsers (Android 4.x) are supported when polyfills for the following features are loaded:
* `fetch` (including `Promise`)
## Building the library
npm run build
The resulting distribution files will be in the `dist/` folder. To see the library in action, navigate to `dist/index.html`.
To run test locally, run
npm test
For debugging tests in the browser, run
npm run karma
and open a browser on the host and port indicated in the console output (usually <http://localhost:9876/>) and click the 'DEBUG' button to go to the debug environment.
[![Test Job](https://github.com/openlayers/ol-mapbox-style/actions/workflows/test.yml/badge.svg)](https://github.com/openlayers/ol-mapbox-style/actions/workflows/test.yml)
<!--apidoc start-->
<a name="readmemd"></a>
# API
## Table of contents
### References
- [default](#default)
### Namespaces
- [types](#modulestypesmd)
### Functions
- [apply](#apply)
- [applyBackground](#applybackground)
- [applyStyle](#applystyle)
- [getFeatureState](#getfeaturestate)
- [getLayer](#getlayer)
- [getLayers](#getlayers)
- [getSource](#getsource)
- [recordStyleLayer](#recordstylelayer)
- [renderTransparent](#rendertransparent)
- [setFeatureState](#setfeaturestate)
- [stylefunction](#stylefunction)
## References
### default
Renames and re-exports [apply](#apply)
## Functions
### apply
**apply**(`map`, `style`, `options?`): `Promise`<`Map`\>
Loads and applies a Mapbox Style object into an OpenLayers Map. This includes
the map background, the layers, the center and the zoom.
**Example:**
```js
import apply from 'ol-mapbox-style';
apply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});
```
The center and zoom will only be set if present in the Mapbox Style document,
and if not already set on the OpenLayers map.
Layers will be added to the OpenLayers map, without affecting any layers that
might already be set on the map.
Layers added by `apply()` will have two additional properties:
* `mapbox-source`: The `id` of the Mapbox Style document's source that the
OpenLayers layer was created from. Usually `apply()` creates one
OpenLayers layer per Mapbox Style source, unless the layer stack has
layers from different sources in between.
* `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are
included in the OpenLayers layer.
This function sets an additional `mapbox-style` property on the OpenLayers
map instance, which holds the Mapbox Style object.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `map` | `string` \| `HTMLElement` \| `Map` | Either an existing OpenLayers Map instance, or a HTML element, or the id of a HTML element that will be the target of a new OpenLayers Map. |
| `style` | `any` | JSON style object or style url pointing to a Mapbox Style object. When using Mapbox APIs, the url is the `styleUrl` shown in Mapbox Studio's "share" panel. In addition, the `accessToken` option (see below) must be set. When passed as JSON style object, all OpenLayers layers created by `apply()` will be immediately available, but they may not have a source yet (i.e. when they are defined by a TileJSON url in the Mapbox Style document). When passed as style url, layers will be added to the map when the Mapbox Style document is loaded and parsed. |
| `options` | [`Options`](#interfacestypesoptionsmd) | Options. |
#### Returns
`Promise`<`Map`\>
A promise that resolves after all layers have been added to
the OpenLayers Map instance, their sources set, and their styles applied. The
`resolve` callback will be called with the OpenLayers Map instance as
argument.
___
### applyBackground
**applyBackground**(`mapOrLayer`, `glStyle`, `options?`): `Promise`<`any`\>
Applies properties of the Mapbox Style's first `background` layer to the
provided map or VectorTile layer.
**Example:**
```js
import {applyBackground} from 'ol-mapbox-style';
import {Map} from 'ol';
const map = new Map({target: 'map'});
applyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');
```
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `mapOrLayer` | `VectorTileLayer` \| `Map` | OpenLayers Map or VectorTile layer. |
| `glStyle` | `any` | Mapbox Style object or url. |
| `options` | [`Options`](#interfacestypesoptionsmd) | Options. |
#### Returns
`Promise`<`any`\>
Promise that resolves when the background is applied.
___
### applyStyle
**applyStyle**(`layer`, `glStyle`, `sourceOrLayers?`, `optionsOrPath?`, `resolutions?`): `Promise`<`any`\>
Applies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector`
with an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source
yet, it will be created and populated from the information in the `glStyle`.
**Example:**
```js
import {applyStyle} from 'ol-mapbox-style';
import {VectorTile} from 'ol/layer.js';
const layer = new VectorTile({declutter: true});
applyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');
```
The style function will render all layers from the `glStyle` object that use the source
of the first layer, the specified `source`, or a subset of layers from the same source. The
source needs to be a `"type": "vector"` or `"type": "geojson"` source.
Two additional properties will be set on the provided layer:
* `mapbox-source`: The `id` of the Mapbox Style document's source that the
OpenLayers layer was created from. Usually `apply()` creates one
OpenLayers layer per Mapbox Style source, unless the layer stack has
layers from different sources in between.
* `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are
included in the OpenLayers layer.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `layer` | `VectorLayer`<`any`\> \| `VectorTileLayer` | `undefined` | OpenLayers layer. When the layer has a source configured, it will be modified to use the configuration from the glStyle's `source`. Options specified on the layer's source will override those from the glStyle's `source`, except for `url`, `tileUrlFunction` and `tileGrid` (exception: when the source projection is not `EPSG:3857`). |
| `glStyle` | `any` | `undefined` | Mapbox Style object. |
| `sourceOrLayers` | `string` \| `string`[] | `''` | `source` key or an array of layer `id`s from the Mapbox Style object. When a `source` key is provided, all layers for the specified source will be included in the style function. When layer `id`s are provided, they must be from layers that use the same source. When not provided or a falsey value, all layers using the first source specified in the glStyle will be rendered. |
| `optionsOrPath` | `string` \| [`Options`](#interfacestypesoptionsmd) | `{}` | Options. Alternatively the path of the style file (only required when a relative path is used for the `"sprite"` property of the style). |
| `resolutions` | `number`[] | `undefined` | Resolutions for mapping resolution to zoom level. Only needed when working with non-standard tile grids or projections. |
#### Returns
`Promise`<`any`\>
Promise which will be resolved when the style can be used
for rendering.
___
### getFeatureState
**getFeatureState**(`mapOrLayer`, `feature`): `any`
Sets or removes a feature state. The feature state is taken into account for styling,
just like the feature's properties, and can be used e.g. to conditionally render selected
features differently.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `mapOrLayer` | `VectorLayer`<`any`\> \| `VectorTileLayer` \| `Map` | Map or layer to set the feature state on. |
| `feature` | [`FeatureIdentifier`](#interfacestypesfeatureidentifiermd) | Feature identifier. |
#### Returns
`any`
Feature state or `null` when no feature state is set for the given
feature identifier.
___
### getLayer
**getLayer**(`map`, `layerId`): `Layer`<`Source`, `LayerRenderer`<`any`\>\>
Get the OpenLayers layer instance that contains the provided Mapbox Style
`layer`. Note that multiple Mapbox Style layers are combined in a single
OpenLayers layer instance when they use the same Mapbox Style `source`.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `map` | `Map` | OpenLayers Map. |
| `layerId` | `string` | Mapbox Style layer id. |
#### Returns
`Layer`<`Source`, `LayerRenderer`<`any`\>\>
OpenLayers layer instance.
___
### getLayers
**getLayers**(`map`, `sourceId`): `Layer`<`Source`, `LayerRenderer`<`any`\>\>[]
Get the OpenLayers layer instances for the provided Mapbox Style `source`.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `map` | `Map` | OpenLayers Map. |
| `sourceId` | `string` | Mapbox Style source id. |
#### Returns
`Layer`<`Source`, `LayerRenderer`<`any`\>\>[]
OpenLayers layer instances.
___
### getSource
**getSource**(`map`, `sourceId`): `Source`
Get the OpenLayers source instance for the provided Mapbox Style `source`.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `map` | `Map` | OpenLayers Map. |
| `sourceId` | `string` | Mapbox Style source id. |
#### Returns
`Source`
OpenLayers source instance.
___
### recordStyleLayer
**recordStyleLayer**(`record?`): `void`
Turns recording of the Mapbox Style's `layer` on and off. When turned on,
the layer that a rendered feature belongs to will be set as the feature's
`mapbox-layer` property.
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `record` | `boolean` | `false` | Recording of the style layer is on. |
#### Returns
`void`
___
### renderTransparent
**renderTransparent**(`enabled`): `void`
Configure whether features with a transparent style should be rendered. When
set to `true`, it will be possible to hit detect content that is not visible,
like transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or
`ol/Map#getFeaturesAtPixel()`
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `enabled` | `boolean` | Rendering of transparent elements is enabled. Default is `false`. |
#### Returns
`void`
___
### setFeatureState
**setFeatureState**(`mapOrLayer`, `feature`, `state`): `void`
Sets or removes a feature state. The feature state is taken into account for styling,
just like the feature's properties, and can be used e.g. to conditionally render selected
features differently.
The feature state will be stored on the OpenLayers layer matching the feature identifier, in the
`mapbox-featurestate` property.
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `mapOrLayer` | `VectorLayer`<`any`\> \| `VectorTileLayer` \| `Map` | OpenLayers Map or layer to set the feature state on. |
| `feature` | [`FeatureIdentifier`](#interfacestypesfeatureidentifiermd) | Feature identifier. |
| `state` | `any` | Feature state. Set to `null` to remove the feature state. |
#### Returns
`void`
___
### stylefunction
**stylefunction**(`olLayer`, `glStyle`, `sourceOrLayers`, `resolutions?`, `spriteData?`, `spriteImageUrl?`, `getFonts?`): `StyleFunction`
Creates a style function from the `glStyle` object for all layers that use
the specified `source`, which needs to be a `"type": "vector"` or
`"type": "geojson"` source and applies it to the specified OpenLayers layer.
Two additional properties will be set on the provided layer:
* `mapbox-source`: The `id` of the Mapbox Style document's source that the
OpenLayers layer was created from. Usually `apply()` creates one
OpenLayers layer per Mapbox Style source, unless the layer stack has
layers from different sources in between.
* `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are
included in the OpenLayers layer.
This function also works in a web worker. In worker mode, the main thread needs
to listen to messages from the worker and respond with another message to make
sure that sprite image loading works:
```js
worker.addEventListener('message', event => {
if (event.data.action === 'loadImage') {
const image = new Image();
image.crossOrigin = 'anonymous';
image.addEventListener('load', function() {
createImageBitmap(image, 0, 0, image.width, image.height).then(imageBitmap => {
worker.postMessage({
action: 'imageLoaded',
image: imageBitmap,
src: event.data.src
}, [imageBitmap]);
});
});
image.src = event.data.src;
}
});
```
#### Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `olLayer` | `VectorLayer`<`any`\> \| `VectorTileLayer` | `undefined` | OpenLayers layer to apply the style to. In addition to the style, the layer will get two properties: `mapbox-source` will be the `id` of the `glStyle`'s source used for the layer, and `mapbox-layers` will be an array of the `id`s of the `glStyle`'s layers. |
| `glStyle` | `any` | `undefined` | Mapbox Style object. |
| `sourceOrLayers` | `string` \| `string`[] | `undefined` | `source` key or an array of layer `id`s from the Mapbox Style object. When a `source` key is provided, all layers for the specified source will be included in the style function. When layer `id`s are provided, they must be from layers that use the same source. |
| `resolutions` | `number`[] | `defaultResolutions` | Resolutions for mapping resolution to zoom level. |
| `spriteData` | `any` | `undefined` | Sprite data from the url specified in the Mapbox Style object's `sprite` property. Only required if a `sprite` property is specified in the Mapbox Style object. |
| `spriteImageUrl` | `string` | `undefined` | Sprite image url for the sprite specified in the Mapbox Style object's `sprite` property. Only required if a `sprite` property is specified in the Mapbox Style object. |
| `getFonts` | (`arg0`: `string`[]) => `string`[] | `undefined` | Function that receives a font stack as arguments, and returns a (modified) font stack that is available. Font names are the names used in the Mapbox Style object. If not provided, the font stack will be used as-is. This function can also be used for loading web fonts. |
#### Returns
`StyleFunction`
Style function for use in
`ol.layer.Vector` or `ol.layer.VectorTile`.
<a name="interfacestypesfeatureidentifiermd"></a>
# Interface: FeatureIdentifier<\>
[types](#modulestypesmd).FeatureIdentifier
## Table of contents
### Properties
- [id](#id)
- [source](#source)
## Properties
### id
**id**: `string` \| `number`
The feature id.
___
### source
**source**: `string`
The source id.
<a name="interfacestypesoptionsmd"></a>
# Interface: Options<\>
[types](#modulestypesmd).Options
## Table of contents
### Properties
- [accessToken](#accesstoken)
- [accessTokenParam](#accesstokenparam)
- [resolutions](#resolutions)
- [styleUrl](#styleurl)
- [transformRequest](#transformrequest)
## Properties
### accessToken
**accessToken**: `string`
Access token for 'mapbox://' urls.
___
### accessTokenParam
**accessTokenParam**: `string`
Access token param. For internal use.
___
### resolutions
**resolutions**: `number`[]
Resolutions for mapping resolution to zoom level.
Only needed when working with non-standard tile grids or projections.
___
### styleUrl
**styleUrl**: `string`
URL of the Mapbox GL style. Required for styles that were provided
as object, when they contain a relative sprite url, or sources referencing data by relative url.
___
### transformRequest
**transformRequest**: (`arg0`: `string`, `arg1`: [`ResourceType`](#resourcetype)) => `void` \| `Request`
#### Type declaration
▸ (`arg0`, `arg1`): `void` \| `Request`
Function for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying
the url, adding headers or setting credentials options. Called with the url and the resource
type as arguments, this function is supposed to return a `Request` object. Without a return value,
the original request will not be modified. For `Tiles` and `GeoJSON` resources, only the `url` of
the returned request will be respected.
##### Parameters
| Name | Type |
| :------ | :------ |
| `arg0` | `string` |
| `arg1` | [`ResourceType`](#resourcetype) |
##### Returns
`void` \| `Request`
<a name="modulestypesmd"></a>
# Namespace: types
## Table of contents
### Interfaces
- [FeatureIdentifier](#interfacestypesfeatureidentifiermd)
- [Options](#interfacestypesoptionsmd)
### Type Aliases
- [ResourceType](#resourcetype)
## Type Aliases
### ResourceType
Ƭ **ResourceType**<\>: ``"Style"`` \| ``"Source"`` \| ``"Sprite"`` \| ``"SpriteImage"`` \| ``"Tiles"`` \| ``"GeoJSON"``
<!--apidoc end-->

231
node_modules/ol-mapbox-style/dist/apply.d.ts generated vendored Normal file
View File

@@ -0,0 +1,231 @@
/**
* Applies a style function to an `ol/layer/VectorTile` or `ol/layer/Vector`
* with an `ol/source/VectorTile` or an `ol/source/Vector`. If the layer does not have a source
* yet, it will be created and populated from the information in the `glStyle`.
*
* **Example:**
* ```js
* import {applyStyle} from 'ol-mapbox-style';
* import {VectorTile} from 'ol/layer.js';
*
* const layer = new VectorTile({declutter: true});
* applyStyle(layer, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');
* ```
*
* The style function will render all layers from the `glStyle` object that use the source
* of the first layer, the specified `source`, or a subset of layers from the same source. The
* source needs to be a `"type": "vector"` or `"type": "geojson"` source.
*
* Two additional properties will be set on the provided layer:
*
* * `mapbox-source`: The `id` of the Mapbox Style document's source that the
* OpenLayers layer was created from. Usually `apply()` creates one
* OpenLayers layer per Mapbox Style source, unless the layer stack has
* layers from different sources in between.
* * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are
* included in the OpenLayers layer.
*
* @param {VectorTileLayer|VectorLayer} layer OpenLayers layer. When the layer has a source configured,
* it will be modified to use the configuration from the glStyle's `source`. Options specified on the
* layer's source will override those from the glStyle's `source`, except for `url`,
* `tileUrlFunction` and `tileGrid` (exception: when the source projection is not `EPSG:3857`).
* @param {string|Object} glStyle Mapbox Style object.
* @param {string|Array<string>} sourceOrLayers `source` key or an array of layer `id`s from the
* Mapbox Style object. When a `source` key is provided, all layers for the
* specified source will be included in the style function. When layer `id`s
* are provided, they must be from layers that use the same source. When not provided or a falsey
* value, all layers using the first source specified in the glStyle will be rendered.
* @param {Options|string} optionsOrPath Options. Alternatively the path of the style file
* (only required when a relative path is used for the `"sprite"` property of the style).
* @param {Array<number>} resolutions Resolutions for mapping resolution to zoom level.
* Only needed when working with non-standard tile grids or projections.
* @return {Promise} Promise which will be resolved when the style can be used
* for rendering.
*/
export function applyStyle(layer: VectorTileLayer | VectorLayer<any>, glStyle: string | any, sourceOrLayers?: string | Array<string>, optionsOrPath?: Options | string, resolutions?: Array<number>): Promise<any>;
/**
* Applies properties of the Mapbox Style's first `background` layer to the
* provided map or VectorTile layer.
*
* **Example:**
* ```js
* import {applyBackground} from 'ol-mapbox-style';
* import {Map} from 'ol';
*
* const map = new Map({target: 'map'});
* applyBackground(map, 'https://api.maptiler.com/maps/basic/style.json?key=YOUR_OPENMAPTILES_TOKEN');
* ```
* @param {Map|VectorTileLayer} mapOrLayer OpenLayers Map or VectorTile layer.
* @param {Object|string} glStyle Mapbox Style object or url.
* @param {Options} options Options.
* @return {Promise} Promise that resolves when the background is applied.
*/
export function applyBackground(mapOrLayer: Map | VectorTileLayer, glStyle: any | string, options?: Options): Promise<any>;
/**
* Creates an OpenLayers VectorTile source for a gl source entry.
* @param {Object} glSource "source" entry from a Mapbox Style object.
* @param {string|undefined} styleUrl URL to use for the source. This is expected to be the complete http(s) url,
* with access key applied.
* @param {Options} options Options.
* @return {Promise<import("ol/source/VectorTile").default>} Promise resolving to a VectorTile source.
* @private
*/
export function setupVectorSource(glSource: any, styleUrl: string | undefined, options: Options): Promise<import("ol/source/VectorTile").default>;
/**
* Loads and applies a Mapbox Style object into an OpenLayers Map. This includes
* the map background, the layers, the center and the zoom.
*
* **Example:**
* ```js
* import apply from 'ol-mapbox-style';
*
* apply('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: 'YOUR_MAPBOX_TOKEN'});
* ```
*
* The center and zoom will only be set if present in the Mapbox Style document,
* and if not already set on the OpenLayers map.
*
* Layers will be added to the OpenLayers map, without affecting any layers that
* might already be set on the map.
*
* Layers added by `apply()` will have two additional properties:
*
* * `mapbox-source`: The `id` of the Mapbox Style document's source that the
* OpenLayers layer was created from. Usually `apply()` creates one
* OpenLayers layer per Mapbox Style source, unless the layer stack has
* layers from different sources in between.
* * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are
* included in the OpenLayers layer.
*
* This function sets an additional `mapbox-style` property on the OpenLayers
* map instance, which holds the Mapbox Style object.
*
* @param {Map|HTMLElement|string} map Either an existing OpenLayers Map
* instance, or a HTML element, or the id of a HTML element that will be the
* target of a new OpenLayers Map.
* @param {string|Object} style JSON style object or style url pointing to a
* Mapbox Style object. When using Mapbox APIs, the url is the `styleUrl`
* shown in Mapbox Studio's "share" panel. In addition, the `accessToken` option
* (see below) must be set.
* When passed as JSON style object, all OpenLayers layers created by `apply()`
* will be immediately available, but they may not have a source yet (i.e. when
* they are defined by a TileJSON url in the Mapbox Style document). When passed
* as style url, layers will be added to the map when the Mapbox Style document
* is loaded and parsed.
* @param {Options} options Options.
* @return {Promise<Map>} A promise that resolves after all layers have been added to
* the OpenLayers Map instance, their sources set, and their styles applied. The
* `resolve` callback will be called with the OpenLayers Map instance as
* argument.
*/
export function apply(map: Map | HTMLElement | string, style: string | any, options?: Options): Promise<Map>;
/**
* Get the OpenLayers layer instance that contains the provided Mapbox Style
* `layer`. Note that multiple Mapbox Style layers are combined in a single
* OpenLayers layer instance when they use the same Mapbox Style `source`.
* @param {Map} map OpenLayers Map.
* @param {string} layerId Mapbox Style layer id.
* @return {Layer} OpenLayers layer instance.
*/
export function getLayer(map: Map, layerId: string): Layer;
/**
* Get the OpenLayers layer instances for the provided Mapbox Style `source`.
* @param {Map} map OpenLayers Map.
* @param {string} sourceId Mapbox Style source id.
* @return {Array<Layer>} OpenLayers layer instances.
*/
export function getLayers(map: Map, sourceId: string): Array<Layer>;
/**
* Get the OpenLayers source instance for the provided Mapbox Style `source`.
* @param {Map} map OpenLayers Map.
* @param {string} sourceId Mapbox Style source id.
* @return {Source} OpenLayers source instance.
*/
export function getSource(map: Map, sourceId: string): Source;
/**
* Sets or removes a feature state. The feature state is taken into account for styling,
* just like the feature's properties, and can be used e.g. to conditionally render selected
* features differently.
*
* The feature state will be stored on the OpenLayers layer matching the feature identifier, in the
* `mapbox-featurestate` property.
* @param {Map|VectorLayer|VectorTileLayer} mapOrLayer OpenLayers Map or layer to set the feature
* state on.
* @param {FeatureIdentifier} feature Feature identifier.
* @param {Object|null} state Feature state. Set to `null` to remove the feature state.
*/
export function setFeatureState(mapOrLayer: Map | VectorLayer<any> | VectorTileLayer, feature: FeatureIdentifier, state: any | null): void;
/**
* Sets or removes a feature state. The feature state is taken into account for styling,
* just like the feature's properties, and can be used e.g. to conditionally render selected
* features differently.
* @param {Map|VectorLayer|VectorTileLayer} mapOrLayer Map or layer to set the feature state on.
* @param {FeatureIdentifier} feature Feature identifier.
* @return {Object|null} Feature state or `null` when no feature state is set for the given
* feature identifier.
*/
export function getFeatureState(mapOrLayer: Map | VectorLayer<any> | VectorTileLayer, feature: FeatureIdentifier): any | null;
export { finalizeLayer as _finalizeLayer };
export type FeatureIdentifier = {
/**
* The feature id.
*/
id: string | number;
/**
* The source id.
*/
source: string;
};
export type Options = {
/**
* Access token for 'mapbox://' urls.
*/
accessToken?: string | undefined;
/**
* Function for controlling how `ol-mapbox-style` fetches resources. Can be used for modifying
* the url, adding headers or setting credentials options. Called with the url and the resource
* type as arguments, this function is supposed to return a `Request` object. Without a return value,
* the original request will not be modified. For `Tiles` and `GeoJSON` resources, only the `url` of
* the returned request will be respected.
*/
transformRequest?: ((arg0: string, arg1: ResourceType) => (Request | void)) | undefined;
/**
* Resolutions for mapping resolution to zoom level.
* Only needed when working with non-standard tile grids or projections.
*/
resolutions?: number[] | undefined;
/**
* URL of the Mapbox GL style. Required for styles that were provided
* as object, when they contain a relative sprite url, or sources referencing data by relative url.
*/
styleUrl?: string | undefined;
/**
* Access token param. For internal use.
*/
accessTokenParam?: string | undefined;
};
export type ResourceType = 'Style' | 'Source' | 'Sprite' | 'SpriteImage' | 'Tiles' | 'GeoJSON';
export type Layer = import("ol/layer/Layer").default;
export type Source = import("ol/source/Source").default;
import VectorTileLayer from "ol/layer/VectorTile.js";
import VectorLayer from "ol/layer/Vector.js";
import Map from "ol/Map.js";
/**
* If layerIds is not empty, applies the style specified in glStyle to the layer,
* and adds the layer to the map.
*
* The layer may not yet have a source when the function is called. If so, the style
* is applied to the layer via a once listener on the 'change:source' event.
*
* @param {Layer} layer An OpenLayers layer instance.
* @param {Array<string>} layerIds Array containing layer ids of already-processed layers.
* @param {Object} glStyle Style as a JSON object.
* @param {string|undefined} styleUrl The original style URL. Only required
* when a relative path is used with the `"sprite"` property of the style.
* @param {Map} map OpenLayers Map.
* @param {Options} options Options.
* @return {Promise} Returns a promise that resolves after the source has
* been set on the specified layer, and the style has been applied.
* @private
*/
declare function finalizeLayer(layer: Layer, layerIds: Array<string>, glStyle: any, styleUrl: string | undefined, map: Map, options?: Options): Promise<any>;

3
node_modules/ol-mapbox-style/dist/examples/common.js generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
{
"version": 8,
"name": "states",
"center": [-122.19952899999998, 51.920367528011525],
"zoom": 3,
"glyphs": "{fontstack}/{range}",
"sources": {
"states": {
"type": "geojson",
"data": "./states.geojson"
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "rgba(0,0,0,0)"
}
},
{
"id": "population_lt_2m",
"type": "fill",
"source": "states",
"filter": ["<=", "PERSONS", 2000000],
"paint": {
"fill-color": "#A6CEE3",
"fill-opacity": 0.7
}
},
{
"id": "2m_lt_population_lte_4m",
"type": "fill",
"source": "states",
"filter": ["all", [">", "PERSONS", 2000000], ["<=", "PERSONS", 4000000]],
"paint": {
"fill-color": "#0F78B4",
"fill-opacity": 0.7
}
},
{
"id": "population_gt_4m",
"type": "fill",
"source": "states",
"filter": [">", "PERSONS", 4000000],
"paint": {
"fill-color": "#B2DF8A",
"fill-opacity": 0.7
}
},
{
"id": "state_outlines",
"type": "line",
"source": "states",
"paint": {
"line-color": "#8cadbf",
"line-width": 0.1
}
},
{
"id": "state_abbreviations",
"type": "symbol",
"source": "states",
"minzoom": 4,
"maxzoom": 5,
"layout": {
"text-field": "{STATE_ABBR}",
"text-size": 12,
"text-font": ["Arial Normal", "sans-serif Normal"]
}
},
{
"id": "state_names",
"type": "symbol",
"source": "states",
"minzoom": 5,
"layout": {
"text-field": ["concat", ["get", "STATE_ABBR"], "\n", ["get", "STATE_NAME"]],
"text-size": 12,
"text-font": ["Arial Normal", "sans-serif Normal"]
}
}
]
}

View File

@@ -0,0 +1 @@
{"accommodation_camping": {"y": 0, "width": 20, "pixelRatio": 1, "x": 0, "height": 20}, "amenity_firestation": {"y": 0, "width": 50, "pixelRatio": 1, "x": 20, "height": 50}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1 @@
{"accommodation_camping": {"y": 0, "width": 40, "pixelRatio": 2, "x": 0, "height": 40}, "amenity_firestation": {"y": 0, "width": 100, "pixelRatio": 2, "x": 40, "height": 100}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,82 @@
{
"version": 8,
"name": "states",
"glyphs": "{fontstack}/{range}",
"sources": {
"states": {
"type": "geojson",
"data": "./states.geojson"
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "rgba(0,0,0,0)"
}
},
{
"id": "population_lt_2m",
"type": "fill",
"source": "states",
"filter": ["<=", "PERSONS", 2000000],
"paint": {
"fill-color": "#A6CEE3",
"fill-opacity": 0.7
}
},
{
"id": "2m_lt_population_lte_4m",
"type": "fill",
"source": "states",
"filter": ["all", [">", "PERSONS", 2000000], ["<=", "PERSONS", 4000000]],
"paint": {
"fill-color": "#0F78B4",
"fill-opacity": 0.7
}
},
{
"id": "population_gt_4m",
"type": "fill",
"source": "states",
"filter": [">", "PERSONS", 4000000],
"paint": {
"fill-color": "#B2DF8A",
"fill-opacity": 0.7
}
},
{
"id": "state_outlines",
"type": "line",
"source": "states",
"paint": {
"line-color": "#8cadbf",
"line-width": 0.1
}
},
{
"id": "state_abbreviations",
"type": "symbol",
"source": "states",
"minzoom": 4,
"maxzoom": 5,
"layout": {
"text-field": "{STATE_ABBR}",
"text-size": 12,
"text-font": ["Arial Normal", "sans-serif Normal"]
}
},
{
"id": "state_names",
"type": "symbol",
"source": "states",
"minzoom": 5,
"layout": {
"text-field": ["concat", ["get", "STATE_ABBR"], "\n", ["get", "STATE_NAME"]],
"text-size": 12,
"text-font": ["Arial Normal", "sans-serif Normal"]
}
}
]
}

View File

@@ -0,0 +1,26 @@
{
"version": 8,
"name": "tilejson",
"center": [0, 0],
"zoom": 2,
"sources": {
"tilejson": {
"type": "raster",
"url": "https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json"
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "rgba(0,0,0,0)"
}
},
{
"id": "tilejson-layer",
"type": "raster",
"source": "tilejson"
}
]
}

View File

@@ -0,0 +1,43 @@
{
"version": 8,
"name": "states-wms",
"center": [-98.78906130124426, 37.92686191312036],
"zoom": 4,
"sources": {
"osm": {
"type": "raster",
"attribution": "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors.",
"tileSize": 256,
"tiles": [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",
"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",
"https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"
]
},
"states": {
"type": "raster",
"maxzoom": 12,
"tileSize": 256,
"tiles": ["https://ahocevar.com/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/png&SRS=EPSG:900913&LAYERS=topp:states&STYLES=&WIDTH=256&HEIGHT=256&BBOX={bbox-epsg-3857}"]
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "rgba(0,0,0,0)"
}
},
{
"id": "osm",
"type": "raster",
"source": "osm"
},
{
"id": "states-wms",
"type": "raster",
"source": "states"
}
]
}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=esri-transformrequest.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="esri-transformrequest.js"></script><link href="esri-transformrequest.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[945],{5569:(e,s,r)=>{r(9789),(0,r(5955).ZP)("map","https://www.arcgis.com/sharing/rest/content/items/2afe5b807fa74006be6363fd243ffb30/resources/styles/root.json",{transformRequest:function(e,s){if("Source"===s)return new Request(e.replace("/VectorTileServer","/VectorTileServer/"))}})}},e=>{e(e.s=5569)}]);
//# sourceMappingURL=esri-transformrequest.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"esri-transformrequest.js","mappings":"0HAGA,E,QAAA,IACE,MACA,gHACA,CACEA,iBAAA,SAAiBC,EAAKC,GACpB,GAAa,WAATA,EACF,OAAO,IAAIC,QACTF,EAAIG,QAAQ,oBAAqB,sBAGvC,G","sources":["webpack://ol-mapbox-style/./examples/esri-transformrequest.js"],"sourcesContent":["import 'ol/ol.css';\nimport olms from 'ol-mapbox-style';\n\nolms(\n 'map',\n 'https://www.arcgis.com/sharing/rest/content/items/2afe5b807fa74006be6363fd243ffb30/resources/styles/root.json',\n {\n transformRequest(url, type) {\n if (type === 'Source') {\n return new Request(\n url.replace('/VectorTileServer', '/VectorTileServer/')\n );\n }\n },\n }\n);\n"],"names":["transformRequest","url","type","Request","replace"],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=geojson-featurestate.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="geojson-featurestate.js"></script><link href="geojson-featurestate.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[874],{8516:(e,t,l)=>{l(9789);var s=l(5955),n="data/geojson.json";fetch(n).then((function(e){return e.json()})).then((function(e){return e.layers.push({id:"state-hover",type:"fill",source:"states",paint:{"fill-color":"red","fill-opacity":["case",["boolean",["feature-state","hover"],!1],.5,0]}}),(0,s.ZP)("map",e,{styleUrl:n})})).then((function(e){var t=null;e.on("pointermove",(function(l){var n=e.getFeaturesAtPixel(l.pixel);n.length>0?(null!==t&&(0,s.LN)(e,{source:"states",id:t},null),t=n[0].getId(),(0,s.LN)(e,{source:"states",id:t},{hover:!0})):null!==t&&((0,s.LN)(e,{source:"states",id:t},null),t=null)}))}))}},e=>{e(e.s=8516)}]);
//# sourceMappingURL=geojson-featurestate.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"geojson-featurestate.js","mappings":"uIAGMA,EAAW,oBAEjBC,MAAMD,GACHE,MAAK,SAACC,GAAQ,OAAKA,EAASC,MAAI,IAChCF,MAAK,SAACG,GAeL,OAdAA,EAAQC,OAAOC,KAAK,CAClB,GAAM,cACN,KAAQ,OACR,OAAU,SACV,MAAS,CACP,aAAc,MACd,eAAgB,CACd,OACA,CAAC,UAAW,CAAC,gBAAiB,UAAU,GACxC,GACA,OAIC,QAAK,MAAOF,EAAS,CAACL,SAAUA,GACzC,IACCE,MAAK,SAACM,GACLC,IAAIC,EAAiB,KACrBF,EAAIG,GAAG,eAAe,SAAUC,GAC9BC,IAAMC,EAAWN,EAAIO,mBAAmBH,EAAII,OACxCF,EAASG,OAAS,GACG,OAAnBP,IACF,QAAgBF,EAAK,CAACU,OAAQ,SAAUC,GAAIT,GAAiB,MAE/DA,EAAiBI,EAAS,GAAGM,SAC7B,QACEZ,EACA,CAACU,OAAQ,SAAUC,GAAIT,GACvB,CAACW,OAAO,KAEkB,OAAnBX,KACT,QAAgBF,EAAK,CAACU,OAAQ,SAAUC,GAAIT,GAAiB,MAC7DA,EAAiB,KAErB,GACF,G","sources":["webpack://ol-mapbox-style/./examples/geojson-featurestate.js"],"sourcesContent":["import 'ol/ol.css';\nimport olms, {setFeatureState} from 'ol-mapbox-style';\n\nconst styleUrl = 'data/geojson.json';\n\nfetch(styleUrl)\n .then((response) => response.json())\n .then((glStyle) => {\n glStyle.layers.push({\n 'id': 'state-hover',\n 'type': 'fill',\n 'source': 'states',\n 'paint': {\n 'fill-color': 'red',\n 'fill-opacity': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n 0.5,\n 0,\n ],\n },\n });\n return olms('map', glStyle, {styleUrl: styleUrl});\n })\n .then((map) => {\n let hoveredStateId = null;\n map.on('pointermove', function (evt) {\n const features = map.getFeaturesAtPixel(evt.pixel);\n if (features.length > 0) {\n if (hoveredStateId !== null) {\n setFeatureState(map, {source: 'states', id: hoveredStateId}, null);\n }\n hoveredStateId = features[0].getId();\n setFeatureState(\n map,\n {source: 'states', id: hoveredStateId},\n {hover: true}\n );\n } else if (hoveredStateId !== null) {\n setFeatureState(map, {source: 'states', id: hoveredStateId}, null);\n hoveredStateId = null;\n }\n });\n });\n"],"names":["styleUrl","fetch","then","response","json","glStyle","layers","push","map","let","hoveredStateId","on","evt","const","features","getFeaturesAtPixel","pixel","length","source","id","getId","hover"],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=geojson-inline.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="geojson-inline.js"></script><link href="geojson-inline.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[223],{6065:(s,e,n)=>{n(9789),(0,n(5955).nn)("map","data/geojson-inline.json")}},s=>{s(s.s=6065)}]);
//# sourceMappingURL=geojson-inline.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"geojson-inline.js","mappings":"0HAGA,E,QAAA,IAAM,MAAO,2B","sources":["webpack://ol-mapbox-style/./examples/geojson-inline.js"],"sourcesContent":["import 'ol/ol.css';\nimport {apply} from 'ol-mapbox-style';\n\napply('map', 'data/geojson-inline.json');\n"],"names":[],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=geojson-layer.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="geojson-layer.js"></script><link href="geojson-layer.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[145],{2236:(e,s,a)=>{a(9789);var o=a(5218),n=a(6219),t=a(8615),l=a(5955),p=a(9786),w=new o.Z;(0,l.bg)(w,"data/geojson.json"),new n.Z({target:"map",layers:[w],view:new t.ZP({center:(0,p.mi)([-122.19952899999998,51.920367528011525]),zoom:3})})}},e=>{e(e.s=2236)}]);
//# sourceMappingURL=geojson-layer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"geojson-layer.js","mappings":"+KAMMA,EAAQ,IAAI,KAClB,QAAWA,EAAO,qBAClB,IAAI,IAAI,CACNC,OAAQ,MACRC,OAAQ,CAACF,GACTG,KAAM,IAAI,KAAK,CACbC,QAAQ,QAAW,EAAE,mBAAoB,qBACzCC,KAAM,K","sources":["webpack://ol-mapbox-style/./examples/geojson-layer.js"],"sourcesContent":["import 'ol/ol.css';\nimport VectorLayer from 'ol/layer/Vector.js';\nimport {Map, View} from 'ol';\nimport {applyStyle} from 'ol-mapbox-style';\nimport {fromLonLat} from 'ol/proj.js';\n\nconst layer = new VectorLayer();\napplyStyle(layer, 'data/geojson.json');\nnew Map({\n target: 'map',\n layers: [layer],\n view: new View({\n center: fromLonLat([-122.19952899999998, 51.920367528011525]),\n zoom: 3,\n }),\n});\n"],"names":["layer","target","layers","view","center","zoom"],"sourceRoot":""}

294
node_modules/ol-mapbox-style/dist/examples/geojson.css generated vendored Normal file
View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=geojson.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="geojson.js"></script><link href="geojson.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[346],{4783:(s,e,a)=>{a(9789),(0,a(5955).nn)("map","data/geojson.json")}},s=>{s(s.s=4783)}]);
//# sourceMappingURL=geojson.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"geojson.js","mappings":"0HAGA,E,QAAA,IAAM,MAAO,oB","sources":["webpack://ol-mapbox-style/./examples/geojson.js"],"sourcesContent":["import 'ol/ol.css';\nimport {apply} from 'ol-mapbox-style';\n\napply('map', 'data/geojson.json');\n"],"names":[],"sourceRoot":""}

31
node_modules/ol-mapbox-style/dist/examples/index.html generated vendored Normal file
View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>ol-mapbox-style Examples</title>
<style>
body {
font-family: Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>ol-mapbox-style Examples</h1>
<ul>
<li><a href="mapbox.html">Mapbox</a> (requires a <a href="https://www.mapbox.com/studio/account/tokens/">Mapbox API token</a>) &ndash; Vector tile map from Mapbox's Bright style</li>
<li><a href="openmaptiles.html">OpenMapTiles</a> (requires a <a href="https://cloud.maptiler.com/account/keys">Maptiler Cloud API token</a>) &ndash; Vector tile map from OpenMapTiles's basic style</li>
<li><a href="geojson.html">GeoJSON</a> &ndash; Map with a vector layer from GeoJSON</li>
<li><a href="geojson-featurestate.html">GeoJSON with Hover Effect</a> &ndash; Use <code>feature-state</code> for a hover effect</li>
<li><a href="geojson-inline.html">Inline GeoJSON</a> &ndash; Map with a vector layer from GeoJSON embedded in the style object</li>
<li><a href="wms.html">OSM with WMS overlay</a> &ndash; Map with two raster layers (OSM base map and WMS overlay)</li>
<li><a href="tilejson.html">TileJSON</a> &ndash; Map with a raster layer from a TileJSON definition</li>
<li><a href="tilejson-vectortile.html">TileJSON vector tiles</a> &ndash; Vector tile map with a source from a TileJSON definition</li>
<li><a href="esri-transformrequest.html">Esri vector tiles with bad tile URLs</a> &ndash; Esri vector tile map using the <code>transformRequest</code> option to fix tile urls.</li>
<li><a href="openmaptiles-layer.html">OpenMapTiles Layer</a> (requires a <a href="https://cloud.maptiler.com/account/keys">Maptiler Cloud API token</a>) &ndash; Vector tile layer from OpenMapTiles's basic style</li>
<li><a href="geojson-layer.html">GeoJSON Layer</a> &ndash; Vector layer from GeoJSON</li>
<li><a href="stylefunction.html">Style function</a> &ndash; Low-level API for creating a style function from a Mapbox Style source</li>
</ul>
</body>
</html>

294
node_modules/ol-mapbox-style/dist/examples/mapbox.css generated vendored Normal file
View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=mapbox.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="mapbox.js"></script><link href="mapbox.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

2
node_modules/ol-mapbox-style/dist/examples/mapbox.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[862],{7018:(e,o,s)=>{s(9789);var c=s(5955),a=document.cookie.replace(/(?:(?:^|.*;\s*)mapbox_access_token\s*\=\s*([^;]*).*$)|^.*$/,"$1");a||(a=window.prompt("Enter your Mapbox API access token:"),document.cookie="mapbox_access_token="+a+"; expires=Fri, 31 Dec 9999 23:59:59 GMT"),(0,c.ZP)("map","mapbox://styles/mapbox/bright-v9",{accessToken:a})}},e=>{e(e.s=7018)}]);
//# sourceMappingURL=mapbox.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mapbox.js","mappings":"uIAGIA,EAAMC,SAASC,OAAOC,QACxB,6DACA,MAEGH,IACHA,EAAMI,OAAOC,OAAO,uCACpBJ,SAASC,OACP,uBAAyBF,EAAM,4CAGnC,QAAK,MAAO,mCAAoC,CAACM,YAAaN,G","sources":["webpack://ol-mapbox-style/./examples/mapbox.js"],"sourcesContent":["import 'ol/ol.css';\nimport olms from 'ol-mapbox-style';\n\nlet key = document.cookie.replace(\n /(?:(?:^|.*;\\s*)mapbox_access_token\\s*\\=\\s*([^;]*).*$)|^.*$/,\n '$1'\n);\nif (!key) {\n key = window.prompt('Enter your Mapbox API access token:');\n document.cookie =\n 'mapbox_access_token=' + key + '; expires=Fri, 31 Dec 9999 23:59:59 GMT';\n}\n\nolms('map', 'mapbox://styles/mapbox/bright-v9', {accessToken: key});\n"],"names":["key","document","cookie","replace","window","prompt","accessToken"],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=openmaptiles-layer.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="openmaptiles-layer.js"></script><link href="openmaptiles-layer.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[507],{8890:(e,s,t)=>{t(9789);var o=t(3015),c=t(6219),a=t(8615),n=t(5955),i=document.cookie.replace(/(?:(?:^|.*;\s*)tilehosting_access_token\s*\=\s*([^;]*).*$)|^.*$/,"$1");i||(i=window.prompt("Enter your tilehosting API access token:"),document.cookie="tilehosting_access_token="+i+"; expires=Fri, 31 Dec 9999 23:59:59 GMT");var l="https://api.maptiler.com/maps/basic/style.json?key="+i,p=new o.Z({declutter:!0});(0,n.bg)(p,l),(0,n.h0)(p,l),new c.Z({target:"map",layers:[p],view:new a.ZP({center:[0,0],zoom:2})})}},e=>{e(e.s=8890)}]);
//# sourceMappingURL=openmaptiles-layer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"openmaptiles-layer.js","mappings":"qKAOIA,EAAMC,SAASC,OAAOC,QACxB,kEACA,MAEGH,IACHA,EAAMI,OAAOC,OAAO,4CACpBJ,SAASC,OACP,4BACAF,EACA,2CAEJM,IAAMC,EAAWC,sDAAoBR,EAE/BS,EAAQ,IAAI,IAAgB,CAChCC,WAAW,KAEb,QAAWD,EAAOF,IAClB,QAAgBE,EAAOF,GACvB,IAAI,IAAI,CACNI,OAAQ,MACRC,OAAQ,CAACH,GACTI,KAAM,IAAI,KAAK,CACbC,OAAQ,CAAC,EAAG,GACZC,KAAM,K","sources":["webpack://ol-mapbox-style/./examples/openmaptiles-layer.js"],"sourcesContent":["import 'ol/ol.css';\nimport VectorTileLayer from 'ol/layer/VectorTile.js';\nimport {Map, View} from 'ol';\nimport {applyBackground, applyStyle} from 'ol-mapbox-style';\n\nconst baseUrl = 'https://api.maptiler.com/maps/basic/style.json';\n\nlet key = document.cookie.replace(\n /(?:(?:^|.*;\\s*)tilehosting_access_token\\s*\\=\\s*([^;]*).*$)|^.*$/,\n '$1'\n);\nif (!key) {\n key = window.prompt('Enter your tilehosting API access token:');\n document.cookie =\n 'tilehosting_access_token=' +\n key +\n '; expires=Fri, 31 Dec 9999 23:59:59 GMT';\n}\nconst styleUrl = baseUrl + '?key=' + key;\n\nconst layer = new VectorTileLayer({\n declutter: true,\n});\napplyStyle(layer, styleUrl);\napplyBackground(layer, styleUrl);\nnew Map({\n target: 'map',\n layers: [layer],\n view: new View({\n center: [0, 0],\n zoom: 2,\n }),\n});\n"],"names":["key","document","cookie","replace","window","prompt","const","styleUrl","baseUrl","layer","declutter","target","layers","view","center","zoom"],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=openmaptiles.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="openmaptiles.js"></script><link href="openmaptiles.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[347],{3563:(e,s,o)=>{o(9789);var t=o(5955),c=document.cookie.replace(/(?:(?:^|.*;\s*)tilehosting_access_token\s*\=\s*([^;]*).*$)|^.*$/,"$1");c||(c=window.prompt("Enter your tilehosting API access token:"),document.cookie="tilehosting_access_token="+c+"; expires=Fri, 31 Dec 9999 23:59:59 GMT"),(0,t.ZP)("map","https://api.maptiler.com/maps/basic/style.json?key="+c)}},e=>{e(e.s=3563)}]);
//# sourceMappingURL=openmaptiles.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"openmaptiles.js","mappings":"uIAKIA,EAAMC,SAASC,OAAOC,QACxB,kEACA,MAEGH,IACHA,EAAMI,OAAOC,OAAO,4CACpBJ,SAASC,OACP,4BACAF,EACA,4CAGJ,QAAK,MAAOM,sDAAoBN,E","sources":["webpack://ol-mapbox-style/./examples/openmaptiles.js"],"sourcesContent":["import 'ol/ol.css';\nimport olms from 'ol-mapbox-style';\n\nconst baseUrl = 'https://api.maptiler.com/maps/basic/style.json';\n\nlet key = document.cookie.replace(\n /(?:(?:^|.*;\\s*)tilehosting_access_token\\s*\\=\\s*([^;]*).*$)|^.*$/,\n '$1'\n);\nif (!key) {\n key = window.prompt('Enter your tilehosting API access token:');\n document.cookie =\n 'tilehosting_access_token=' +\n key +\n '; expires=Fri, 31 Dec 9999 23:59:59 GMT';\n}\n\nolms('map', baseUrl + '?key=' + key);\n"],"names":["key","document","cookie","replace","window","prompt","baseUrl"],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=stylefunction.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="stylefunction.js"></script><link href="stylefunction.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[890],{4468:(e,t,a)=>{a(9789);var n=a(8833),s=a(6219),o=a(5218),r=a(8275),u=a(8615),c=a(5955),l=new o.Z({declutter:!0,source:new r.Z({format:new n.Z,url:"data/states.geojson"})}),w=new s.Z({target:"map",view:new u.ZP({center:[-13603186.115192635,6785744.563386],zoom:2})});fetch("data/states.json").then((function(e){return e.json()})).then((function(e){(0,c.uX)(l,e,"states"),-1===w.getLayers().getArray().indexOf(l)&&w.addLayer(l)}))}},e=>{e(e.s=4468)}]);
//# sourceMappingURL=stylefunction.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"stylefunction.js","mappings":"yLASMA,EAAQ,IAAI,IAAY,CAC5BC,WAAW,EACXC,OAAQ,IAAI,IAAa,CACvBC,OAAQ,IAAI,IACZC,IAAK,0BAIHC,EAAM,IAAI,IAAI,CAClBC,OAAQ,MACRC,KAAM,IAAI,KAAK,CACbC,OAAQ,EAAE,mBAAoB,gBAC9BC,KAAM,MAIVC,MAAM,oBACHC,MAAK,SAACC,GAAC,OAAKA,EAAEC,MAAI,IAClBF,MAAK,SAACG,IACL,QAAcd,EAAOc,EAAS,WACqB,IAA/CT,EAAIU,YAAYC,WAAWC,QAAQjB,IACrCK,EAAIa,SAASlB,EAEjB,G","sources":["webpack://ol-mapbox-style/./examples/stylefunction.js"],"sourcesContent":["import 'ol/ol.css';\nimport GeoJsonFormat from 'ol/format/GeoJSON.js';\nimport Map from 'ol/Map.js';\nimport VectorLayer from 'ol/layer/Vector.js';\nimport VectorSource from 'ol/source/Vector.js';\nimport View from 'ol/View.js';\n\nimport {stylefunction} from 'ol-mapbox-style';\n\nconst layer = new VectorLayer({\n declutter: true,\n source: new VectorSource({\n format: new GeoJsonFormat(),\n url: 'data/states.geojson',\n }),\n});\n\nconst map = new Map({\n target: 'map',\n view: new View({\n center: [-13603186.115192635, 6785744.563386],\n zoom: 2,\n }),\n});\n\nfetch('data/states.json')\n .then((r) => r.json())\n .then((glStyle) => {\n stylefunction(layer, glStyle, 'states');\n if (map.getLayers().getArray().indexOf(layer) === -1) {\n map.addLayer(layer);\n }\n });\n"],"names":["layer","declutter","source","format","url","map","target","view","center","zoom","fetch","then","r","json","glStyle","getLayers","getArray","indexOf","addLayer"],"sourceRoot":""}

View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=tilejson-vectortile.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="tilejson-vectortile.js"></script><link href="tilejson-vectortile.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[366],{3327:(s,e,o)=>{o(9789),(0,o(5955).nn)("map"," https://demo.tegola.io/styles/hot-osm.json")}},s=>{s(s.s=3327)}]);
//# sourceMappingURL=tilejson-vectortile.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"tilejson-vectortile.js","mappings":"0HAGA,E,QAAA,IAAM,MAAO,8C","sources":["webpack://ol-mapbox-style/./examples/tilejson-vectortile.js"],"sourcesContent":["import 'ol/ol.css';\nimport {apply} from 'ol-mapbox-style';\n\napply('map', ' https://demo.tegola.io/styles/hot-osm.json');\n"],"names":[],"sourceRoot":""}

294
node_modules/ol-mapbox-style/dist/examples/tilejson.css generated vendored Normal file
View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=tilejson.css.map*/

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="tilejson.js"></script><link href="tilejson.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[177],{8492:(s,e,a)=>{a(9789),(0,a(5955).nn)("map","data/tilejson.json")}},s=>{s(s.s=8492)}]);
//# sourceMappingURL=tilejson.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"tilejson.js","mappings":"0HAGA,E,QAAA,IAAM,MAAO,qB","sources":["webpack://ol-mapbox-style/./examples/tilejson.js"],"sourcesContent":["import 'ol/ol.css';\nimport {apply} from 'ol-mapbox-style';\n\napply('map', 'data/tilejson.json');\n"],"names":[],"sourceRoot":""}

294
node_modules/ol-mapbox-style/dist/examples/wms.css generated vendored Normal file
View File

@@ -0,0 +1,294 @@
.ol-box {
box-sizing: border-box;
border-radius: 2px;
border: 1.5px solid rgb(179,197,219);
background-color: rgba(255,255,255,0.4);
}
.ol-mouse-position {
top: 8px;
right: 8px;
position: absolute;
}
.ol-scale-line {
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
left: 8px;
padding: 2px;
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eee;
border-top: none;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
will-change: contents, width;
transition: all 0.25s;
}
.ol-scale-singlebar-even{
background-color: #000000;
}
.ol-scale-singlebar-odd{
background-color: #ffffff;
}
.ol-scale-bar {
position: absolute;
bottom: 8px;
left: 8px;
}
.ol-scale-step-marker {
width: 1px;
height: 15px;
background-color: #000000;
float: right;
z-index: 10;
}
.ol-scale-step-text {
position: absolute;
bottom: -5px;
font-size: 12px;
z-index: 11;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-text {
position: absolute;
font-size: 14px;
text-align: center;
bottom: 25px;
color: #000000;
text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;
}
.ol-scale-singlebar {
position: relative;
height: 10px;
z-index: 9;
box-sizing: border-box;
border: 1px solid black;
}
.ol-unsupported {
display: none;
}
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-viewport canvas {
all: unset;
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-control:hover {
background-color: rgba(255,255,255,0.6);
}
.ol-zoom {
top: .5em;
left: .5em;
}
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
left: .5em;
}
.ol-full-screen {
right: .5em;
top: .5em;
}
.ol-control button {
display: block;
margin: 1px;
padding: 0;
color: white;
font-weight: bold;
text-decoration: none;
font-size: inherit;
text-align: center;
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
}
.ol-control button::-moz-focus-inner {
border: none;
padding: 0;
}
.ol-zoom-extent button {
line-height: 1.4em;
}
.ol-compass {
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
}
.ol-touch .ol-zoom-extent {
top: 5.5em;
}
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
.ol-attribution {
text-align: right;
bottom: .5em;
right: .5em;
max-width: calc(100% - 1.3em);
display: flex;
flex-flow: row-reverse;
align-items: center;
}
.ol-attribution a {
color: rgba(0,60,136,0.7);
text-decoration: none;
}
.ol-attribution ul {
margin: 0;
padding: 1px .5em;
color: #000;
text-shadow: 0 0 2px #fff;
font-size: 12px;
}
.ol-attribution li {
display: inline;
list-style: none;
}
.ol-attribution li:not(:last-child):after {
content: " ";
}
.ol-attribution img {
max-height: 2em;
max-width: inherit;
vertical-align: middle;
}
.ol-attribution button {
flex-shrink: 0;
}
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-attribution.ol-uncollapsible {
bottom: 0;
right: 0;
border-radius: 4px 0 0;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-uncollapsible button {
display: none;
}
.ol-zoomslider {
top: 4.5em;
left: .5em;
height: 200px;
}
.ol-zoomslider button {
position: relative;
height: 10px;
}
.ol-touch .ol-zoomslider {
top: 5.5em;
}
.ol-overviewmap {
left: 0.5em;
bottom: 0.5em;
}
.ol-overviewmap.ol-uncollapsible {
bottom: 0;
left: 0;
border-radius: 0 4px 0 0;
}
.ol-overviewmap .ol-overviewmap-map,
.ol-overviewmap button {
display: block;
}
.ol-overviewmap .ol-overviewmap-map {
border: 1px solid #7b98bc;
height: 150px;
margin: 2px;
width: 150px;
}
.ol-overviewmap:not(.ol-collapsed) button {
bottom: 2px;
left: 2px;
position: absolute;
}
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
.ol-overviewmap.ol-uncollapsible button {
display: none;
}
.ol-overviewmap:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}
/*# sourceMappingURL=wms.css.map*/

File diff suppressed because one or more lines are too long

8
node_modules/ol-mapbox-style/dist/examples/wms.html generated vendored Normal file
View File

@@ -0,0 +1,8 @@
<!doctype html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="initial-scale=1,user-scalable=no,width=device-width"><title>ol-mapbox-style example</title><style>html, body {
height: 100%;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}</style><script defer="defer" src="common.js"></script><script defer="defer" src="wms.js"></script><link href="wms.css" rel="stylesheet"></head><body><div id="map"></div><script src="https://polyfill.io/v3/polyfill.min.js?features=default,fetch,String.prototype.startsWith"></script></body></html>

2
node_modules/ol-mapbox-style/dist/examples/wms.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[840],{2516:(s,a,e)=>{e(9789),(0,e(5955).ZP)("map","data/wms.json")}},s=>{s(s.s=2516)}]);
//# sourceMappingURL=wms.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"wms.js","mappings":"0HAGA,E,QAAA,IAAK,MAAO,gB","sources":["webpack://ol-mapbox-style/./examples/wms.js"],"sourcesContent":["import 'ol/ol.css';\nimport olms from 'ol-mapbox-style';\n\nolms('map', 'data/wms.json');\n"],"names":[],"sourceRoot":""}

2
node_modules/ol-mapbox-style/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export { stylefunction, recordStyleLayer, renderTransparent } from "./stylefunction.js";
export { apply as default, apply, applyBackground, applyStyle, getFeatureState, setFeatureState, getLayer, getLayers, getSource } from "./apply.js";

8032
node_modules/ol-mapbox-style/dist/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/ol-mapbox-style/dist/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

34
node_modules/ol-mapbox-style/dist/mapbox.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
/**
* Gets the path from a mapbox:// URL.
* @param {string} url The Mapbox URL.
* @return {string} The path.
* @private
*/
export function getMapboxPath(url: string): string;
/**
* Turns mapbox:// sprite URLs into resolvable URLs.
* @param {string} url The sprite URL.
* @param {string} token The access token.
* @param {string} styleUrl The style URL.
* @return {string} A resolvable URL.
* @private
*/
export function normalizeSpriteUrl(url: string, token: string, styleUrl: string): string;
/**
* Turns mapbox:// style URLs into resolvable URLs.
* @param {string} url The style URL.
* @param {string} token The access token.
* @return {string} A resolvable URL.
* @private
*/
export function normalizeStyleUrl(url: string, token: string): string;
/**
* Turns mapbox:// source URLs into vector tile URL templates.
* @param {string} url The source URL.
* @param {string} token The access token.
* @param {string} tokenParam The access token key.
* @param {string} styleUrl The style URL.
* @return {string} A vector tile template.
* @private
*/
export function normalizeSourceUrl(url: string, token: string, tokenParam: string, styleUrl: string): string;

2
node_modules/ol-mapbox-style/dist/olms.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/ol-mapbox-style/dist/olms.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

120
node_modules/ol-mapbox-style/dist/stylefunction.d.ts generated vendored Normal file
View File

@@ -0,0 +1,120 @@
/**
* @private
* @param {Object} layer Gl object layer.
* @param {string} layoutOrPaint 'layout' or 'paint'.
* @param {string} property Feature property.
* @param {number} zoom Zoom.
* @param {Object} feature Gl feature.
* @param {Object} [functionCache] Function cache.
* @param {Object} [featureState] Feature state.
* @return {?} Value.
*/
export function getValue(layer: any, layoutOrPaint: string, property: string, zoom: number, feature: any, functionCache?: any, featureState?: any): unknown;
/**
* Configure whether features with a transparent style should be rendered. When
* set to `true`, it will be possible to hit detect content that is not visible,
* like transparent fills of polygons, using `ol/layer/Layer#getFeatures()` or
* `ol/Map#getFeaturesAtPixel()`
* @param {boolean} enabled Rendering of transparent elements is enabled.
* Default is `false`.
*/
export function renderTransparent(enabled: boolean): void;
/**
* Turns recording of the Mapbox Style's `layer` on and off. When turned on,
* the layer that a rendered feature belongs to will be set as the feature's
* `mapbox-layer` property.
* @param {boolean} record Recording of the style layer is on.
*/
export function recordStyleLayer(record?: boolean): void;
/**
* Creates a style function from the `glStyle` object for all layers that use
* the specified `source`, which needs to be a `"type": "vector"` or
* `"type": "geojson"` source and applies it to the specified OpenLayers layer.
*
* Two additional properties will be set on the provided layer:
*
* * `mapbox-source`: The `id` of the Mapbox Style document's source that the
* OpenLayers layer was created from. Usually `apply()` creates one
* OpenLayers layer per Mapbox Style source, unless the layer stack has
* layers from different sources in between.
* * `mapbox-layers`: The `id`s of the Mapbox Style document's layers that are
* included in the OpenLayers layer.
*
* This function also works in a web worker. In worker mode, the main thread needs
* to listen to messages from the worker and respond with another message to make
* sure that sprite image loading works:
*
* ```js
* worker.addEventListener('message', event => {
* if (event.data.action === 'loadImage') {
* const image = new Image();
* image.crossOrigin = 'anonymous';
* image.addEventListener('load', function() {
* createImageBitmap(image, 0, 0, image.width, image.height).then(imageBitmap => {
* worker.postMessage({
* action: 'imageLoaded',
* image: imageBitmap,
* src: event.data.src
* }, [imageBitmap]);
* });
* });
* image.src = event.data.src;
* }
* });
* ```
*
* @param {VectorLayer|VectorTileLayer} olLayer OpenLayers layer to
* apply the style to. In addition to the style, the layer will get two
* properties: `mapbox-source` will be the `id` of the `glStyle`'s source used
* for the layer, and `mapbox-layers` will be an array of the `id`s of the
* `glStyle`'s layers.
* @param {string|Object} glStyle Mapbox Style object.
* @param {string|Array<string>} sourceOrLayers `source` key or an array of layer `id`s
* from the Mapbox Style object. When a `source` key is provided, all layers for
* the specified source will be included in the style function. When layer `id`s
* are provided, they must be from layers that use the same source.
* @param {Array<number>} resolutions
* Resolutions for mapping resolution to zoom level.
* @param {Object} spriteData Sprite data from the url specified in
* the Mapbox Style object's `sprite` property. Only required if a `sprite`
* property is specified in the Mapbox Style object.
* @param {string} spriteImageUrl Sprite image url for the sprite
* specified in the Mapbox Style object's `sprite` property. Only required if a
* `sprite` property is specified in the Mapbox Style object.
* @param {function(Array<string>):Array<string>} getFonts Function that
* receives a font stack as arguments, and returns a (modified) font stack that
* is available. Font names are the names used in the Mapbox Style object. If
* not provided, the font stack will be used as-is. This function can also be
* used for loading web fonts.
* @return {StyleFunction} Style function for use in
* `ol.layer.Vector` or `ol.layer.VectorTile`.
*/
export function stylefunction(olLayer: import("ol/layer/Vector").default<any> | VectorTileLayer, glStyle: string | any, sourceOrLayers: string | Array<string>, resolutions?: Array<number>, spriteData?: any, spriteImageUrl?: string, getFonts?: (arg0: Array<string>) => Array<string>): StyleFunction;
export type VectorLayer = import("ol/layer/Vector").default<any>;
export type VectorTileLayer = import("ol/layer/VectorTile").default;
export type StyleFunction = import("ol/style/Style").StyleFunction;
/**
* @private
* @param {?} color Color.
* @param {number} [opacity] Opacity.
* @return {string} Color.
*/
declare function colorWithOpacity(color: unknown, opacity?: number | undefined): string;
/**
* @private
* @param {string} layerId Layer id.
* @param {?} filter Filter.
* @param {Object} feature Feature.
* @param {number} zoom Zoom.
* @param {Object} [filterCache] Filter cache.
* @return {boolean} Filter result.
*/
declare function evaluateFilter(layerId: string, filter: unknown, feature: any, zoom: number, filterCache?: any): boolean;
/**
* @private
* @param {string} text Text.
* @param {Object} properties Properties.
* @return {string} Text.
*/
declare function fromTemplate(text: string, properties: any): string;
export { colorWithOpacity as _colorWithOpacity, evaluateFilter as _evaluateFilter, fromTemplate as _fromTemplate, getValue as _getValue };

8
node_modules/ol-mapbox-style/dist/text.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export function applyLetterSpacing(text: any, letterSpacing: any): any;
export function wrapText(text: any, font: any, em: any, letterSpacing: any): any;
/**
* @param {Array} fonts Fonts.
* @return {Array} Processed fonts.
* @private
*/
export function getFonts(fonts: any[]): any[];

28
node_modules/ol-mapbox-style/dist/util.d.ts generated vendored Normal file
View File

@@ -0,0 +1,28 @@
export function deg2rad(degrees: any): number;
/**
* @param {number} width Width of the canvas.
* @param {number} height Height of the canvas.
* @return {HTMLCanvasElement} Canvas.
*/
export function createCanvas(width: number, height: number): HTMLCanvasElement;
export function getZoomForResolution(resolution: any, resolutions: any): number;
/**
* @param {ResourceType} resourceType Type of resource to load.
* @param {string} url Url of the resource.
* @param {Options} [options={}] Options.
* @return {Promise<Object|Response>} Promise that resolves with the loaded resource
* or rejects with the Response object.
* @private
*/
export function fetchResource(resourceType: ResourceType, url: string, options?: import("./apply.js").Options | undefined): Promise<any | Response>;
export function getGlStyle(glStyleOrUrl: any, options: any): Promise<any>;
/**
* @param {Object} glSource glStyle source object.
* @param {string} styleUrl Style URL.
* @param {Options} options Options.
* @return {Object} TileJson
*/
export function getTileJson(glSource: any, styleUrl: string, options?: Options): any;
export const defaultResolutions: number[];
export type Options = import("./apply.js").Options;
export type ResourceType = import('./apply.js').ResourceType;

94
node_modules/ol-mapbox-style/package.json generated vendored Normal file
View File

@@ -0,0 +1,94 @@
{
"name": "ol-mapbox-style",
"version": "8.2.1",
"description": "Create OpenLayers maps from Mapbox Style objects",
"type": "module",
"browser": "dist/index.js",
"main": "dist/olms.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/olms.js"
}
},
"repository": {
"type": "git",
"url": "git://github.com/openlayers/ol-mapbox-style.git"
},
"bugs": {
"url": "https://github.com/openlayers/ol-mapbox-style/issues"
},
"keywords": [
"openlayers",
"mapbox",
"vector tiles"
],
"license": "BSD-2-Clause",
"scripts": {
"start": "webpack serve --config ./webpack.config.examples.cjs",
"prepare": "npm run doc && npm run build",
"build": "tsc --project tsconfig-build.json && rollup -c && esm=true rollup -c && webpack-cli --mode=production --config ./webpack.config.examples.cjs",
"doc": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-plugin-missing-exports src/index.js --readme none --excludeExternals --internalNamespace 'types' --name API --hideBreadcrumbs --disableSources --tsconfig tsconfig-typecheck.json && npx concat-md docs --hide-anchor-links=false | npx md-insert README.md -i --region apidoc",
"karma": "karma start test/karma.conf.cjs",
"lint": "eslint test examples src",
"typecheck": "tsc --project tsconfig-typecheck.json",
"pretest": "npm run lint && npm run typecheck",
"test": "npm run karma -- --single-run --log-level error"
},
"dependencies": {
"@mapbox/mapbox-gl-style-spec": "^13.23.1",
"mapbox-to-css-font": "^2.4.1"
},
"devDependencies": {
"@mapbox/flow-remove-types": "^2.0.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@types/arcgis-rest-api": "^10.4.4",
"@types/mocha": "^9.1.0",
"@types/offscreencanvas": "^2019.6.4",
"@types/topojson-specification": "^1.0.1",
"babel-loader": "^8.0.6",
"buble": "^0.20.0",
"buble-loader": "^0.5.1",
"concat-md": "^0.4.0",
"copy-webpack-plugin": "^11.0.0",
"coverage-istanbul-loader": "^3.0.5",
"css-loader": "^6.5.1",
"deep-freeze": "0.0.1",
"eslint": "^8.2.0",
"eslint-config-openlayers": "^16.2.3",
"eslint-import-resolver-alias": "^1.1.2",
"html-webpack-plugin": "^5.5.0",
"json-strip-loader": "^1.0.5",
"karma": "^6.3.4",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-mocha": "^2.0.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^5.0.0",
"mapbox-gl-styles": "^2.0.2",
"md-insert": "^1.0.1",
"mini-css-extract-plugin": "^2.4.4",
"mocha": "^10.0.0",
"nanoassert": "^2.0.0",
"ol": "^6.14.2-dev.1652464787949",
"puppeteer": "^15.3.0",
"remove-flow-types-loader": "^1.1.0",
"rollup": "^2.70.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-unassert": "^0.4.0",
"should": "^13.2.3",
"sinon": "^14.0.0",
"style-loader": "^3.3.1",
"typedoc": "0.22.18",
"typedoc-plugin-markdown": "^3.11.14",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "^4.6.0-beta",
"webpack": "^5.62.1",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.4.0"
}
}

1029
node_modules/ol-mapbox-style/src/apply.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

16
node_modules/ol-mapbox-style/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
export {
stylefunction,
recordStyleLayer,
renderTransparent,
} from './stylefunction.js';
export {
apply as default,
apply,
applyBackground,
applyStyle,
getFeatureState,
setFeatureState,
getLayer,
getLayers,
getSource,
} from './apply.js';

80
node_modules/ol-mapbox-style/src/mapbox.js generated vendored Normal file
View File

@@ -0,0 +1,80 @@
const mapboxBaseUrl = 'https://api.mapbox.com';
/**
* Gets the path from a mapbox:// URL.
* @param {string} url The Mapbox URL.
* @return {string} The path.
* @private
*/
export function getMapboxPath(url) {
const startsWith = 'mapbox://';
if (url.indexOf(startsWith) !== 0) {
return '';
}
return url.slice(startsWith.length);
}
/**
* Turns mapbox:// sprite URLs into resolvable URLs.
* @param {string} url The sprite URL.
* @param {string} token The access token.
* @param {string} styleUrl The style URL.
* @return {string} A resolvable URL.
* @private
*/
export function normalizeSpriteUrl(url, token, styleUrl) {
const mapboxPath = getMapboxPath(url);
if (!mapboxPath) {
return decodeURI(new URL(url, styleUrl).href);
}
const startsWith = 'sprites/';
if (mapboxPath.indexOf(startsWith) !== 0) {
throw new Error(`unexpected sprites url: ${url}`);
}
const sprite = mapboxPath.slice(startsWith.length);
return `${mapboxBaseUrl}/styles/v1/${sprite}/sprite?access_token=${token}`;
}
/**
* Turns mapbox:// style URLs into resolvable URLs.
* @param {string} url The style URL.
* @param {string} token The access token.
* @return {string} A resolvable URL.
* @private
*/
export function normalizeStyleUrl(url, token) {
const mapboxPath = getMapboxPath(url);
if (!mapboxPath) {
return decodeURI(new URL(url, location.href).href);
}
const startsWith = 'styles/';
if (mapboxPath.indexOf(startsWith) !== 0) {
throw new Error(`unexpected style url: ${url}`);
}
const style = mapboxPath.slice(startsWith.length);
return `${mapboxBaseUrl}/styles/v1/${style}?&access_token=${token}`;
}
/**
* Turns mapbox:// source URLs into vector tile URL templates.
* @param {string} url The source URL.
* @param {string} token The access token.
* @param {string} tokenParam The access token key.
* @param {string} styleUrl The style URL.
* @return {string} A vector tile template.
* @private
*/
export function normalizeSourceUrl(url, token, tokenParam, styleUrl) {
const urlObject = new URL(url, styleUrl);
const mapboxPath = getMapboxPath(url);
if (!mapboxPath) {
if (!token) {
return decodeURI(urlObject.href);
}
urlObject.searchParams.set(tokenParam, token);
return decodeURI(urlObject.href);
}
return `https://{a-d}.tiles.mapbox.com/v4/${mapboxPath}/{z}/{x}/{y}.vector.pbf?access_token=${token}`;
}

1406
node_modules/ol-mapbox-style/src/stylefunction.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

201
node_modules/ol-mapbox-style/src/text.js generated vendored Normal file
View File

@@ -0,0 +1,201 @@
import mb2css from 'mapbox-to-css-font';
import {checkedFonts, registerFont} from 'ol/render/canvas.js';
import {createCanvas} from './util.js';
const hairSpacePool = Array(256).join('\u200A');
export function applyLetterSpacing(text, letterSpacing) {
if (letterSpacing >= 0.05) {
let textWithLetterSpacing = '';
const lines = text.split('\n');
const joinSpaceString = hairSpacePool.slice(
0,
Math.round(letterSpacing / 0.1)
);
for (let l = 0, ll = lines.length; l < ll; ++l) {
if (l > 0) {
textWithLetterSpacing += '\n';
}
textWithLetterSpacing += lines[l].split('').join(joinSpaceString);
}
return textWithLetterSpacing;
}
return text;
}
let measureContext;
function getMeasureContext() {
if (!measureContext) {
measureContext = createCanvas(1, 1).getContext('2d');
}
return measureContext;
}
function measureText(text, letterSpacing) {
return (
getMeasureContext().measureText(text).width +
(text.length - 1) * letterSpacing
);
}
const measureCache = {};
export function wrapText(text, font, em, letterSpacing) {
if (text.indexOf('\n') !== -1) {
const hardLines = text.split('\n');
const lines = [];
for (let i = 0, ii = hardLines.length; i < ii; ++i) {
lines.push(wrapText(hardLines[i], font, em, letterSpacing));
}
return lines.join('\n');
}
const key = em + ',' + font + ',' + text + ',' + letterSpacing;
let wrappedText = measureCache[key];
if (!wrappedText) {
const words = text.split(' ');
if (words.length > 1) {
const ctx = getMeasureContext();
ctx.font = font;
const oneEm = ctx.measureText('M').width;
const maxWidth = oneEm * em;
let line = '';
const lines = [];
// Pass 1 - wrap lines to not exceed maxWidth
for (let i = 0, ii = words.length; i < ii; ++i) {
const word = words[i];
const testLine = line + (line ? ' ' : '') + word;
if (measureText(testLine, letterSpacing) <= maxWidth) {
line = testLine;
} else {
if (line) {
lines.push(line);
}
line = word;
}
}
if (line) {
lines.push(line);
}
// Pass 2 - add lines with a width of less than 30% of maxWidth to the previous or next line
for (let i = 0, ii = lines.length; i < ii && ii > 1; ++i) {
const line = lines[i];
if (measureText(line, letterSpacing) < maxWidth * 0.35) {
const prevWidth =
i > 0 ? measureText(lines[i - 1], letterSpacing) : Infinity;
const nextWidth =
i < ii - 1 ? measureText(lines[i + 1], letterSpacing) : Infinity;
lines.splice(i, 1);
ii -= 1;
if (prevWidth < nextWidth) {
lines[i - 1] += ' ' + line;
i -= 1;
} else {
lines[i] = line + ' ' + lines[i];
}
}
}
// Pass 3 - try to fill 80% of maxWidth for each line
for (let i = 0, ii = lines.length - 1; i < ii; ++i) {
const line = lines[i];
const next = lines[i + 1];
if (
measureText(line, letterSpacing) > maxWidth * 0.7 &&
measureText(next, letterSpacing) < maxWidth * 0.6
) {
const lineWords = line.split(' ');
const lastWord = lineWords.pop();
if (measureText(lastWord, letterSpacing) < maxWidth * 0.2) {
lines[i] = lineWords.join(' ');
lines[i + 1] = lastWord + ' ' + next;
}
ii -= 1;
}
}
wrappedText = lines.join('\n');
} else {
wrappedText = text;
}
wrappedText = applyLetterSpacing(wrappedText, letterSpacing);
measureCache[key] = wrappedText;
}
return wrappedText;
}
const fontFamilyRegEx = /font-family: ?([^;]*);/;
const stripQuotesRegEx = /("|')/g;
let loadedFontFamilies;
function hasFontFamily(family) {
if (!loadedFontFamilies) {
loadedFontFamilies = {};
const styleSheets = document.styleSheets;
for (let i = 0, ii = styleSheets.length; i < ii; ++i) {
const styleSheet = /** @type {CSSStyleSheet} */ (styleSheets[i]);
try {
const cssRules = styleSheet.rules || styleSheet.cssRules;
if (cssRules) {
for (let j = 0, jj = cssRules.length; j < jj; ++j) {
const cssRule = cssRules[j];
if (cssRule.type == 5) {
const match = cssRule.cssText.match(fontFamilyRegEx);
loadedFontFamilies[match[1].replace(stripQuotesRegEx, '')] = true;
}
}
}
} catch (e) {
// empty catch block
}
}
}
return family in loadedFontFamilies;
}
const processedFontFamilies = {};
/**
* @param {Array} fonts Fonts.
* @return {Array} Processed fonts.
* @private
*/
export function getFonts(fonts) {
const fontsKey = fonts.toString();
if (fontsKey in processedFontFamilies) {
return processedFontFamilies[fontsKey];
}
const googleFontDescriptions = [];
for (let i = 0, ii = fonts.length; i < ii; ++i) {
fonts[i] = fonts[i].replace('Arial Unicode MS', 'Arial');
const font = fonts[i];
const cssFont = mb2css(font, 1);
registerFont(cssFont);
const parts = cssFont.split(' ');
googleFontDescriptions.push([
parts.slice(3).join(' ').replace(/"/g, ''),
parts[1],
parts[0],
]);
}
for (let i = 0, ii = googleFontDescriptions.length; i < ii; ++i) {
const googleFontDescription = googleFontDescriptions[i];
const family = googleFontDescription[0];
if (!hasFontFamily(family)) {
if (
checkedFonts.get(
`${googleFontDescription[2]}\n${googleFontDescription[1]} \n${family}`
) !== 100
) {
const fontUrl =
'https://fonts.googleapis.com/css?family=' +
family.replace(/ /g, '+') +
':' +
googleFontDescription[1] +
googleFontDescription[2];
if (!document.querySelector('link[href="' + fontUrl + '"]')) {
const markup = document.createElement('link');
markup.href = fontUrl;
markup.rel = 'stylesheet';
document.head.appendChild(markup);
}
}
}
}
processedFontFamilies[fontsKey] = fonts;
return fonts;
}

180
node_modules/ol-mapbox-style/src/util.js generated vendored Normal file
View File

@@ -0,0 +1,180 @@
import {normalizeSourceUrl, normalizeStyleUrl} from './mapbox.js';
export function deg2rad(degrees) {
return (degrees * Math.PI) / 180;
}
export const defaultResolutions = (function () {
const resolutions = [];
for (let res = 78271.51696402048; resolutions.length <= 24; res /= 2) {
resolutions.push(res);
}
return resolutions;
})();
/**
* @param {number} width Width of the canvas.
* @param {number} height Height of the canvas.
* @return {HTMLCanvasElement} Canvas.
*/
export function createCanvas(width, height) {
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && typeof OffscreenCanvas !== 'undefined') { // eslint-disable-line
return /** @type {?} */ (new OffscreenCanvas(width, height));
} else {
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
return canvas;
}
}
export function getZoomForResolution(resolution, resolutions) {
let i = 0;
const ii = resolutions.length;
for (; i < ii; ++i) {
const candidate = resolutions[i];
if (candidate < resolution && i + 1 < ii) {
const zoomFactor = resolutions[i] / resolutions[i + 1];
return i + Math.log(resolutions[i] / resolution) / Math.log(zoomFactor);
}
}
return ii - 1;
}
const pendingRequests = {};
/**
* @param {ResourceType} resourceType Type of resource to load.
* @param {string} url Url of the resource.
* @param {Options} [options={}] Options.
* @return {Promise<Object|Response>} Promise that resolves with the loaded resource
* or rejects with the Response object.
* @private
*/
export function fetchResource(resourceType, url, options = {}) {
if (url in pendingRequests) {
return pendingRequests[url];
} else {
const request = options.transformRequest
? options.transformRequest(url, resourceType) || new Request(url)
: new Request(url);
if (!request.headers.get('Accept')) {
request.headers.set('Accept', 'application/json');
}
const pendingRequest = fetch(request)
.then(function (response) {
delete pendingRequests[url];
return response.ok
? response.json()
: Promise.reject(new Error('Error fetching source ' + url));
})
.catch(function (error) {
delete pendingRequests[url];
return Promise.reject(new Error('Error fetching source ' + url));
});
pendingRequests[url] = pendingRequest;
return pendingRequest;
}
}
export function getGlStyle(glStyleOrUrl, options) {
if (typeof glStyleOrUrl === 'string') {
if (glStyleOrUrl.trim().startsWith('{')) {
try {
const glStyle = JSON.parse(glStyleOrUrl);
return Promise.resolve(glStyle);
} catch (error) {
return Promise.reject(error);
}
} else {
glStyleOrUrl = normalizeStyleUrl(glStyleOrUrl, options.accessToken);
return fetchResource('Style', glStyleOrUrl, options);
}
} else {
return Promise.resolve(glStyleOrUrl);
}
}
const tilejsonCache = {};
/**
* @param {Object} glSource glStyle source object.
* @param {string} styleUrl Style URL.
* @param {Options} options Options.
* @return {Object} TileJson
*/
export function getTileJson(glSource, styleUrl, options = {}) {
const cacheKey = [styleUrl, JSON.stringify(glSource)].toString();
let promise = tilejsonCache[cacheKey];
if (!promise || options.transformRequest) {
const url = glSource.url;
if (url && !glSource.tiles) {
let normalizedSourceUrl = normalizeSourceUrl(
url,
options.accessToken,
options.accessTokenParam || 'access_token',
styleUrl || location.href
);
if (url.startsWith('mapbox://')) {
promise = Promise.resolve(
Object.assign({}, glSource, {
url: undefined,
tiles: normalizedSourceUrl,
})
);
} else {
promise = fetchResource('Source', normalizedSourceUrl, options).then(
function (tileJson) {
for (let i = 0, ii = tileJson.tiles.length; i < ii; ++i) {
const tileUrl = tileJson.tiles[i];
if (options.transformRequest) {
const request = options.transformRequest(
normalizedSourceUrl,
'Source'
);
if (request) {
normalizedSourceUrl = request.url;
}
}
let normalizedTileUrl = normalizeSourceUrl(
tileUrl,
options.accessToken,
options.accessTokenParam || 'access_token',
normalizedSourceUrl
);
if (options.transformRequest) {
const transformedRequest = options.transformRequest(
normalizedTileUrl,
'Tiles'
);
if (transformedRequest instanceof Request) {
normalizedTileUrl = decodeURI(transformedRequest.url);
}
}
tileJson.tiles[i] = normalizedTileUrl;
}
return Promise.resolve(tileJson);
}
);
}
} else {
glSource = Object.assign({}, glSource, {
tiles: glSource.tiles.map(function (tileUrl) {
return normalizeSourceUrl(
tileUrl,
options.accessToken,
options.accessTokenParam || 'access_token',
styleUrl || location.href
);
}),
});
promise = Promise.resolve(Object.assign({}, glSource));
}
tilejsonCache[cacheKey] = promise;
}
return promise;
}
/**
* @typedef {import("./apply.js").Options} Options
* @typedef {import('./apply.js').ResourceType} ResourceType
* @private
*/