Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

ol-mapbox-style

Package Overview
Dependencies
Maintainers
4
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ol-mapbox-style - npm Package Versions

13
17

12.1.0

Diff

Changelog

Source

12.1.0

  • New 'updateMapboxSource()' utility function.
  • Accept Promise as return type for transformRequest()
  • Do not overwrite existing search param with access token
ahocevar
published 12.0.0 •

Changelog

Source

12.0.0

Backwards incompatible changes

  • The transformRequest hook is now called for every single Tiles request with the final url, instead of just once with the url template.
  • Generated OpenLayers Tile and VectorTile sources previously used the template urls obtained by source.getUrl() or source.getUrls(). Now they use a tileLoadFunction configured by ol-mapbox-style instead.
  • Generated OpenLayers Vector sources are now always configured with a loader by ol-mapbox-style. The getUrl() method will return the url without the transformRequest transform. When the url is templated ({bbox-...}), getUrl() will return undefined.

Other changes

  • The transformRequest hook now also accepts a url string as return value. When a Request is returned, it will be fully respected - not just the request's url.
ahocevar
published 11.0.3 •

Changelog

Source

11.0.3

  • More ol versions included in peer dependency version range
ahocevar
published 11.0.2 •

Changelog

Source

11.0.2

  • Make ol a peer dependency
ahocevar
published 11.0.1 •

Changelog

Source

11.0.1

  • Use ol >= 7.x || v8.0.0-dev to allow deduping
ahocevar
published 11.0.0 •

Changelog

Source

11.0.0

Backwards incompatible changes

  • The ol-mapbox-style package now contains untranspiled modern JavaScript code. When targeting older browsers, make sure to configure your build tools to transpile the code accordingly.

Other changes

  • New MapboxVectorLayer export, which replaces ol/layer/MapboxVector from OpenLayers.
ahocevar
published 10.7.0 •

Changelog

Source

10.7.0

  • Small fixes for add/update/removeMapboxLayer
  • Support for SDF sprites
  • Improved documentation for applyStyle
ahocevar
published 10.6.0 •

Changelog

Source

10.6.0

  • addMapboxLayer() can now also add a layer as first layer in the layer stack.
  • addMapboxLayer() is no longer restricted go layers with the same source.
ahocevar
published 10.5.0 •

Changelog

Source

10.5.0

  • Add terrarium hillshade example
  • Add getStyleForLayer() function for more efficient legend creation without recordStyleLayer(true)
ahocevar
published 10.4.0 •

Changelog

Source

10.4.0

Changes that require attention

Font handling and loading

ol-mapbox-style no longer defaults to loading Google fonts when a required font is not available. Instead, it respects the new metadata.ol:webfonts field in the Mapbox Style document. Example:

{
  "version": 8,
  "metadata": {
    "ol:webfonts": "https://mytileservergl.com/fonts/{font-family}/{fontweight}{-fontstyle}.css"
  }
  // ...
}

The supported template placeholders are

  • {font-family}: CSS font family converted to lowercase, blanks replaced with -, e.g. noto-sans
  • {Font+Family}: CSS font family in original case, blanks replaced with +, e.g. Noto+Sans
  • {fontweight}: CSS font weight (numeric), e.g. 400, 700
  • {fontstyle}: CSS font style, e.g. normal, italic
  • {-fontstyle}: CSS font style other than normal, e.g. -italic or empty string for normal

In addition to providing fonts along with the style, this can be used to retrieve fonts from a CDN (e.g. @fontsource) or Google fonts. If this metadata field is not set to the style, the following default template will be used:

https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css

To retain the current behavior (i.e. use Google Fonts), the template URL will have to be

https://fonts.googleapis.com/css?family={Font+Family}:{fontweight}{fontstyle}

Other changes

  • Fix a potential tile cache issue
  • Fix problem caused by getUid function missing in the full build
  • Make updateMapboxStyle() work with objects that are not a reference to the original one
  • Add support for the tms tile scheme for raster and vector layers
  • Add support for the terrarium encoding for raster-dem sources
  • Fix an issue where the icon-offset layout property modifies the underlying Mapbox Style object
  • Set the correct input projection for geojson sources when the projection option is used
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc