ol-mapbox-style
Advanced tools
Comparing version 10.3.2 to 10.3.3
@@ -5,2 +5,6 @@ # Changelog | ||
## 10.3.3 | ||
* Fix `updateMapboxLayers()` and function/filter cache handling | ||
## 10.3.2 | ||
@@ -7,0 +11,0 @@ |
@@ -6,2 +6,3 @@ /** | ||
export function getFunctionCache(glStyle: any): any; | ||
export function clearFunctionCache(): void; | ||
/** | ||
@@ -8,0 +9,0 @@ * @param {Object} glStyle Mapboox style object. |
{ | ||
"name": "ol-mapbox-style", | ||
"version": "10.3.2", | ||
"version": "10.3.3", | ||
"description": "Create OpenLayers maps from Mapbox Style objects", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -23,2 +23,3 @@ /* | ||
import { | ||
clearFunctionCache, | ||
createCanvas, | ||
@@ -205,3 +206,6 @@ defaultResolutions, | ||
export function renderTransparent(enabled) { | ||
renderTransparentEnabled = enabled; | ||
if (enabled !== renderTransparentEnabled) { | ||
clearFunctionCache(); | ||
renderTransparentEnabled = enabled; | ||
} | ||
} | ||
@@ -208,0 +212,0 @@ |
@@ -16,7 +16,16 @@ import {expandUrl} from 'ol/tileurlfunction.js'; | ||
} | ||
const functionCache = {}; | ||
functionCacheByStyleId[glStyle.id] = functionCache; | ||
let functionCache = functionCacheByStyleId[glStyle.id]; | ||
if (!functionCache) { | ||
functionCache = {}; | ||
functionCacheByStyleId[glStyle.id] = functionCache; | ||
} | ||
return functionCache; | ||
} | ||
export function clearFunctionCache() { | ||
for (const key in functionCacheByStyleId) { | ||
delete functionCacheByStyleId[key]; | ||
} | ||
} | ||
/** | ||
@@ -30,4 +39,7 @@ * @param {Object} glStyle Mapboox style object. | ||
} | ||
const filterCache = {}; | ||
filterCacheByStyleId[glStyle.id] = filterCache; | ||
let filterCache = filterCacheByStyleId[glStyle.id]; | ||
if (!filterCache) { | ||
filterCache = {}; | ||
filterCacheByStyleId[glStyle.id] = filterCache; | ||
} | ||
return filterCache; | ||
@@ -34,0 +46,0 @@ } |
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
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
6480149
21642