kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
559 lines (553 loc) • 89.5 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.MAX_CACHE_SIZE_MOBILE = exports.DEFAULT_STROKE_WIDTH = exports.DEFAULT_HIGHLIGHT_STROKE_COLOR = exports.DEFAULT_HIGHLIGHT_FILL_COLOR = void 0;
exports.tileLayerBoundsLayer = tileLayerBoundsLayer;
exports.vectorTileVisConfigs = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _typed = require("@deck.gl/layers/typed");
var _mvt = require("@loaders.gl/mvt");
var _pmtiles = require("@loaders.gl/pmtiles");
var _constants = _interopRequireDefault(require("@luma.gl/constants"));
var _commonUtils = require("@kepler.gl/common-utils");
var _constants2 = require("@kepler.gl/constants");
var _table = require("@kepler.gl/table");
var _mvtLayer = require("./mvt-layer");
var _vectorTileIcon = _interopRequireDefault(require("./vector-tile-icon"));
var _baseLayer = _interopRequireDefault(require("../base-layer"));
var _abstractTileLayer = _interopRequireWildcard(require("./abstract-tile-layer"));
var _tileDataset = _interopRequireDefault(require("./common-tile/tile-dataset"));
var _tileUtils = require("./common-tile/tile-utils");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _superPropGet(t, e, r, o) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
var DEFAULT_HIGHLIGHT_FILL_COLOR = exports.DEFAULT_HIGHLIGHT_FILL_COLOR = [252, 242, 26, 150];
var DEFAULT_HIGHLIGHT_STROKE_COLOR = exports.DEFAULT_HIGHLIGHT_STROKE_COLOR = [252, 242, 26, 255];
var MAX_CACHE_SIZE_MOBILE = exports.MAX_CACHE_SIZE_MOBILE = 1; // Minimize caching, visible tiles will always be loaded
var DEFAULT_STROKE_WIDTH = exports.DEFAULT_STROKE_WIDTH = 1;
/**
* Type for transformRequest returned parameters.
*/
// This type *seems* to be what loaders.gl currently returns for tile content.
// Apparently this might be different depending on the loaders version, and for...
// reasons we use two different versions of loaders right now.
// TODO: The Features[] version should not be needed when we update to a newer
// version of Deck.gl and use only one version of loaders
var vectorTileVisConfigs = exports.vectorTileVisConfigs = _objectSpread(_objectSpread({}, _abstractTileLayer.commonTileVisConfigs), {}, {
stroked: _objectSpread(_objectSpread({}, _constants2.LAYER_VIS_CONFIGS.stroked), {}, {
defaultValue: false
}),
// TODO figure out why strokeColorScale can't be const
strokeColorScale: 'strokeColorScale',
strokeColorRange: 'strokeColorRange',
sizeRange: 'strokeWidthRange',
strokeWidth: _objectSpread(_objectSpread({}, _constants2.LAYER_VIS_CONFIGS.thickness), {}, {
property: 'strokeWidth',
defaultValue: 0.5,
allowCustomValue: false
}),
radiusScale: 'radiusScale',
radiusRange: _objectSpread(_objectSpread({}, _constants2.LAYER_VIS_CONFIGS.radiusRange), {}, {
type: 'number',
defaultValue: [0, 1],
isRanged: true,
range: [0, 1],
step: 0.01
})
});
function tileLayerBoundsLayer(id, props) {
var bounds = props.bounds;
if ((bounds === null || bounds === void 0 ? void 0 : bounds.length) !== 4) return [];
var data = [{
path: [[bounds[0], bounds[1]], [bounds[2], bounds[1]], [bounds[2], bounds[3]], [bounds[0], bounds[3]], [bounds[0], bounds[1]]]
}];
var layer = new _typed.PathLayer({
id: "".concat(id, "-vector-tile-bounds"),
data: data,
getPath: function getPath(d) {
return d.path;
},
getColor: [128, 128, 128, 255],
getWidth: 1,
widthUnits: 'pixels',
pickable: false
});
return [layer];
}
var VectorTileLayer = exports["default"] = /*#__PURE__*/function (_AbstractTileLayer) {
function VectorTileLayer(props) {
var _this;
(0, _classCallCheck2["default"])(this, VectorTileLayer);
_this = _callSuper(this, VectorTileLayer, [props]);
(0, _defineProperty2["default"])(_this, "meta", {});
_this.registerVisConfig(vectorTileVisConfigs);
_this.tileDataset = _this.initTileDataset();
return _this;
}
(0, _inherits2["default"])(VectorTileLayer, _AbstractTileLayer);
return (0, _createClass2["default"])(VectorTileLayer, [{
key: "initTileDataset",
value: function initTileDataset() {
return new _tileDataset["default"]({
getTileId: function getTileId(tile) {
return tile.id;
},
getIterable: function getIterable(tile) {
if (tile.content) {
return tile.content.shape === 'geojson-table' ? tile.content.features : tile.content;
}
return [];
},
getRowCount: function getRowCount(features) {
return features.length;
},
getRowValue: this.accessRowValue
});
}
}, {
key: "type",
get: function get() {
return _constants2.LAYER_TYPES.vectorTile;
}
}, {
key: "name",
get: function get() {
return 'Vector Tile';
}
}, {
key: "layerIcon",
get: function get() {
return _vectorTileIcon["default"];
}
}, {
key: "supportedDatasetTypes",
get: function get() {
return [_constants2.DatasetType.VECTOR_TILE];
}
}, {
key: "visualChannels",
get: function get() {
var visualChannels = _superPropGet(VectorTileLayer, "visualChannels", this, 1);
return _objectSpread(_objectSpread({}, visualChannels), {}, {
strokeColor: {
property: 'strokeColor',
field: 'strokeColorField',
scale: 'strokeColorScale',
domain: 'strokeColorDomain',
range: 'strokeColorRange',
key: 'strokeColor',
channelScaleType: _constants2.CHANNEL_SCALES.color,
accessor: 'getLineColor',
condition: function condition(config) {
return config.visConfig.stroked;
},
nullValue: visualChannels.color.nullValue,
getAttributeValue: function getAttributeValue(config) {
return config.visConfig.strokeColor || config.color;
}
},
size: {
property: 'stroke',
field: 'sizeField',
scale: 'sizeScale',
domain: 'sizeDomain',
range: 'sizeRange',
key: 'size',
channelScaleType: _constants2.CHANNEL_SCALES.size,
nullValue: 0,
accessor: 'getLineWidth',
condition: function condition(config) {
return config.visConfig.stroked;
},
getAttributeValue: function getAttributeValue(config) {
return config.visConfig.strokeWidth || DEFAULT_STROKE_WIDTH;
}
},
radius: {
property: 'radius',
field: 'radiusField',
scale: 'radiusScale',
domain: 'radiusDomain',
range: 'radiusRange',
key: 'radius',
channelScaleType: _constants2.CHANNEL_SCALES.size,
nullValue: 0,
getAttributeValue: function getAttributeValue(config) {
return config.visConfig.radius || config.radius;
},
accessor: 'getPointRadius',
defaultValue: function defaultValue(config) {
return config.radius;
}
}
});
}
}, {
key: "getDefaultLayerConfig",
value: function getDefaultLayerConfig(props) {
var defaultLayerConfig = _superPropGet(VectorTileLayer, "getDefaultLayerConfig", this, 3)([props]);
return _objectSpread(_objectSpread({}, defaultLayerConfig), {}, {
colorScale: _constants2.SCALE_TYPES.quantize,
strokeColorField: null,
strokeColorDomain: [0, 1],
strokeColorScale: _constants2.SCALE_TYPES.quantile,
colorUI: _objectSpread(_objectSpread({}, defaultLayerConfig.colorUI), {}, {
// @ts-expect-error LayerConfig
strokeColorRange: _constants2.DEFAULT_COLOR_UI
}),
radiusField: null,
radiusDomain: [0, 1],
radiusScale: _constants2.SCALE_TYPES.linear
});
}
}, {
key: "getHoverData",
value: function getHoverData(object, dataContainer, fields) {
return fields.map(function (f) {
var _object$properties$f$, _object$properties;
return (_object$properties$f$ = (_object$properties = object.properties) === null || _object$properties === void 0 ? void 0 : _object$properties[f.name]) !== null && _object$properties$f$ !== void 0 ? _object$properties$f$ : null;
});
}
}, {
key: "calculateLayerDomain",
value: function calculateLayerDomain(dataset, visualChannel) {
var _field$filterProps, _field$filterProps2, _field$filterProps3;
var defaultDomain = [0, 1];
var field = this.config[visualChannel.field];
var scale = this.config[visualChannel.scale];
if (!field) {
// if colorField or sizeField were set back to null
return defaultDomain;
}
if (scale === _constants2.SCALE_TYPES.quantile && (0, _tileUtils.isDomainQuantiles)(field === null || field === void 0 || (_field$filterProps = field.filterProps) === null || _field$filterProps === void 0 ? void 0 : _field$filterProps.domainQuantiles)) {
return field.filterProps.domainQuantiles;
}
if ((0, _tileUtils.isDomainStops)(field === null || field === void 0 || (_field$filterProps2 = field.filterProps) === null || _field$filterProps2 === void 0 ? void 0 : _field$filterProps2.domainStops)) {
return field.filterProps.domainStops;
} else if (Array.isArray(field === null || field === void 0 || (_field$filterProps3 = field.filterProps) === null || _field$filterProps3 === void 0 ? void 0 : _field$filterProps3.domain)) {
return field.filterProps.domain;
}
return defaultDomain;
}
}, {
key: "getScaleOptions",
value: function getScaleOptions(channelKey) {
var _field$filterProps4;
var options = _baseLayer["default"].prototype.getScaleOptions.call(this, channelKey);
var channel = this.visualChannels.strokeColor;
var field = this.config[channel.field];
if (!((0, _tileUtils.isDomainQuantiles)(field === null || field === void 0 || (_field$filterProps4 = field.filterProps) === null || _field$filterProps4 === void 0 ? void 0 : _field$filterProps4.domainQuantiles) || this.config.visConfig.dynamicColor ||
// If we've set the scale to quantile, we need to include it - there's a loading
// period in which the visConfig isn't set yet, but if we don't return the right
// scale type we lose it
this.config.colorScale === _constants2.SCALE_TYPES.quantile)) {
options = options.filter(function (scale) {
return scale !== _constants2.SCALE_TYPES.quantile;
});
}
return options;
}
}, {
key: "accessRowValue",
value: function accessRowValue(field, indexKey) {
// if is indexed field
if ((0, _tileUtils.isIndexedField)(field) && indexKey !== null) {
var _field$indexBy;
var fieldName = indexKey && (field === null || field === void 0 || (_field$indexBy = field.indexBy) === null || _field$indexBy === void 0 ? void 0 : _field$indexBy.mappedValue[indexKey]);
if (fieldName) {
return function (f, datum) {
if (datum.properties) {
return datum.properties[fieldName];
}
// TODO debug this with indexed tiled dataset
return datum[fieldName];
};
}
}
// default
return function (f, datum) {
if (f && datum.properties) {
return datum.properties[f.name];
}
// support picking & highlighting
return f ? datum[f.fieldIdx] : null;
};
}
}, {
key: "updateLayerMeta",
value: function updateLayerMeta(dataset, datasets) {
if (dataset.type !== _constants2.DatasetType.VECTOR_TILE) {
return;
}
var datasetMeta = dataset.metadata;
this.updateMeta({
datasetId: dataset.id,
datasets: datasets,
bounds: datasetMeta.bounds
});
}
}, {
key: "formatLayerData",
value: function formatLayerData(datasets, oldLayerData, animationConfig) {
var dataId = this.config.dataId;
if (!(0, _commonUtils.notNullorUndefined)(dataId)) {
return {
tileSource: null
};
}
var dataset = datasets[dataId];
var tilesetDataUrl;
var tileSource = null;
if ((dataset === null || dataset === void 0 ? void 0 : dataset.type) === _constants2.DatasetType.VECTOR_TILE) {
var datasetMetadata = dataset.metadata;
var remoteTileFormat = datasetMetadata === null || datasetMetadata === void 0 ? void 0 : datasetMetadata.remoteTileFormat;
if (remoteTileFormat === _constants2.RemoteTileFormat.MVT) {
var _datasetMetadata$tile;
var transformFetch = /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(input, init) {
var requestData;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
requestData = {
url: input,
searchParams: new URLSearchParams(),
options: init !== null && init !== void 0 ? init : {}
};
return _context.abrupt("return", fetch(requestData.url, requestData.options));
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function transformFetch(_x, _x2) {
return _ref.apply(this, arguments);
};
}();
tilesetDataUrl = datasetMetadata === null || datasetMetadata === void 0 ? void 0 : datasetMetadata.tilesetDataUrl;
tileSource = tilesetDataUrl ? _mvt.MVTSource.createDataSource(decodeURIComponent(tilesetDataUrl), {
mvt: {
metadataUrl: (_datasetMetadata$tile = datasetMetadata === null || datasetMetadata === void 0 ? void 0 : datasetMetadata.tilesetMetadataUrl) !== null && _datasetMetadata$tile !== void 0 ? _datasetMetadata$tile : null,
loadOptions: {
fetch: transformFetch
}
}
}) : null;
} else if (remoteTileFormat === _constants2.RemoteTileFormat.PMTILES) {
// TODO: to render image pmtiles need to use TileLayer and BitmapLayer (https://github.com/visgl/loaders.gl/blob/master/examples/website/tiles/components/tile-source-layer.ts)
tilesetDataUrl = datasetMetadata === null || datasetMetadata === void 0 ? void 0 : datasetMetadata.tilesetDataUrl;
tileSource = tilesetDataUrl ? _pmtiles.PMTilesSource.createDataSource(tilesetDataUrl, {}) : null;
}
}
return _objectSpread(_objectSpread({}, _superPropGet(VectorTileLayer, "formatLayerData", this, 3)([datasets, oldLayerData, animationConfig])), {}, {
tilesetDataUrl: typeof tilesetDataUrl === 'string' ? (0, _table.getTileUrl)(tilesetDataUrl) : null,
tileSource: tileSource
});
}
}, {
key: "hasHoveredObject",
value: function hasHoveredObject(objectInfo) {
if (_superPropGet(VectorTileLayer, "hasHoveredObject", this, 3)([objectInfo])) {
var _objectInfo$tile;
var features = objectInfo === null || objectInfo === void 0 || (_objectInfo$tile = objectInfo.tile) === null || _objectInfo$tile === void 0 || (_objectInfo$tile = _objectInfo$tile.content) === null || _objectInfo$tile === void 0 ? void 0 : _objectInfo$tile.features;
return features[objectInfo.index];
}
return null;
}
}, {
key: "renderSubLayers",
value: function renderSubLayers(props) {
var _data, _data2;
var data = props.data;
data = ((_data = data) === null || _data === void 0 ? void 0 : _data.shape) === 'geojson-table' ? data.features : data;
if (!((_data2 = data) !== null && _data2 !== void 0 && _data2.length)) {
return [];
}
var tile = props.tile;
var zoom = tile.index.z;
return new _typed.GeoJsonLayer(_objectSpread(_objectSpread({}, props), {}, {
data: data,
getFillColor: props.getFillColorByZoom ? props.getFillColor(zoom) : props.getFillColor,
getElevation: props.getElevationByZoom ? props.getElevation(zoom) : props.getElevation,
// radius for points
pointRadiusScale: props.pointRadiusScale,
// props.getPointRadiusScaleByZoom(zoom),
pointRadiusUnits: props.pointRadiusUnits,
getPointRadius: props.getPointRadius,
// For some reason tile Layer reset autoHighlight to false
pickable: true,
autoHighlight: true,
stroked: props.stroked,
// wrapLongitude: true causes missing side polygon when extrude is enabled
wrapLongitude: false
}));
}
// generate a deck layer
}, {
key: "renderLayer",
value: function renderLayer(opts) {
var mapState = opts.mapState,
data = opts.data,
animationConfig = opts.animationConfig,
gpuFilter = opts.gpuFilter,
objectHovered = opts.objectHovered,
layerCallbacks = opts.layerCallbacks;
var _this$config = this.config,
animation = _this$config.animation,
visConfig = _this$config.visConfig;
this.setLayerDomain = layerCallbacks.onSetLayerDomain;
var defaultLayerProps = this.getDefaultDeckLayerProps(opts);
var eleZoomFactor = this.getElevationZoomFactor(mapState);
var transitions = this.config.visConfig.transition ? {
getFillColor: {
duration: animationConfig.duration
},
getElevation: {
duration: animationConfig.duration
}
} : undefined;
var colorField = this.config.colorField;
var heightField = this.config.heightField;
var strokeColorField = this.config.strokeColorField;
var sizeField = this.config.sizeField;
var radiusField = this.config.radiusField;
if (data.tileSource) {
var _data$tileSource, _objectHovered$source;
var hoveredObject = this.hasHoveredObject(objectHovered);
var layers = [new _mvtLayer.MVTLayer(_objectSpread(_objectSpread(_objectSpread({}, defaultLayerProps), data), {}, {
onViewportLoad: this.onViewportLoad,
data: data.tilesetDataUrl,
getTileData: (_data$tileSource = data.tileSource) === null || _data$tileSource === void 0 ? void 0 : _data$tileSource.getTileData,
tileSource: data.tileSource,
getFilterValue: this.getGpuFilterValueAccessor(opts),
filterRange: gpuFilter.filterRange,
lineWidthUnits: 'pixels',
binary: false,
elevationScale: visConfig.elevationScale * eleZoomFactor,
extruded: visConfig.enable3d,
stroked: visConfig.stroked,
// TODO: this is hard coded, design a UI to allow user assigned unique property id
// uniqueIdProperty: 'ufid',
renderSubLayers: this.renderSubLayers,
// when radiusUnits is meter
getPointRadiusScaleByZoom: (0, _tileUtils.getPropertyByZoom)(visConfig.radiusByZoom, visConfig.radius),
pointRadiusUnits: visConfig.radiusUnits ? 'pixels' : 'meters',
pointRadiusScale: radiusField ? visConfig.radius : 1,
pointRadiusMinPixels: 1,
autoHighlight: true,
highlightColor: DEFAULT_HIGHLIGHT_FILL_COLOR,
pickable: true,
transitions: transitions,
updateTriggers: {
getFilterValue: _objectSpread(_objectSpread({}, gpuFilter.filterValueUpdateTriggers), {}, {
currentTime: animation.enabled ? animationConfig.currentTime : null
}),
getFillColor: {
color: this.config.color,
colorField: this.config.colorField,
colorScale: this.config.colorScale,
colorDomain: this.config.colorDomain,
colorRange: visConfig.colorRange,
currentTime: (0, _tileUtils.isIndexedField)(colorField) ? animationConfig.currentTime : null
},
getElevation: {
heightField: this.config.heightField,
heightScaleType: this.config.heightScale,
heightRange: visConfig.heightRange,
currentTime: (0, _tileUtils.isIndexedField)(heightField) ? animationConfig.currentTime : null
},
getLineColor: {
strokeColor: visConfig.strokeColor,
strokeColorField: this.config.strokeColorField,
// @ts-expect-error prop not in LayerConfig
strokeColorScale: this.config.strokeColorScale,
// @ts-expect-error prop not in LayerConfig
strokeColorDomain: this.config.strokeColorDomain,
// FIXME: Strip out empty arrays from individual color map steps, and replace with `null`, otherwise the layer may show the incorrect color.
// So far it seems that it uses the previous color chosen in the palette rather than the currently chosen color for the specific custom ordinal value when there are "sparse" color maps.
// In other words, a color map with "holes" of colors with unassigned field values, which may have been assigned in the past.
// For example "abc" was green, stored as `["abc"]`. Then "abc" was reassigned to the red color map step, stored as `["abc"]`. Now the green color map step's stored value is `[]`, and the layer will incorrectly still render "abc" in green.
// Quick patch example:
// strokeColorRange: visConfig?.strokeColorRange?.colorMap?.map(cm =>
// cm[0]?.length === 0 ? [null, cm[1]] : cm
// ),
// Note: for regular scales the colorMap in the above patch is undefined and breaks strokeColorRange update trigger.
strokeColorRange: visConfig.strokeColorRange,
currentTime: (0, _tileUtils.isIndexedField)(strokeColorField) ? animationConfig.currentTime : null
},
getLineWidth: {
sizeRange: visConfig.sizeRange,
strokeWidth: visConfig.strokeWidth,
sizeField: this.config.sizeField,
sizeScale: this.config.sizeScale,
sizeDomain: this.config.sizeDomain,
currentTime: (0, _tileUtils.isIndexedField)(sizeField) ? animationConfig.currentTime : null
},
getPointRadius: {
radius: visConfig.radius,
radiusField: this.config.radiusField,
radiusScale: this.config.radiusScale,
radiusDomain: this.config.radiusDomain,
radiusRange: this.config.radiusRange,
currentTime: (0, _tileUtils.isIndexedField)(radiusField) ? animationConfig.currentTime : null
}
},
_subLayerProps: {
'polygons-stroke': {
opacity: visConfig.strokeOpacity
},
'polygons-fill': {
parameters: {
cullFace: _constants["default"].BACK
}
}
},
loadOptions: {
mvt: (0, _table.getLoaderOptions)().mvt
}
}))].concat((0, _toConsumableArray2["default"])(hoveredObject ? [new _typed.GeoJsonLayer(_objectSpread(_objectSpread(_objectSpread({}, (_objectHovered$source = objectHovered.sourceLayer) === null || _objectHovered$source === void 0 ? void 0 : _objectHovered$source.props), this.getDefaultHoverLayerProps()), {}, {
visible: true,
wrapLongitude: false,
data: [hoveredObject],
getLineColor: DEFAULT_HIGHLIGHT_STROKE_COLOR,
getFillColor: DEFAULT_HIGHLIGHT_FILL_COLOR,
getLineWidth: visConfig.strokeWidth + 1,
lineWidthUnits: 'pixels',
stroked: true,
filled: true
}))] : []));
return layers;
}
return [];
}
}], [{
key: "findDefaultLayerProps",
value: function findDefaultLayerProps(dataset) {
if (dataset.type !== _constants2.DatasetType.VECTOR_TILE) {
return {
props: []
};
}
return _superPropGet(VectorTileLayer, "findDefaultLayerProps", this, 2)([dataset]);
}
}]);
}(_abstractTileLayer["default"]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfdHlwZWQiLCJyZXF1aXJlIiwiX212dCIsIl9wbXRpbGVzIiwiX2NvbnN0YW50cyIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJfY29tbW9uVXRpbHMiLCJfY29uc3RhbnRzMiIsIl90YWJsZSIsIl9tdnRMYXllciIsIl92ZWN0b3JUaWxlSWNvbiIsIl9iYXNlTGF5ZXIiLCJfYWJzdHJhY3RUaWxlTGF5ZXIiLCJfaW50ZXJvcFJlcXVpcmVXaWxkY2FyZCIsI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