ol-mapbox-style
Advanced tools
Comparing version 8.0.7 to 8.0.8
# Changelog | ||
## 8.0.8 | ||
* Fix relative source url handling for GeoJSON sources | ||
* Fix website examples | ||
## 8.0.7 | ||
@@ -4,0 +9,0 @@ |
@@ -199,3 +199,3 @@ /** | ||
* URL of the Mapbox GL style. Required for styles that were provided | ||
* as object, when they contain a relative sprite url. | ||
* as object, when they contain a relative sprite url, or sources referencing data by relative url. | ||
*/ | ||
@@ -202,0 +202,0 @@ styleUrl?: string | undefined; |
@@ -10,3 +10,3 @@ { | ||
"type": "geojson", | ||
"data": "/data/states.geojson" | ||
"data": "./states.geojson" | ||
} | ||
@@ -13,0 +13,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
"use strict";(self.webpackChunkol_mapbox_style=self.webpackChunkol_mapbox_style||[]).push([[874],{8516:(e,t,l)=>{l(9789);var n=l(5955);fetch("data/geojson.json").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,n.ZP)("map",e)})).then((function(e){var t=null;e.on("pointermove",(function(l){var s=e.getFeaturesAtPixel(l.pixel);s.length>0?(null!==t&&(0,n.LN)(e,{source:"states",id:t},null),t=s[0].getId(),(0,n.LN)(e,{source:"states",id:t},{hover:!0})):null!==t&&((0,n.LN)(e,{source:"states",id:t},null),t=null)}))}))}},e=>{e(e.s=8516)}]); | ||
"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 |
{ | ||
"name": "ol-mapbox-style", | ||
"version": "8.0.7", | ||
"version": "8.0.8", | ||
"description": "Create OpenLayers maps from Mapbox Style objects", | ||
@@ -45,3 +45,3 @@ "type": "module", | ||
"@rollup/plugin-buble": "^0.21.3", | ||
"@rollup/plugin-commonjs": "^21.1.0", | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
@@ -81,5 +81,5 @@ "@types/arcgis-rest-api": "^10.4.4", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-unassert": "^0.3.0", | ||
"rollup-plugin-unassert": "^0.4.0", | ||
"should": "^13.2.3", | ||
"sinon": "^13.0.0", | ||
"sinon": "^14.0.0", | ||
"style-loader": "^3.3.1", | ||
@@ -86,0 +86,0 @@ "typedoc": "^0.22.14", |
@@ -558,3 +558,3 @@ # ol-mapbox-style | ||
URL of the Mapbox GL style. Required for styles that were provided | ||
as object, when they contain a relative sprite url. | ||
as object, when they contain a relative sprite url, or sources referencing data by relative url. | ||
@@ -561,0 +561,0 @@ ___ |
@@ -58,3 +58,3 @@ /* | ||
* @property {string} [styleUrl] URL of the Mapbox GL style. Required for styles that were provided | ||
* as object, when they contain a relative sprite url. | ||
* as object, when they contain a relative sprite url, or sources referencing data by relative url. | ||
* @property {string} [accessTokenParam='access_token'] Access token param. For internal use. | ||
@@ -804,3 +804,10 @@ */ | ||
promise = new Promise(function (resolve, reject) { | ||
processStyle(style, map, '', options) | ||
processStyle( | ||
style, | ||
map, | ||
!options.styleUrl || options.styleUrl.startsWith('data:') | ||
? location.href | ||
: normalizeStyleUrl(options.styleUrl, options.accessToken), | ||
options | ||
) | ||
.then(function () { | ||
@@ -807,0 +814,0 @@ resolve(map); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6253501
18246