@carto/kepler.gl 0.0.62 → 0.0.63-alpha.simplify-locales
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +195 -1
- package/README.md +42 -651
- package/dist/components/side-panel/layer-panel/layer-configurator.js +3 -5
- package/dist/constants/default-settings.js +2 -2
- package/dist/layers/base-layer.js +7 -25
- package/dist/layers/geojson-layer/geojson-layer.js +5 -13
- package/dist/layers/icon-layer/icon-layer.js +6 -12
- package/dist/layers/layer-factory.js +1 -9
- package/dist/layers/layer-text-label.js +4 -8
- package/dist/layers/point-layer/point-layer.js +8 -22
- package/dist/localization/en.js +1 -3
- package/dist/localization/index.js +23 -10
- package/dist/localization/locales.js +2 -9
- package/package.json +6 -2
- package/src/.DS_Store +0 -0
- package/src/components/side-panel/layer-panel/layer-configurator.js +1 -8
- package/src/layers/base-layer.js +6 -23
- package/src/layers/geojson-layer/geojson-layer.js +4 -10
- package/src/layers/icon-layer/icon-layer.js +4 -17
- package/src/layers/layer-factory.d.ts +0 -1
- package/src/layers/layer-factory.js +0 -8
- package/src/layers/layer-text-label.js +5 -8
- package/src/layers/point-layer/point-layer.js +5 -17
- package/src/localization/en.js +0 -2
- package/src/localization/index.js +3 -8
- package/src/localization/locales.js +1 -8
- package/dist/components/side-panel/layer-panel/custom-marker-categories-selector.js +0 -45
- package/dist/localization/ca.js +0 -458
- package/dist/localization/cn.js +0 -461
- package/dist/localization/es.js +0 -458
- package/dist/localization/fi.js +0 -430
- package/dist/localization/ja.js +0 -459
- package/dist/localization/pt.js +0 -430
- package/dist/localization/ru.js +0 -467
- package/src/components/side-panel/layer-panel/custom-marker-categories-selector.js +0 -33
- package/src/localization/ca.js +0 -479
- package/src/localization/cn.js +0 -480
- package/src/localization/es.js +0 -480
- package/src/localization/fi.js +0 -451
- package/src/localization/ja.js +0 -480
- package/src/localization/pt.js +0 -452
- package/src/localization/ru.js +0 -491
|
@@ -33,14 +33,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
33
33
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
34
34
|
// THE SOFTWARE.
|
|
35
35
|
var LOCALES = {
|
|
36
|
-
en: 'English'
|
|
37
|
-
fi: 'Suomi',
|
|
38
|
-
pt: 'Português',
|
|
39
|
-
es: 'Español',
|
|
40
|
-
ca: 'Català',
|
|
41
|
-
ja: '日本語',
|
|
42
|
-
cn: '简体中文',
|
|
43
|
-
ru: 'Русский'
|
|
36
|
+
en: 'English'
|
|
44
37
|
};
|
|
45
38
|
/**
|
|
46
39
|
* Localization can be passed to `KeplerGl` via uiState `locale`.
|
|
@@ -68,4 +61,4 @@ var LOCALE_CODES = Object.keys(LOCALES).reduce(function (acc, key) {
|
|
|
68
61
|
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2["default"])({}, key, key));
|
|
69
62
|
}, {});
|
|
70
63
|
exports.LOCALE_CODES = LOCALE_CODES;
|
|
71
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
64
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2NhbGl6YXRpb24vbG9jYWxlcy5qcyJdLCJuYW1lcyI6WyJMT0NBTEVTIiwiZW4iLCJMT0NBTEVfQ09ERVMiLCJPYmplY3QiLCJrZXlzIiwicmVkdWNlIiwiYWNjIiwia2V5Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVPLElBQU1BLE9BQU8sR0FBRztBQUNyQkMsRUFBQUEsRUFBRSxFQUFFO0FBRGlC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nZXMgYXJlIGBlbmAgYW5kIGBmaWAuIERlZmF1bHQgbGFuZ3VhZ2UgaXMgYGVuYFxuICogQGNvbnN0YW50XG4gKiBAcHVibGljXG4gKiBAZXhhbXBsZVxuICogYGBganNcbiAqIGltcG9ydCB7Y29tYmluZVJlZHVjZXJzfSBmcm9tICdyZWR1eCc7XG4gKiBpbXBvcnQge0xPQ0FMRV9DT0RFU30gZnJvbSAna2VwbGVyLmdsL2xvY2FsaXphdGlvbi9sb2NhbGVzJztcbiAqXG4gKiBjb25zdCBjdXN0b21pemVkS2VwbGVyR2xSZWR1Y2VyID0ga2VwbGVyR2xSZWR1Y2VyXG4gKiAgIC5pbml0aWFsU3RhdGUoe1xuICogICAgIHVpU3RhdGU6IHtcbiAqICAgICAgIC8vIHVzZSBGaW5uaXNoIGxvY2FsZVxuICogICAgICAgbG9jYWxlOiBMT0NBTEVfQ09ERVMuZmlcbiAqICAgICB9XG4gKiAgIH0pO1xuICpcbiAqIGBgYFxuICovXG5cbmV4cG9ydCBjb25zdCBMT0NBTEVfQ09ERVMgPSBPYmplY3Qua2V5cyhMT0NBTEVTKS5yZWR1Y2UoKGFjYywga2V5KSA9PiAoey4uLmFjYywgW2tleV06IGtleX0pLCB7fSk7XG4iXX0=
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@carto/kepler.gl",
|
|
3
3
|
"author": "CARTO",
|
|
4
4
|
"homepage": "https://github.com/CartoDB/carto-kepler#readme",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.63-alpha.simplify-locales",
|
|
6
6
|
"description": "kepler.gl is a webgl based application to visualize large scale location data in the browser",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -270,7 +270,11 @@
|
|
|
270
270
|
"engines": {
|
|
271
271
|
"node": ">=12.0.0"
|
|
272
272
|
},
|
|
273
|
+
"maintainers": [
|
|
274
|
+
"Shan He <heshan0131@gmail.com>",
|
|
275
|
+
"Giuseppe Macri <gmacri@uber.com>"
|
|
276
|
+
],
|
|
273
277
|
"volta": {
|
|
274
278
|
"node": "12.19.0"
|
|
275
279
|
}
|
|
276
|
-
}
|
|
280
|
+
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -232,7 +232,7 @@ export default function LayerConfiguratorFactory(
|
|
|
232
232
|
{...layer.visConfigSettings.radiusRange}
|
|
233
233
|
{...visConfiguratorProps}
|
|
234
234
|
label={false}
|
|
235
|
-
disabled={!layer.config.sizeField
|
|
235
|
+
disabled={!layer.config.sizeField}
|
|
236
236
|
/>
|
|
237
237
|
)}
|
|
238
238
|
<ConfigGroupCollapsibleContent>
|
|
@@ -240,13 +240,6 @@ export default function LayerConfiguratorFactory(
|
|
|
240
240
|
channel={layer.visualChannels.size}
|
|
241
241
|
{...layerChannelConfigProps}
|
|
242
242
|
/>
|
|
243
|
-
{layer.config.sizeField ? (
|
|
244
|
-
<VisConfigSwitch
|
|
245
|
-
{...layer.visConfigSettings.fixedRadius}
|
|
246
|
-
{...visConfiguratorProps}
|
|
247
|
-
disabled={layer.config.visConfig.customMarkers}
|
|
248
|
-
/>
|
|
249
|
-
) : null}
|
|
250
243
|
</ConfigGroupCollapsibleContent>
|
|
251
244
|
</LayerConfigGroup>
|
|
252
245
|
|
package/src/layers/base-layer.js
CHANGED
|
@@ -1262,7 +1262,7 @@ class Layer {
|
|
|
1262
1262
|
return objectInfo?.picked && objectInfo?.layer?.props?.id === this.id;
|
|
1263
1263
|
}
|
|
1264
1264
|
|
|
1265
|
-
getRadiusScaleByZoom(mapState
|
|
1265
|
+
getRadiusScaleByZoom(mapState) {
|
|
1266
1266
|
const radiusChannel = Object.values(this.visualChannels).find(vc => vc.property === 'radius');
|
|
1267
1267
|
|
|
1268
1268
|
if (!radiusChannel) {
|
|
@@ -1270,25 +1270,20 @@ class Layer {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
|
|
1272
1272
|
const field = radiusChannel.field;
|
|
1273
|
-
const fixed = fixedRadius === undefined ? this.config.visConfig.fixedRadius : fixedRadius;
|
|
1274
1273
|
const {radius} = this.config.visConfig;
|
|
1275
1274
|
|
|
1276
1275
|
// @ts-ignore
|
|
1277
|
-
return
|
|
1276
|
+
return (this.config[field] ? 1 : radius) * this.getZoomFactor(mapState);
|
|
1278
1277
|
}
|
|
1279
1278
|
|
|
1280
|
-
getRadiusScale(
|
|
1279
|
+
getRadiusScale() {
|
|
1281
1280
|
const radiusChannel = Object.values(this.visualChannels).find(vc => vc.property === 'radius');
|
|
1282
1281
|
|
|
1283
|
-
if (!radiusChannel) {
|
|
1282
|
+
if (!radiusChannel || this.config[radiusChannel.field]) {
|
|
1284
1283
|
return 1;
|
|
1284
|
+
} else {
|
|
1285
|
+
return this.config.visConfig.radius;
|
|
1285
1286
|
}
|
|
1286
|
-
|
|
1287
|
-
const field = radiusChannel.field;
|
|
1288
|
-
const fixed = fixedRadius === undefined ? this.config.visConfig.fixedRadius : fixedRadius;
|
|
1289
|
-
const {radius} = this.config.visConfig;
|
|
1290
|
-
|
|
1291
|
-
return fixed ? 1 : (this.config[field] ? 1 : radius);
|
|
1292
1287
|
}
|
|
1293
1288
|
|
|
1294
1289
|
getMaxMarkerSize() {
|
|
@@ -1298,18 +1293,6 @@ class Layer {
|
|
|
1298
1293
|
return Math.ceil((field && radiusRange ? radiusRange[1] : radius));
|
|
1299
1294
|
}
|
|
1300
1295
|
|
|
1301
|
-
getRadiusUnit(fixedRadius) {
|
|
1302
|
-
const radiusChannel = Object.values(this.visualChannels).find(vc => vc.property === 'radius');
|
|
1303
|
-
|
|
1304
|
-
if (!radiusChannel) {
|
|
1305
|
-
return 'pixels';
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
const fixed = fixedRadius === undefined ? this.config.visConfig.fixedRadius : fixedRadius;
|
|
1309
|
-
|
|
1310
|
-
return fixed ? 'meters' : 'pixels';
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
1296
|
shouldCalculateLayerData(props) {
|
|
1314
1297
|
return props.some(p => !this.noneLayerDataAffectingProps.includes(p));
|
|
1315
1298
|
}
|
|
@@ -237,15 +237,11 @@ export default class GeoJsonLayer extends Layer {
|
|
|
237
237
|
|
|
238
238
|
// get bounds from features
|
|
239
239
|
const bounds = getGeojsonBounds(this.dataToFeature);
|
|
240
|
-
// if any of the feature has properties.radius set to be true
|
|
241
|
-
const fixedRadius = Boolean(
|
|
242
|
-
this.dataToFeature.find(d => d && d.properties && d.properties.radius)
|
|
243
|
-
);
|
|
244
240
|
|
|
245
241
|
// keep a record of what type of geometry the collection has
|
|
246
242
|
const featureTypes = getGeojsonFeatureTypes(this.dataToFeature);
|
|
247
243
|
|
|
248
|
-
this.updateMeta({bounds,
|
|
244
|
+
this.updateMeta({bounds, featureTypes});
|
|
249
245
|
}
|
|
250
246
|
|
|
251
247
|
setInitialLayerConfig({dataContainer}) {
|
|
@@ -271,10 +267,8 @@ export default class GeoJsonLayer extends Layer {
|
|
|
271
267
|
renderLayer(opts) {
|
|
272
268
|
const {data, gpuFilter, objectHovered} = opts;
|
|
273
269
|
|
|
274
|
-
const {
|
|
275
|
-
const radiusScale = this.getRadiusScale(
|
|
276
|
-
const radiusUnits = this.getRadiusUnit(fixedRadius);
|
|
277
|
-
|
|
270
|
+
const {featureTypes} = this.meta;
|
|
271
|
+
const radiusScale = this.getRadiusScale();
|
|
278
272
|
const {visConfig} = this.config;
|
|
279
273
|
|
|
280
274
|
const layerProps = {
|
|
@@ -312,7 +306,7 @@ export default class GeoJsonLayer extends Layer {
|
|
|
312
306
|
wrapLongitude: false,
|
|
313
307
|
lineMiterLimit: 2,
|
|
314
308
|
rounded: true,
|
|
315
|
-
radiusUnits,
|
|
309
|
+
radiusUnits: 'pixels',
|
|
316
310
|
lineWidthUnits: 'pixels',
|
|
317
311
|
updateTriggers,
|
|
318
312
|
_subLayerProps: {
|
|
@@ -45,7 +45,6 @@ export const iconOptionalColumns = ['altitude'];
|
|
|
45
45
|
|
|
46
46
|
export const pointVisConfigs = {
|
|
47
47
|
radius: 'radius',
|
|
48
|
-
fixedRadius: 'fixedRadius',
|
|
49
48
|
opacity: 'opacity',
|
|
50
49
|
colorRange: 'colorRange',
|
|
51
50
|
radiusRange: 'radiusRange'
|
|
@@ -245,17 +244,10 @@ export default class IconLayer extends Layer {
|
|
|
245
244
|
}
|
|
246
245
|
|
|
247
246
|
renderLayer(opts) {
|
|
248
|
-
const {data, gpuFilter, objectHovered,
|
|
247
|
+
const {data, gpuFilter, objectHovered, interactionConfig} = opts;
|
|
249
248
|
|
|
250
|
-
const
|
|
251
|
-
const
|
|
252
|
-
const radiusUnits = this.getRadiusUnit(fixedRadius);
|
|
253
|
-
|
|
254
|
-
const layerProps = {
|
|
255
|
-
radiusScale,
|
|
256
|
-
radiusUnits,
|
|
257
|
-
...(fixedRadius ? {} : {radiusMaxPixels: 500})
|
|
258
|
-
};
|
|
249
|
+
const radiusScale = this.getRadiusScale();
|
|
250
|
+
const layerProps = {radiusScale, radiusUnits: 'pixels', radiusMaxPixels: 500};
|
|
259
251
|
|
|
260
252
|
const updateTriggers = {
|
|
261
253
|
getPosition: this.config.columns,
|
|
@@ -265,12 +257,7 @@ export default class IconLayer extends Layer {
|
|
|
265
257
|
|
|
266
258
|
const defaultLayerProps = this.getDefaultDeckLayerProps(opts);
|
|
267
259
|
const brushingProps = this.getBrushingExtensionProps(interactionConfig);
|
|
268
|
-
const getPixelOffset = getTextOffsetByRadius(
|
|
269
|
-
radiusScale,
|
|
270
|
-
data.getRadius,
|
|
271
|
-
mapState,
|
|
272
|
-
fixedRadius
|
|
273
|
-
);
|
|
260
|
+
const getPixelOffset = getTextOffsetByRadius(radiusScale, data.getRadius);
|
|
274
261
|
const extensions = [...defaultLayerProps.extensions, brushingExtension];
|
|
275
262
|
|
|
276
263
|
// shared Props between layer and label layer
|
|
@@ -84,7 +84,6 @@ export type LayerVisConfig = {
|
|
|
84
84
|
strokeWidthRange: VisConfigRange;
|
|
85
85
|
trailLength: VisConfigNumber;
|
|
86
86
|
radius: VisConfigNumber;
|
|
87
|
-
fixedRadius: VisConfigBoolean;
|
|
88
87
|
radiusRange: VisConfigRange;
|
|
89
88
|
clusterRadius: VisConfigNumber;
|
|
90
89
|
clusterRadiusRange: VisConfigRange;
|
|
@@ -120,14 +120,6 @@ export const LAYER_VIS_CONFIGS = {
|
|
|
120
120
|
group: PROPERTY_GROUPS.radius,
|
|
121
121
|
property: 'radius'
|
|
122
122
|
},
|
|
123
|
-
fixedRadius: {
|
|
124
|
-
defaultValue: false,
|
|
125
|
-
type: 'boolean',
|
|
126
|
-
label: 'layerVisConfigs.fixedRadius',
|
|
127
|
-
description: 'layerVisConfigs.fixedRadiusDescription',
|
|
128
|
-
group: PROPERTY_GROUPS.radius,
|
|
129
|
-
property: 'fixedRadius'
|
|
130
|
-
},
|
|
131
123
|
radiusRange: {
|
|
132
124
|
type: 'number',
|
|
133
125
|
defaultValue: [0, 50],
|
|
@@ -18,15 +18,13 @@
|
|
|
18
18
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
19
|
// THE SOFTWARE.
|
|
20
20
|
|
|
21
|
-
import {getDistanceScales} from 'viewport-mercator-project';
|
|
22
21
|
import {notNullorUndefined} from 'utils/data-utils';
|
|
23
22
|
import uniq from 'lodash.uniq';
|
|
24
23
|
|
|
25
24
|
export const defaultPadding = 20;
|
|
26
25
|
|
|
27
|
-
export function getTextOffsetByRadius(radiusScale, getRadius
|
|
26
|
+
export function getTextOffsetByRadius(radiusScale, getRadius) {
|
|
28
27
|
return textLabel => {
|
|
29
|
-
const distanceScale = getDistanceScales(mapState);
|
|
30
28
|
const xMult = textLabel.anchor === 'middle' ? 0 : textLabel.anchor === 'start' ? 1 : -1;
|
|
31
29
|
const yMult = textLabel.alignment === 'center' ? 0 : textLabel.alignment === 'bottom' ? 1 : -1;
|
|
32
30
|
|
|
@@ -37,17 +35,16 @@ export function getTextOffsetByRadius(radiusScale, getRadius, mapState, fixedRad
|
|
|
37
35
|
? textLabel.size
|
|
38
36
|
: textLabel.size;
|
|
39
37
|
|
|
40
|
-
const pixelRadius = fixedRadius ? radiusScale * distanceScale.pixelsPerMeter[0] : radiusScale;
|
|
41
38
|
const padding = defaultPadding;
|
|
42
39
|
|
|
43
40
|
return typeof getRadius === 'function'
|
|
44
41
|
? d => [
|
|
45
|
-
xMult * (getRadius(d) *
|
|
46
|
-
yMult * (getRadius(d) *
|
|
42
|
+
xMult * (getRadius(d) * radiusScale + padding),
|
|
43
|
+
yMult * (getRadius(d) * radiusScale + padding + sizeOffset)
|
|
47
44
|
]
|
|
48
45
|
: [
|
|
49
|
-
xMult * (getRadius *
|
|
50
|
-
yMult * (getRadius *
|
|
46
|
+
xMult * (getRadius * radiusScale + padding),
|
|
47
|
+
yMult * (getRadius * radiusScale + padding + sizeOffset)
|
|
51
48
|
];
|
|
52
49
|
};
|
|
53
50
|
}
|
|
@@ -44,7 +44,6 @@ const brushingExtension = new BrushingExtension();
|
|
|
44
44
|
|
|
45
45
|
export const pointVisConfigs = {
|
|
46
46
|
radius: 'radius',
|
|
47
|
-
fixedRadius: 'fixedRadius',
|
|
48
47
|
customMarkers: 'customMarkers',
|
|
49
48
|
customMarkersUrl: 'customMarkersUrl',
|
|
50
49
|
customMarkersRange: 'customMarkersRange',
|
|
@@ -123,7 +122,6 @@ export default class PointLayer extends Layer {
|
|
|
123
122
|
...super.visualChannels.size,
|
|
124
123
|
property: 'radius',
|
|
125
124
|
range: 'radiusRange',
|
|
126
|
-
fixed: 'fixedRadius',
|
|
127
125
|
channelScaleType: 'radius',
|
|
128
126
|
accessor: 'getRadius',
|
|
129
127
|
defaultValue: 1
|
|
@@ -279,26 +277,16 @@ export default class PointLayer extends Layer {
|
|
|
279
277
|
|
|
280
278
|
// eslint-disable-next-line complexity, max-statements
|
|
281
279
|
renderLayer(opts) {
|
|
282
|
-
const {data, gpuFilter, objectHovered,
|
|
280
|
+
const {data, gpuFilter, objectHovered, interactionConfig} = opts;
|
|
283
281
|
|
|
284
|
-
|
|
285
|
-
const fixedRadius = this.config.visConfig.fixedRadius && Boolean(this.config.sizeField);
|
|
286
|
-
const radiusScale = this.getRadiusScale(fixedRadius);
|
|
287
|
-
const radiusUnits = this.getRadiusUnit(fixedRadius);
|
|
282
|
+
const radiusScale = this.getRadiusScale();
|
|
288
283
|
|
|
289
284
|
const defaultLayerProps = this.getDefaultDeckLayerProps(opts);
|
|
290
285
|
const brushingProps = this.getBrushingExtensionProps(interactionConfig);
|
|
291
|
-
const getPixelOffset = getTextOffsetByRadius(
|
|
292
|
-
radiusScale,
|
|
293
|
-
data.getRadius,
|
|
294
|
-
mapState,
|
|
295
|
-
fixedRadius
|
|
296
|
-
);
|
|
286
|
+
const getPixelOffset = getTextOffsetByRadius(radiusScale, data.getRadius);
|
|
297
287
|
const extensions = [...defaultLayerProps.extensions, brushingExtension];
|
|
298
288
|
|
|
299
|
-
const {latitude, zoom} = mapState;
|
|
300
289
|
const updateTriggers = {
|
|
301
|
-
getPixelOffset: fixedRadius ? {latitude, zoom} : {},
|
|
302
290
|
getPosition: this.config.columns,
|
|
303
291
|
getFilterValue: gpuFilter.filterValueUpdateTriggers,
|
|
304
292
|
...this.getVisualChannelUpdateTriggers()
|
|
@@ -395,7 +383,7 @@ export default class PointLayer extends Layer {
|
|
|
395
383
|
lineWidthScale: this.config.visConfig.thickness,
|
|
396
384
|
// TODO: invent better way to render something when customMarkers are not yet configured
|
|
397
385
|
radiusScale: customMarkersMisConfigured ? radiusScale / 2 : radiusScale,
|
|
398
|
-
|
|
386
|
+
radiusMaxPixels: 500
|
|
399
387
|
};
|
|
400
388
|
|
|
401
389
|
return [
|
|
@@ -404,7 +392,7 @@ export default class PointLayer extends Layer {
|
|
|
404
392
|
...data,
|
|
405
393
|
...commonLayerProps,
|
|
406
394
|
...scatterPlotLayerProps,
|
|
407
|
-
radiusUnits,
|
|
395
|
+
radiusUnits: 'pixels',
|
|
408
396
|
lineWidthUnits: 'pixels',
|
|
409
397
|
updateTriggers,
|
|
410
398
|
extensions
|
package/src/localization/en.js
CHANGED
|
@@ -131,8 +131,6 @@ export default {
|
|
|
131
131
|
strokeWidth: 'Stroke Width (Pixels)',
|
|
132
132
|
strokeWidthRange: 'Stroke Width Range',
|
|
133
133
|
radius: 'Radius',
|
|
134
|
-
fixedRadius: 'Fixed Radius to meter',
|
|
135
|
-
fixedRadiusDescription: 'Map radius to absolute radius in meters, e.g. 5 to 5 meters',
|
|
136
134
|
radiusRange: 'Radius Range',
|
|
137
135
|
clusterRadius: 'Cluster Radius in Pixels',
|
|
138
136
|
radiusRangePixels: 'Radius Range in pixels',
|
|
@@ -20,17 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
import en from './en';
|
|
22
22
|
import {flattenMessages} from 'utils/locale-utils';
|
|
23
|
-
import {LOCALE_CODES} from './locales';
|
|
24
23
|
|
|
25
24
|
const enFlat = flattenMessages(en);
|
|
26
25
|
|
|
27
|
-
export const messages =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[key]: key === 'en' ? enFlat : {...enFlat, ...flattenMessages(require(`./${key}`).default)}
|
|
31
|
-
}),
|
|
32
|
-
{}
|
|
33
|
-
);
|
|
26
|
+
export const messages = {
|
|
27
|
+
en: enFlat
|
|
28
|
+
};
|
|
34
29
|
|
|
35
30
|
export {LOCALE_CODES, LOCALES} from './locales';
|
|
36
31
|
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactIntl = require("react-intl");
|
|
13
|
-
|
|
14
|
-
// Copyright (c) 2022 Uber Technologies, Inc.
|
|
15
|
-
//
|
|
16
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
18
|
-
// in the Software without restriction, including without limitation the rights
|
|
19
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
21
|
-
// furnished to do so, subject to the following conditions:
|
|
22
|
-
//
|
|
23
|
-
// The above copyright notice and this permission notice shall be included in
|
|
24
|
-
// all copies or substantial portions of the Software.
|
|
25
|
-
//
|
|
26
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
32
|
-
// THE SOFTWARE.
|
|
33
|
-
CustomMarkerCategoriesSelectorFactory.deps = [];
|
|
34
|
-
|
|
35
|
-
function CustomMarkerCategoriesSelectorFactory() {
|
|
36
|
-
var CustomMarkerCategoriesSelector = function CustomMarkerCategoriesSelector() {
|
|
37
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, "Component replaced by cloud native");
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return (0, _reactIntl.injectIntl)(CustomMarkerCategoriesSelector);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var _default = CustomMarkerCategoriesSelectorFactory;
|
|
44
|
-
exports["default"] = _default;
|
|
45
|
-
//# sourceMapp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