@globalfishingwatch/layer-composer
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -1,2 +0,2 @@ | ||
import"../_tslib-c4bf2322.js";export{D as DEFAULT_BASEMAP_COLOR,a as HEATMAP_COLOR_RAMPS,H as HEATMAP_GEOM_TYPES,G as default}from"../index-69bb74db.js";import"../types/index.js"; | ||
import"../_tslib-c4bf2322.js";export{D as DEFAULT_BASEMAP_COLOR,a as HEATMAP_COLOR_RAMPS,H as HEATMAP_GEOM_TYPES,G as default}from"../index-f639cb33.js";import"../types/index.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -14,5 +14,5 @@ import { FeatureCollection } from 'geojson'; | ||
_getStyleLayers: (config: TrackGeneratorConfig & GlobalGeneratorConfig) => { | ||
type: string; | ||
id: string; | ||
source: string; | ||
type: string; | ||
layout: {}; | ||
@@ -35,5 +35,5 @@ paint: { | ||
layers: { | ||
type: string; | ||
id: string; | ||
source: string; | ||
type: string; | ||
layout: {}; | ||
@@ -40,0 +40,0 @@ paint: { |
@@ -5,3 +5,3 @@ import { FeatureCollection } from 'geojson'; | ||
type: Type; | ||
_setActiveEvent: (data: FeatureCollection, currentEventId: string) => FeatureCollection; | ||
_setActiveEvent: (data: FeatureCollection, currentEventId: string | null) => FeatureCollection; | ||
_getStyleSources: (config: VesselEventsGeneratorConfig & GlobalGeneratorConfig) => { | ||
@@ -8,0 +8,0 @@ type: "geojson"; |
@@ -1,2 +0,2 @@ | ||
import{_ as e,a as r}from"./_tslib-c4bf2322.js";import{f as o,l as n,G as i}from"./index-69bb74db.js";export{t as Generators}from"./index-69bb74db.js";import"./types/index.js";export{c as convertLegacyGroups,s as sort}from"./sort-219c5279.js";var a={version:8,glyphs:"https://raw.githubusercontent.com/GlobalFishingWatch/map-gl-glyphs/master/_output/{fontstack}/{range}.pbf?raw=true",sprite:"https://raw.githubusercontent.com/GlobalFishingWatch/map-gl-sprites/master/out/sprites"},l=function(){function t(t){var s=this;this._getGeneratorSources=function(e){return Object.fromEntries(e.filter((function(e){return e.sources&&e.sources.length})).map((function(e){return[e.id,e.sources]})))},this._getGeneratorLayers=function(e){return Object.fromEntries(e.filter((function(e){return e.layers&&e.layers.length})).map((function(e){return[e.id,e.layers]})))},this._applyGenericStyle=function(t,r){var s=e({},r);return s.layers=s.layers.map((function(r){var s=e({},r);if(s.layout||(s.layout={}),s.paint||(s.paint={}),void 0!==t.visible&&null!==t.visible&&(s.layout.visibility=!0===t.visible?"visible":"none"),void 0!==t.opacity&&null!==t.opacity&&"symbol"!==s.type){var o=s.type+"-opacity",n=s.paint[o]||1;s.paint[o]=n*t.opacity}return s})),s},this._getGlobalConfig=function(t){if(!t)return{};var r=e({},t);return r.zoom&&(r.zoomLoadLevel=Math.floor(r.zoom)),r},this._getGeneratorStyles=function(t,r){if(!s.generators[t.type])throw new Error("There is no generator loaded for the config: "+t.type+"}");var o=e(e({},s._getGlobalConfig(r)),t),n=s.generators[o.type];return s._applyGenericStyle(o,n.getStyle(o))},this.getGLStyle=function(e,t){if(!e)return console.warn("No layers passed to layer manager"),{style:s._getStyleJson()};var o=[],n=e.map((function(e){var n=s._getGeneratorStyles(e,t),i=n.promise,a=n.promises,l=r(n,["promise","promises"]),u=[];return i?u=[i]:a&&(u=a),o=o.concat(u),l})),i=s._getGeneratorSources(n),a=s._getGeneratorLayers(n);s.latestGenerated={sourcesStyle:i,layersStyle:a};var l=o.map((function(e){return e.then((function(e){var t=e.id,r=e.sources,o=e.layers,n=s.latestGenerated,i=n.sourcesStyle,a=n.layersStyle;return i[t]=r,a[t]=o,{style:s._getStyleJson(i,a),layer:e}})).catch((function(e){return console.warn(e),{style:s._getStyleJson(i,a)}}))}));return{style:s._getStyleJson(i,a),promises:l}},this.version=t&&t.version||a.version,this.glyphs=t&&t.glyphs||a.glyphs,this.sprite=t&&t.sprite||a.sprite,this.generators=t&&t.generators||i,this.latestGenerated={sourcesStyle:{},layersStyle:{}}}return t.prototype._getStyleJson=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),{version:this.version,glyphs:this.glyphs,sprite:this.sprite,sources:o(e),layers:n(t)}},t}();export default l;export{a as DEFAULT_CONFIG}; | ||
import{_ as e,a as r}from"./_tslib-c4bf2322.js";import{f as o,l as n,G as i}from"./index-f639cb33.js";export{t as Generators}from"./index-f639cb33.js";import"./types/index.js";export{c as convertLegacyGroups,s as sort}from"./sort-219c5279.js";var a={version:8,glyphs:"https://raw.githubusercontent.com/GlobalFishingWatch/map-gl-glyphs/master/_output/{fontstack}/{range}.pbf?raw=true",sprite:"https://raw.githubusercontent.com/GlobalFishingWatch/map-gl-sprites/master/out/sprites"},l=function(){function t(t){var s=this;this._getGeneratorSources=function(e){return Object.fromEntries(e.filter((function(e){return e.sources&&e.sources.length})).map((function(e){return[e.id,e.sources]})))},this._getGeneratorLayers=function(e){return Object.fromEntries(e.filter((function(e){return e.layers&&e.layers.length})).map((function(e){return[e.id,e.layers]})))},this._applyGenericStyle=function(t,r){var s=e({},r);return s.layers=s.layers.map((function(r){var s=e({},r);if(s.layout||(s.layout={}),s.paint||(s.paint={}),void 0!==t.visible&&null!==t.visible&&(s.layout.visibility=!0===t.visible?"visible":"none"),void 0!==t.opacity&&null!==t.opacity&&"symbol"!==s.type){var o=s.type+"-opacity",n=s.paint[o]||1;s.paint[o]=n*t.opacity}return s})),s},this._getGlobalConfig=function(t){if(!t)return{};var r=e({},t);return r.zoom&&(r.zoomLoadLevel=Math.floor(r.zoom)),r},this._getGeneratorStyles=function(t,r){if(!s.generators[t.type])throw new Error("There is no generator loaded for the config: "+t.type+"}");var o=e(e({},s._getGlobalConfig(r)),t),n=s.generators[o.type];return s._applyGenericStyle(o,n.getStyle(o))},this.getGLStyle=function(e,t){if(!e)return console.warn("No layers passed to layer manager"),{style:s._getStyleJson()};var o=[],n=e.map((function(e){var n=s._getGeneratorStyles(e,t),i=n.promise,a=n.promises,l=r(n,["promise","promises"]),u=[];return i?u=[i]:a&&(u=a),o=o.concat(u),l})),i=s._getGeneratorSources(n),a=s._getGeneratorLayers(n);s.latestGenerated={sourcesStyle:i,layersStyle:a};var l=o.map((function(e){return e.then((function(e){var t=e.id,r=e.sources,o=e.layers,n=s.latestGenerated,i=n.sourcesStyle,a=n.layersStyle;return i[t]=r,a[t]=o,{style:s._getStyleJson(i,a),layer:e}})).catch((function(e){return console.warn(e),{style:s._getStyleJson(i,a)}}))}));return{style:s._getStyleJson(i,a),promises:l}},this.version=t&&t.version||a.version,this.glyphs=t&&t.glyphs||a.glyphs,this.sprite=t&&t.sprite||a.sprite,this.generators=t&&t.generators||i,this.latestGenerated={sourcesStyle:{},layersStyle:{}}}return t.prototype._getStyleJson=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),{version:this.version,glyphs:this.glyphs,sprite:this.sprite,sources:o(e),layers:n(t)}},t}();export default l;export{a as DEFAULT_CONFIG}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@globalfishingwatch/layer-composer", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "", | ||
@@ -27,3 +27,3 @@ "author": "satellitestudio <contact@satellitestud.io>", | ||
"prepublishOnly": "yarn build", | ||
"json-schema": "typescript-json-schema tsconfig.json-schema.json \"*\" > dist/json-schema.json" | ||
"json-schema": "mkdirp dist && typescript-json-schema tsconfig.json-schema.json \"*\" > dist/json-schema.json" | ||
}, | ||
@@ -49,5 +49,6 @@ "bugs": { | ||
"@types/d3": "^5.7.2", | ||
"@types/geojson": "^7946.0.7" | ||
"@types/geojson": "^7946.0.7", | ||
"mkdirp": "^1.0.4" | ||
}, | ||
"gitHead": "e401a97d85e852a21903684dfea4d868c9f1b9a4" | ||
} |
Sorry, the diff of this file is not supported yet
1365638
3