@foodmarketmaker/mapag 0.0.19 → 0.0.21
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/fesm2022/foodmarketmaker-mapag.mjs +591 -114
- package/fesm2022/foodmarketmaker-mapag.mjs.map +1 -1
- package/index.d.ts +82 -22
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ import maplibregl, { Popup } from 'maplibre-gl';
|
|
|
21
21
|
import bbox from '@turf/bbox';
|
|
22
22
|
import bboxPolygon from '@turf/bbox-polygon';
|
|
23
23
|
import buffer from '@turf/buffer';
|
|
24
|
+
import difference from '@turf/difference';
|
|
24
25
|
|
|
25
26
|
function SaveMap(map) {
|
|
26
27
|
var mapCanvas = map.getCanvas();
|
|
@@ -35,7 +36,6 @@ function AddLayer(map, layer, afterId) {
|
|
|
35
36
|
return false;
|
|
36
37
|
try {
|
|
37
38
|
if (map.getLayer(layer.id)) {
|
|
38
|
-
console.log(`Layer ${layer.id} already exists`);
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
map.addLayer(layer, afterId);
|
|
@@ -14325,99 +14325,43 @@ const mapStyles = {
|
|
|
14325
14325
|
},
|
|
14326
14326
|
};
|
|
14327
14327
|
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
obj.type === 'MultiPolygon';
|
|
14337
|
-
}
|
|
14338
|
-
function isPolygon(obj) {
|
|
14339
|
-
return typeof obj === 'object' &&
|
|
14340
|
-
obj !== null &&
|
|
14341
|
-
obj.type === 'Polygon';
|
|
14342
|
-
}
|
|
14343
|
-
function isNumber2DArray(input) {
|
|
14344
|
-
return Array.isArray(input) &&
|
|
14345
|
-
input.every(row => Array.isArray(row) &&
|
|
14346
|
-
row.every(cell => typeof cell === 'number'));
|
|
14347
|
-
}
|
|
14348
|
-
function isNumber3DArray(input) {
|
|
14349
|
-
return Array.isArray(input) &&
|
|
14350
|
-
input.every(matrix => Array.isArray(matrix) &&
|
|
14351
|
-
matrix.every(row => Array.isArray(row) &&
|
|
14352
|
-
row.every(cell => typeof cell === 'number')));
|
|
14353
|
-
}
|
|
14354
|
-
function toMultiPolygon(geom) {
|
|
14355
|
-
if (isMultiPolygon(geom)) {
|
|
14356
|
-
return geom;
|
|
14357
|
-
}
|
|
14358
|
-
if (isPolygon(geom)) {
|
|
14359
|
-
return {
|
|
14360
|
-
type: 'MultiPolygon',
|
|
14361
|
-
coordinates: [geom.coordinates]
|
|
14362
|
-
};
|
|
14363
|
-
}
|
|
14364
|
-
if (isNumber2DArray(geom)) {
|
|
14365
|
-
let raw = [geom];
|
|
14366
|
-
const coords = raw;
|
|
14367
|
-
return {
|
|
14368
|
-
type: 'MultiPolygon',
|
|
14369
|
-
coordinates: coords
|
|
14370
|
-
};
|
|
14371
|
-
}
|
|
14372
|
-
let raw = geom;
|
|
14373
|
-
const coords = raw;
|
|
14374
|
-
return {
|
|
14375
|
-
type: 'MultiPolygon',
|
|
14376
|
-
coordinates: coords
|
|
14377
|
-
};
|
|
14328
|
+
class BackgroundMaskSettings {
|
|
14329
|
+
fillColor = 'black';
|
|
14330
|
+
fillOpacity = 0.5;
|
|
14331
|
+
visible = true;
|
|
14332
|
+
beforeLayer = StandardLayersMapper.SELECTIONS;
|
|
14333
|
+
zoom = true;
|
|
14334
|
+
mask;
|
|
14335
|
+
loader = undefined;
|
|
14378
14336
|
}
|
|
14379
|
-
|
|
14380
14337
|
class BackgroundMaskMapper {
|
|
14381
14338
|
map;
|
|
14382
14339
|
count = 0;
|
|
14383
14340
|
total = 0;
|
|
14384
14341
|
source = 'mask';
|
|
14385
14342
|
layer = 'zmask';
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
return this._fillColor;
|
|
14399
|
-
}
|
|
14400
|
-
set fillOpacity(opacity) {
|
|
14401
|
-
this.fillOpacity = opacity;
|
|
14402
|
-
this.load();
|
|
14403
|
-
}
|
|
14404
|
-
get fillOpacity() {
|
|
14405
|
-
return this._fillOpacity;
|
|
14406
|
-
}
|
|
14407
|
-
set visible(visible) {
|
|
14408
|
-
this._visible = visible;
|
|
14409
|
-
this.load();
|
|
14343
|
+
settings = signal(new BackgroundMaskSettings(), ...(ngDevMode ? [{ debugName: "settings" }] : []));
|
|
14344
|
+
constructor(settings) {
|
|
14345
|
+
if (settings) {
|
|
14346
|
+
this.settings.set({
|
|
14347
|
+
...this.settings(),
|
|
14348
|
+
...settings,
|
|
14349
|
+
});
|
|
14350
|
+
}
|
|
14351
|
+
const _ = effect(() => {
|
|
14352
|
+
const settings = this.settings();
|
|
14353
|
+
this._update(settings);
|
|
14354
|
+
}, ...(ngDevMode ? [{ debugName: "_" }] : []));
|
|
14410
14355
|
}
|
|
14411
|
-
|
|
14412
|
-
|
|
14356
|
+
update(settings) {
|
|
14357
|
+
this.settings.set({ ...this.settings(), ...settings });
|
|
14413
14358
|
}
|
|
14414
|
-
|
|
14415
|
-
this.
|
|
14359
|
+
_update(settings) {
|
|
14360
|
+
if (!this.map) {
|
|
14361
|
+
return;
|
|
14362
|
+
}
|
|
14416
14363
|
this.load();
|
|
14417
14364
|
}
|
|
14418
|
-
get beforeLayer() {
|
|
14419
|
-
return this._beforeLayer;
|
|
14420
|
-
}
|
|
14421
14365
|
onReady(map) {
|
|
14422
14366
|
this.map = map;
|
|
14423
14367
|
this.reset();
|
|
@@ -14430,11 +14374,12 @@ class BackgroundMaskMapper {
|
|
|
14430
14374
|
this.removeLayers();
|
|
14431
14375
|
}
|
|
14432
14376
|
flyToBounds() {
|
|
14433
|
-
|
|
14377
|
+
const settings = this.settings();
|
|
14378
|
+
if (this.map && settings.mask) {
|
|
14434
14379
|
// minX, minY, maxX, maxY order
|
|
14435
|
-
let bboxCoords =
|
|
14380
|
+
let bboxCoords = settings.mask.bbox;
|
|
14436
14381
|
if (!bboxCoords) {
|
|
14437
|
-
const f = feature(
|
|
14382
|
+
const f = feature(settings.mask);
|
|
14438
14383
|
bboxCoords = bbox(f);
|
|
14439
14384
|
}
|
|
14440
14385
|
const buffered = buffer(bboxPolygon(bboxCoords), 10, { units: 'miles' });
|
|
@@ -14450,17 +14395,36 @@ class BackgroundMaskMapper {
|
|
|
14450
14395
|
RemoveLayer(this.map, this.layer);
|
|
14451
14396
|
RemoveSource(this.map, this.source);
|
|
14452
14397
|
}
|
|
14453
|
-
load() {
|
|
14398
|
+
async load() {
|
|
14399
|
+
const settings = this.settings();
|
|
14400
|
+
// Check if we need to load from loader first
|
|
14401
|
+
if (!settings.mask && settings.loader) {
|
|
14402
|
+
const geomask = await settings.loader.LoadBoundary();
|
|
14403
|
+
this.update({ mask: geomask, loader: undefined });
|
|
14404
|
+
return;
|
|
14405
|
+
}
|
|
14454
14406
|
this.removeLayers();
|
|
14455
|
-
if (!
|
|
14407
|
+
if (!settings.visible) {
|
|
14456
14408
|
return;
|
|
14457
14409
|
}
|
|
14458
|
-
if (!this.map
|
|
14410
|
+
if (!this.map) {
|
|
14411
|
+
return;
|
|
14412
|
+
}
|
|
14413
|
+
if (!settings.mask) {
|
|
14459
14414
|
return;
|
|
14460
14415
|
}
|
|
14461
|
-
|
|
14462
|
-
//
|
|
14463
|
-
const
|
|
14416
|
+
const mask = settings.mask;
|
|
14417
|
+
// Use Turf's difference to cut the mask out of the world polygon
|
|
14418
|
+
const worldPolygon = bboxPolygon([-180, -90, 180, 90]);
|
|
14419
|
+
const features = [worldPolygon];
|
|
14420
|
+
for (const part of mask.coordinates) {
|
|
14421
|
+
features.push(polygon(part));
|
|
14422
|
+
}
|
|
14423
|
+
const fc = {
|
|
14424
|
+
type: 'FeatureCollection',
|
|
14425
|
+
features: features
|
|
14426
|
+
};
|
|
14427
|
+
const shape = difference(fc);
|
|
14464
14428
|
AddSource(this.map, this.source, {
|
|
14465
14429
|
type: 'geojson',
|
|
14466
14430
|
data: shape,
|
|
@@ -14470,31 +14434,28 @@ class BackgroundMaskMapper {
|
|
|
14470
14434
|
source: this.source,
|
|
14471
14435
|
type: 'fill',
|
|
14472
14436
|
paint: {
|
|
14473
|
-
'fill-color':
|
|
14474
|
-
'fill-opacity':
|
|
14437
|
+
'fill-color': settings.fillColor,
|
|
14438
|
+
'fill-opacity': settings.fillOpacity,
|
|
14475
14439
|
},
|
|
14476
|
-
},
|
|
14477
|
-
if (
|
|
14440
|
+
}, settings.beforeLayer);
|
|
14441
|
+
if (settings.zoom) {
|
|
14478
14442
|
this.flyToBounds();
|
|
14479
14443
|
}
|
|
14480
14444
|
}
|
|
14481
|
-
async setMask(mask, show = true) {
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
}
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
const geomask = await loader.LoadBoundary();
|
|
14496
|
-
this.mask = geomask;
|
|
14497
|
-
this.load();
|
|
14445
|
+
// async setMask(mask: Geoloader | MultiPolygon | Polygon | number[][] | number[][][], show: boolean = true) {
|
|
14446
|
+
// if (isGeoloader(mask)) {
|
|
14447
|
+
// this.update({ mask: await mask.LoadBoundary() });
|
|
14448
|
+
// } else {
|
|
14449
|
+
// this.update({ mask: toMultiPolygon(mask) });
|
|
14450
|
+
// }
|
|
14451
|
+
// }
|
|
14452
|
+
// async loadGeoJsonFromLoader(loader: Geoloader) {
|
|
14453
|
+
// // Load the boundary from the external loader
|
|
14454
|
+
// const geomask = await loader.LoadBoundary();
|
|
14455
|
+
// this.update({ mask: geomask });
|
|
14456
|
+
// }
|
|
14457
|
+
getSettings() {
|
|
14458
|
+
return { ...this.settings() };
|
|
14498
14459
|
}
|
|
14499
14460
|
}
|
|
14500
14461
|
|
|
@@ -15404,6 +15365,7 @@ class HardinessMapper {
|
|
|
15404
15365
|
}
|
|
15405
15366
|
else {
|
|
15406
15367
|
this.map.setLayoutProperty(this.LAYER_ID, 'visibility', 'none');
|
|
15368
|
+
return;
|
|
15407
15369
|
}
|
|
15408
15370
|
// Update paint properties
|
|
15409
15371
|
this.map.setPaintProperty(this.LAYER_ID, 'fill-color', [
|
|
@@ -15611,6 +15573,469 @@ class NAASSettings {
|
|
|
15611
15573
|
autoSelectLayer = false;
|
|
15612
15574
|
}
|
|
15613
15575
|
|
|
15576
|
+
class NaicsMapperSettings {
|
|
15577
|
+
naicsCode;
|
|
15578
|
+
type = 'circle';
|
|
15579
|
+
visible = true;
|
|
15580
|
+
color = '#1f77b4'; // Both Icon and Circle color
|
|
15581
|
+
opacity = 0.8;
|
|
15582
|
+
radius = 7;
|
|
15583
|
+
strokeWidth = 0;
|
|
15584
|
+
strokeColor = '#ffffff';
|
|
15585
|
+
iconUrl = '';
|
|
15586
|
+
iconName = 'naics-icon';
|
|
15587
|
+
iconSize = 0.8;
|
|
15588
|
+
iconAllowOverlap = true;
|
|
15589
|
+
iconSdf = false;
|
|
15590
|
+
iconHaloWidth = 0;
|
|
15591
|
+
iconHaloColor = '#000000';
|
|
15592
|
+
iconOpacity = 1;
|
|
15593
|
+
heatColor = [
|
|
15594
|
+
'interpolate',
|
|
15595
|
+
['linear'],
|
|
15596
|
+
['heatmap-density'],
|
|
15597
|
+
0, 'rgba(0, 0, 255, 0)',
|
|
15598
|
+
0.1, 'royalblue',
|
|
15599
|
+
0.3, 'cyan',
|
|
15600
|
+
0.5, 'lime',
|
|
15601
|
+
0.7, 'yellow',
|
|
15602
|
+
1, 'red',
|
|
15603
|
+
];
|
|
15604
|
+
heatWeight = 1;
|
|
15605
|
+
heatIntensity = 1;
|
|
15606
|
+
heatRadius = 1;
|
|
15607
|
+
}
|
|
15608
|
+
class NaicsMapper {
|
|
15609
|
+
legends = [];
|
|
15610
|
+
count = 0;
|
|
15611
|
+
total = 0;
|
|
15612
|
+
map;
|
|
15613
|
+
svc;
|
|
15614
|
+
id;
|
|
15615
|
+
name;
|
|
15616
|
+
static pmtilesUrl = 'https://foodmarketmaker-upload-data.s3.amazonaws.com/tiles/secondary_101124.pmtiles';
|
|
15617
|
+
static sourceLayer = 'secondary_101124';
|
|
15618
|
+
SOURCE_ID = 'naics-pmtiles';
|
|
15619
|
+
sourceLayer = NaicsMapper.sourceLayer;
|
|
15620
|
+
CIRCLE_LAYER_ID;
|
|
15621
|
+
ICON_LAYER_ID;
|
|
15622
|
+
HEATMAP_LAYER_ID;
|
|
15623
|
+
settings = signal(new NaicsMapperSettings(), ...(ngDevMode ? [{ debugName: "settings" }] : []));
|
|
15624
|
+
constructor(settings, id = 'naics-' + Math.random().toString(36)) {
|
|
15625
|
+
this.id = id;
|
|
15626
|
+
this.name = `NAICS Mapper (${id})`;
|
|
15627
|
+
// Make layer IDs unique per instance
|
|
15628
|
+
this.CIRCLE_LAYER_ID = `${id}-circles`;
|
|
15629
|
+
this.ICON_LAYER_ID = `${id}-icons`;
|
|
15630
|
+
this.HEATMAP_LAYER_ID = `${id}-heatmap`;
|
|
15631
|
+
if (settings) {
|
|
15632
|
+
this.settings.set({
|
|
15633
|
+
...this.settings(),
|
|
15634
|
+
...settings,
|
|
15635
|
+
});
|
|
15636
|
+
}
|
|
15637
|
+
const _ = effect(() => {
|
|
15638
|
+
const settings = this.settings();
|
|
15639
|
+
this._update(settings);
|
|
15640
|
+
}, ...(ngDevMode ? [{ debugName: "_" }] : []));
|
|
15641
|
+
}
|
|
15642
|
+
update(settings) {
|
|
15643
|
+
this.settings.set({ ...this.settings(), ...settings });
|
|
15644
|
+
}
|
|
15645
|
+
async _update(settings) {
|
|
15646
|
+
if (!this.map) {
|
|
15647
|
+
return;
|
|
15648
|
+
}
|
|
15649
|
+
const map = this.map;
|
|
15650
|
+
this.create();
|
|
15651
|
+
// Update paint/layout properties based on type
|
|
15652
|
+
switch (settings.type) {
|
|
15653
|
+
case 'circle':
|
|
15654
|
+
if (map.getLayer(this.CIRCLE_LAYER_ID)) {
|
|
15655
|
+
map.setLayoutProperty(this.CIRCLE_LAYER_ID, 'visibility', settings.visible ? 'visible' : 'none');
|
|
15656
|
+
map.setPaintProperty(this.CIRCLE_LAYER_ID, 'circle-radius', settings.radius);
|
|
15657
|
+
map.setPaintProperty(this.CIRCLE_LAYER_ID, 'circle-color', settings.color);
|
|
15658
|
+
map.setPaintProperty(this.CIRCLE_LAYER_ID, 'circle-opacity', settings.opacity);
|
|
15659
|
+
map.setPaintProperty(this.CIRCLE_LAYER_ID, 'circle-stroke-width', settings.strokeWidth);
|
|
15660
|
+
map.setPaintProperty(this.CIRCLE_LAYER_ID, 'circle-stroke-color', settings.strokeColor);
|
|
15661
|
+
}
|
|
15662
|
+
break;
|
|
15663
|
+
case 'icon':
|
|
15664
|
+
if (map.getLayer(this.ICON_LAYER_ID)) {
|
|
15665
|
+
await this.loadIcon();
|
|
15666
|
+
map.setLayoutProperty(this.ICON_LAYER_ID, 'visibility', settings.visible ? 'visible' : 'none');
|
|
15667
|
+
map.setLayoutProperty(this.ICON_LAYER_ID, 'icon-image', settings.iconName);
|
|
15668
|
+
map.setLayoutProperty(this.ICON_LAYER_ID, 'icon-size', settings.iconSize);
|
|
15669
|
+
map.setPaintProperty(this.ICON_LAYER_ID, 'icon-color', settings.color);
|
|
15670
|
+
map.setLayoutProperty(this.ICON_LAYER_ID, 'icon-allow-overlap', settings.iconAllowOverlap);
|
|
15671
|
+
map.setPaintProperty(this.ICON_LAYER_ID, 'icon-opacity', settings.iconOpacity);
|
|
15672
|
+
map.setPaintProperty(this.ICON_LAYER_ID, 'icon-halo-width', settings.iconHaloWidth);
|
|
15673
|
+
map.setPaintProperty(this.ICON_LAYER_ID, 'icon-halo-color', settings.iconHaloColor);
|
|
15674
|
+
}
|
|
15675
|
+
break;
|
|
15676
|
+
case 'heatmap':
|
|
15677
|
+
if (map.getLayer(this.HEATMAP_LAYER_ID)) {
|
|
15678
|
+
map.setLayoutProperty(this.HEATMAP_LAYER_ID, 'visibility', settings.visible ? 'visible' : 'none');
|
|
15679
|
+
map.setPaintProperty(this.HEATMAP_LAYER_ID, 'heatmap-radius', settings.radius);
|
|
15680
|
+
map.setPaintProperty(this.HEATMAP_LAYER_ID, 'heatmap-opacity', settings.opacity);
|
|
15681
|
+
map.setPaintProperty(this.HEATMAP_LAYER_ID, 'heatmap-color', settings.heatColor);
|
|
15682
|
+
map.setPaintProperty(this.HEATMAP_LAYER_ID, 'heatmap-weight', settings.heatWeight);
|
|
15683
|
+
map.setPaintProperty(this.HEATMAP_LAYER_ID, 'heatmap-intensity', settings.heatIntensity);
|
|
15684
|
+
}
|
|
15685
|
+
break;
|
|
15686
|
+
}
|
|
15687
|
+
}
|
|
15688
|
+
onReady(map, svc) {
|
|
15689
|
+
this.map = map;
|
|
15690
|
+
this.svc = svc;
|
|
15691
|
+
this.create();
|
|
15692
|
+
}
|
|
15693
|
+
reset() {
|
|
15694
|
+
this.count = 0;
|
|
15695
|
+
this.total = 0;
|
|
15696
|
+
this.legends = [];
|
|
15697
|
+
}
|
|
15698
|
+
clear() {
|
|
15699
|
+
if (!this.map) {
|
|
15700
|
+
return;
|
|
15701
|
+
}
|
|
15702
|
+
// Remove all layers for this instance
|
|
15703
|
+
RemoveLayer(this.map, this.CIRCLE_LAYER_ID);
|
|
15704
|
+
RemoveLayer(this.map, this.ICON_LAYER_ID);
|
|
15705
|
+
RemoveLayer(this.map, this.HEATMAP_LAYER_ID);
|
|
15706
|
+
this.map.off('click', this.CIRCLE_LAYER_ID, this.onClick);
|
|
15707
|
+
this.map.off('click', this.ICON_LAYER_ID, this.onClick);
|
|
15708
|
+
this.map.off('touchend', this.CIRCLE_LAYER_ID, this.onClick);
|
|
15709
|
+
this.map.off('touchend', this.ICON_LAYER_ID, this.onClick);
|
|
15710
|
+
this.count = 0;
|
|
15711
|
+
}
|
|
15712
|
+
updateLegends() { }
|
|
15713
|
+
// Method to create PMTiles layers
|
|
15714
|
+
create() {
|
|
15715
|
+
if (!this.map) {
|
|
15716
|
+
return;
|
|
15717
|
+
}
|
|
15718
|
+
const map = this.map;
|
|
15719
|
+
const settings = this.settings();
|
|
15720
|
+
// Add PMTiles source only if it doesn't exist (shared across instances)
|
|
15721
|
+
AddSource(map, this.SOURCE_ID, {
|
|
15722
|
+
type: 'vector',
|
|
15723
|
+
url: `pmtiles://${NaicsMapper.pmtilesUrl}`,
|
|
15724
|
+
});
|
|
15725
|
+
// Add visualization layer based on type
|
|
15726
|
+
this.addVisualizationLayer(map);
|
|
15727
|
+
// Add cluster layers if clustering is enabled
|
|
15728
|
+
// this.addClusterLayers(map);
|
|
15729
|
+
// Add popup on click
|
|
15730
|
+
map.on('click', this.CIRCLE_LAYER_ID, this.onClick);
|
|
15731
|
+
map.on('click', this.ICON_LAYER_ID, this.onClick);
|
|
15732
|
+
map.on('touchend', this.CIRCLE_LAYER_ID, this.onClick);
|
|
15733
|
+
map.on('touchend', this.ICON_LAYER_ID, this.onClick);
|
|
15734
|
+
}
|
|
15735
|
+
getActiveLayerId() {
|
|
15736
|
+
const settings = this.settings();
|
|
15737
|
+
switch (settings.type) {
|
|
15738
|
+
case 'circle':
|
|
15739
|
+
return this.CIRCLE_LAYER_ID;
|
|
15740
|
+
case 'icon':
|
|
15741
|
+
return this.ICON_LAYER_ID;
|
|
15742
|
+
case 'heatmap':
|
|
15743
|
+
return this.HEATMAP_LAYER_ID;
|
|
15744
|
+
default:
|
|
15745
|
+
return this.CIRCLE_LAYER_ID;
|
|
15746
|
+
}
|
|
15747
|
+
}
|
|
15748
|
+
async loadIcon() {
|
|
15749
|
+
if (!this.map) {
|
|
15750
|
+
return;
|
|
15751
|
+
}
|
|
15752
|
+
const map = this.map;
|
|
15753
|
+
const settings = this.settings();
|
|
15754
|
+
if (settings.iconUrl && !map.hasImage(settings.iconName)) {
|
|
15755
|
+
await mapboxloadImage(map, {
|
|
15756
|
+
name: settings.iconName,
|
|
15757
|
+
url: settings.iconUrl,
|
|
15758
|
+
sdf: settings.iconSdf,
|
|
15759
|
+
});
|
|
15760
|
+
}
|
|
15761
|
+
}
|
|
15762
|
+
async addVisualizationLayer(map) {
|
|
15763
|
+
const settings = this.settings();
|
|
15764
|
+
// Remove existing layers that ar not needed
|
|
15765
|
+
if (settings.type !== 'circle')
|
|
15766
|
+
RemoveLayer(map, this.CIRCLE_LAYER_ID);
|
|
15767
|
+
if (settings.type !== 'icon')
|
|
15768
|
+
RemoveLayer(map, this.ICON_LAYER_ID);
|
|
15769
|
+
if (settings.type !== 'heatmap')
|
|
15770
|
+
RemoveLayer(map, this.HEATMAP_LAYER_ID);
|
|
15771
|
+
// Add layer based on type
|
|
15772
|
+
switch (settings.type) {
|
|
15773
|
+
case 'circle':
|
|
15774
|
+
AddLayer(map, {
|
|
15775
|
+
id: this.CIRCLE_LAYER_ID,
|
|
15776
|
+
type: 'circle',
|
|
15777
|
+
source: this.SOURCE_ID,
|
|
15778
|
+
'source-layer': this.sourceLayer,
|
|
15779
|
+
layout: {
|
|
15780
|
+
visibility: settings.visible ? 'visible' : 'none',
|
|
15781
|
+
},
|
|
15782
|
+
paint: {
|
|
15783
|
+
'circle-radius': settings.radius,
|
|
15784
|
+
'circle-color': settings.color,
|
|
15785
|
+
'circle-opacity': settings.opacity,
|
|
15786
|
+
'circle-stroke-width': settings.strokeWidth,
|
|
15787
|
+
'circle-stroke-color': settings.strokeColor,
|
|
15788
|
+
},
|
|
15789
|
+
}, StandardLayersMapper.POINTS);
|
|
15790
|
+
break;
|
|
15791
|
+
case 'icon':
|
|
15792
|
+
// Load icon image if URL is provided and not already loaded
|
|
15793
|
+
await this.loadIcon();
|
|
15794
|
+
AddLayer(map, {
|
|
15795
|
+
id: this.ICON_LAYER_ID,
|
|
15796
|
+
type: 'symbol',
|
|
15797
|
+
source: this.SOURCE_ID,
|
|
15798
|
+
'source-layer': this.sourceLayer,
|
|
15799
|
+
layout: {
|
|
15800
|
+
visibility: settings.visible ? 'visible' : 'none',
|
|
15801
|
+
'icon-image': settings.iconName,
|
|
15802
|
+
'icon-size': settings.iconSize,
|
|
15803
|
+
'icon-allow-overlap': settings.iconAllowOverlap,
|
|
15804
|
+
},
|
|
15805
|
+
paint: {
|
|
15806
|
+
// Additional paint properties can be added here if needed
|
|
15807
|
+
'icon-color': settings.color,
|
|
15808
|
+
'icon-opacity': settings.iconOpacity,
|
|
15809
|
+
'icon-halo-width': settings.iconHaloWidth,
|
|
15810
|
+
'icon-halo-color': settings.iconHaloColor,
|
|
15811
|
+
}
|
|
15812
|
+
}, StandardLayersMapper.POINTS);
|
|
15813
|
+
break;
|
|
15814
|
+
case 'heatmap':
|
|
15815
|
+
AddLayer(map, {
|
|
15816
|
+
id: this.HEATMAP_LAYER_ID,
|
|
15817
|
+
type: 'heatmap',
|
|
15818
|
+
source: this.SOURCE_ID,
|
|
15819
|
+
'source-layer': this.sourceLayer,
|
|
15820
|
+
layout: {
|
|
15821
|
+
visibility: settings.visible ? 'visible' : 'none',
|
|
15822
|
+
},
|
|
15823
|
+
paint: {
|
|
15824
|
+
'heatmap-weight': settings.heatWeight,
|
|
15825
|
+
'heatmap-intensity': settings.heatIntensity,
|
|
15826
|
+
'heatmap-color': settings.heatColor,
|
|
15827
|
+
'heatmap-radius': settings.radius,
|
|
15828
|
+
'heatmap-opacity': settings.opacity,
|
|
15829
|
+
},
|
|
15830
|
+
}, StandardLayersMapper.POLYGONS_ACTIVE);
|
|
15831
|
+
break;
|
|
15832
|
+
}
|
|
15833
|
+
// Reapply filter if exists
|
|
15834
|
+
if (settings.naicsCode) {
|
|
15835
|
+
this.filterByNaicsCode(map, settings.naicsCode);
|
|
15836
|
+
}
|
|
15837
|
+
}
|
|
15838
|
+
// Method to filter by NAICS code (startsWith match)
|
|
15839
|
+
filterByNaicsCode(map, naicsCode) {
|
|
15840
|
+
const filter = naicsCode ? ['==', ['slice', ['get', 'NAICS_CODE'], 0, naicsCode.length], naicsCode] : null;
|
|
15841
|
+
const layerId = this.getActiveLayerId();
|
|
15842
|
+
if (map.getLayer(layerId)) {
|
|
15843
|
+
map.setFilter(layerId, filter);
|
|
15844
|
+
}
|
|
15845
|
+
}
|
|
15846
|
+
// Get current settings
|
|
15847
|
+
getSettings() {
|
|
15848
|
+
return { ...this.settings() };
|
|
15849
|
+
}
|
|
15850
|
+
onClick = (e) => {
|
|
15851
|
+
if (!this.map) {
|
|
15852
|
+
return;
|
|
15853
|
+
}
|
|
15854
|
+
const map = this.map;
|
|
15855
|
+
let features;
|
|
15856
|
+
const settings = this.settings();
|
|
15857
|
+
if (settings.type == 'circle') {
|
|
15858
|
+
features = this.map.queryRenderedFeatures(e.point, {
|
|
15859
|
+
layers: [this.CIRCLE_LAYER_ID],
|
|
15860
|
+
});
|
|
15861
|
+
}
|
|
15862
|
+
else if (settings.type == 'icon') {
|
|
15863
|
+
features = this.map.queryRenderedFeatures(e.point, {
|
|
15864
|
+
layers: [this.ICON_LAYER_ID],
|
|
15865
|
+
});
|
|
15866
|
+
}
|
|
15867
|
+
if (!features || features.length == 0) {
|
|
15868
|
+
return;
|
|
15869
|
+
}
|
|
15870
|
+
if (features.length > 0) {
|
|
15871
|
+
const item = features[0];
|
|
15872
|
+
if (item) {
|
|
15873
|
+
this.renderPopup(item).then((html) => {
|
|
15874
|
+
if (!html) {
|
|
15875
|
+
return;
|
|
15876
|
+
}
|
|
15877
|
+
new Popup().setLngLat(e.lngLat).setHTML(html).addTo(map);
|
|
15878
|
+
});
|
|
15879
|
+
}
|
|
15880
|
+
}
|
|
15881
|
+
};
|
|
15882
|
+
async renderPopup(f) {
|
|
15883
|
+
if (!f || !f.properties) {
|
|
15884
|
+
return undefined;
|
|
15885
|
+
}
|
|
15886
|
+
const item = f.properties;
|
|
15887
|
+
let html = `<b>${item['COMPANY_NAME'] || 'MISSING NAME'}</b><br>`;
|
|
15888
|
+
if (item?.['WEB_ADDRESS']) {
|
|
15889
|
+
let url = item['WEB_ADDRESS'].startsWith('http') ? item['WEB_ADDRESS'] : 'https://' + item['WEB_ADDRESS'];
|
|
15890
|
+
html += `<a href='${url}' target='_blank'>${url}</a><br />`;
|
|
15891
|
+
}
|
|
15892
|
+
if (item?.['ADDRESS']) {
|
|
15893
|
+
html += `${item?.['ADDRESS']}<br />`;
|
|
15894
|
+
}
|
|
15895
|
+
if (item?.['CITY'] && item?.['STATE']) {
|
|
15896
|
+
html += `${item?.['CITY']}, ${item?.['STATE']}<br />`;
|
|
15897
|
+
}
|
|
15898
|
+
if (item?.['PHONE']) {
|
|
15899
|
+
html += `${item?.['PHONE']}<br /><br />`;
|
|
15900
|
+
}
|
|
15901
|
+
if (item?.['SALES_VOLUME']) {
|
|
15902
|
+
html += `<b>Sales: </b>${item?.['SALES_VOLUME']}<br />`;
|
|
15903
|
+
}
|
|
15904
|
+
if (item?.['NUMBER_OF_EMPLOYEES']) {
|
|
15905
|
+
html += `<b>Employees: </b>${item?.['NUMBER_OF_EMPLOYEES']}<br />`;
|
|
15906
|
+
}
|
|
15907
|
+
if (item?.['NAICS_CODE']) {
|
|
15908
|
+
html += `<b>NAICS: </b>${item?.['NAICS_CODE']} ${item?.['NAICS_DESCRIPTION']} <br />`;
|
|
15909
|
+
}
|
|
15910
|
+
if (item?.['SIC_CODE1']) {
|
|
15911
|
+
html += `<b>SIC: </b>${item?.['SIC_CODE1']} ${item?.['SIC1_DESCRIPTION']}`;
|
|
15912
|
+
}
|
|
15913
|
+
return html;
|
|
15914
|
+
}
|
|
15915
|
+
}
|
|
15916
|
+
const Codes = [
|
|
15917
|
+
{ ID: '111219', Category: 'Farmers and Ranchers', Name: 'Other Vegetable (Except Potato) & Melon Farming' },
|
|
15918
|
+
{ ID: '111310', Category: 'Farmers and Ranchers', Name: 'Orange Groves' },
|
|
15919
|
+
{ ID: '111320', Category: 'Farmers and Ranchers', Name: 'Citrus (Except Orange) Groves' },
|
|
15920
|
+
{ ID: '111331', Category: 'Farmers and Ranchers', Name: 'Apple Orchards' },
|
|
15921
|
+
{ ID: '111332', Category: 'Farmers and Ranchers', Name: 'Grape Vineyards' },
|
|
15922
|
+
{ ID: '111334', Category: 'Farmers and Ranchers', Name: 'Berry (Except Strawberry) Farming' },
|
|
15923
|
+
{ ID: '111335', Category: 'Farmers and Ranchers', Name: 'Tree Nut Farming' },
|
|
15924
|
+
{ ID: '111336', Category: 'Farmers and Ranchers', Name: 'Fruit & Tree Nut Combination Farming' },
|
|
15925
|
+
{ ID: '111339', Category: 'Farmers and Ranchers', Name: 'Other Noncitrus Fruit Farming' },
|
|
15926
|
+
{ ID: '111411', Category: 'Farmers and Ranchers', Name: 'Mushroom Production' },
|
|
15927
|
+
{ ID: '111419', Category: 'Farmers and Ranchers', Name: 'Other Food Crops Grown Under Cover' },
|
|
15928
|
+
{ ID: '112111', Category: 'Farmers and Ranchers', Name: 'Beef Cattle Ranching & Farming' },
|
|
15929
|
+
{ ID: '112112', Category: 'Farmers and Ranchers', Name: 'Cattle Feedlots' },
|
|
15930
|
+
{ ID: '112910', Category: 'Farmers and Ranchers', Name: 'Apiculture' },
|
|
15931
|
+
{ ID: '111110', Category: 'Farmers and Ranchers', Name: 'Soybean Farming' },
|
|
15932
|
+
{ ID: '111140', Category: 'Farmers and Ranchers', Name: 'Wheat Farming' },
|
|
15933
|
+
{ ID: '111150', Category: 'Farmers and Ranchers', Name: 'Corn Farming' },
|
|
15934
|
+
{ ID: '111160', Category: 'Farmers and Ranchers', Name: 'Rice Farming' },
|
|
15935
|
+
{ ID: '111199', Category: 'Farmers and Ranchers', Name: 'All Other Grain Farming' },
|
|
15936
|
+
{ ID: '111211', Category: 'Farmers and Ranchers', Name: 'Potato Farming' },
|
|
15937
|
+
{ ID: '111421', Category: 'Farmers and Ranchers', Name: 'Nursery & Tree Production' },
|
|
15938
|
+
{ ID: '111422', Category: 'Farmers and Ranchers', Name: 'Floriculture Production' },
|
|
15939
|
+
{ ID: '111910', Category: 'Farmers and Ranchers', Name: 'Tobacco Farming' },
|
|
15940
|
+
{ ID: '111910', Category: 'Farmers and Ranchers', Name: 'Tobacco Farming' },
|
|
15941
|
+
{ ID: '111920', Category: 'Farmers and Ranchers', Name: 'Cotton Farming' },
|
|
15942
|
+
{ ID: '111998', Category: 'Farmers and Ranchers', Name: 'All Other Miscellaneous Crop Farming' },
|
|
15943
|
+
{ ID: '111998', Category: 'Farmers and Ranchers', Name: 'All Other Miscellaneous Crop Farming' },
|
|
15944
|
+
{ ID: '112120', Category: 'Farmers and Ranchers', Name: 'Dairy Cattle & Milk Production' },
|
|
15945
|
+
{ ID: '112210', Category: 'Farmers and Ranchers', Name: 'Hog & Pig Farming' },
|
|
15946
|
+
{ ID: '112310', Category: 'Farmers and Ranchers', Name: 'Chicken Egg Production' },
|
|
15947
|
+
{ ID: '112320', Category: 'Farmers and Ranchers', Name: 'Broilers & Other Meat Type Chicken Production' },
|
|
15948
|
+
{ ID: '112330', Category: 'Farmers and Ranchers', Name: 'Turkey Production' },
|
|
15949
|
+
{ ID: '112340', Category: 'Farmers and Ranchers', Name: 'Poultry Hatcheries' },
|
|
15950
|
+
{ ID: '112390', Category: 'Farmers and Ranchers', Name: 'Other Poultry Production' },
|
|
15951
|
+
{ ID: '112410', Category: 'Farmers and Ranchers', Name: 'Sheep Farming' },
|
|
15952
|
+
{ ID: '112420', Category: 'Farmers and Ranchers', Name: 'Goat Farming' },
|
|
15953
|
+
{ ID: '112930', Category: 'Farmers and Ranchers', Name: 'Fur-Bearing Animal & Rabbit Production' },
|
|
15954
|
+
{ ID: '112990', Category: 'Farmers and Ranchers', Name: 'All Other Animal Production' },
|
|
15955
|
+
{ ID: '112511', Category: 'Fisheries', Name: 'Finfish Farming & Fish Hatcheries' },
|
|
15956
|
+
{ ID: '112512', Category: 'Fisheries', Name: 'Shellfish Farming' },
|
|
15957
|
+
{ ID: '112519', Category: 'Fisheries', Name: 'Other Aquaculture' },
|
|
15958
|
+
{ ID: '311211', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Flour Milling' },
|
|
15959
|
+
{ ID: '311212', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Rice Milling' },
|
|
15960
|
+
{ ID: '311213', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Malt Manufacturing' },
|
|
15961
|
+
{ ID: '311221', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Wet Corn Milling' },
|
|
15962
|
+
{ ID: '311224', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Soybean & Other Oilseed Processing' },
|
|
15963
|
+
{ ID: '311225', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Fats & Oils Refining & Blending' },
|
|
15964
|
+
{ ID: '311230', Category: 'Milling, Grain and Oilseed Processors and Manufacturers', Name: 'Breakfast Cereal Manufacturing' },
|
|
15965
|
+
{ ID: '311313', Category: 'Sugar and Confectionary Processors and Manufacturers', Name: 'Beet Sugar Manufacturing' },
|
|
15966
|
+
{ ID: '311314', Category: 'Sugar and Confectionary Processors and Manufacturers', Name: 'Cane Sugar Manufacturing' },
|
|
15967
|
+
{ ID: '311340', Category: 'Sugar and Confectionary Processors and Manufacturers', Name: 'Nonchocolate Confectionery Manufacturing' },
|
|
15968
|
+
{ ID: '311351', Category: 'Sugar and Confectionary Processors and Manufacturers', Name: 'Chocolate/Confectionery Mfg From Cacao Beans' },
|
|
15969
|
+
{ ID: '311352', Category: 'Sugar and Confectionary Processors and Manufacturers', Name: 'Confectionery Mfg From Purchased Chocolate' },
|
|
15970
|
+
{ ID: '311411', Category: 'Frozen Food Processors', Name: 'Frozen Fruit Juice & Vegetable Manufacturing' },
|
|
15971
|
+
{ ID: '311412', Category: 'Frozen Food Processors', Name: 'Frozen Specialty Food Manufacturing' },
|
|
15972
|
+
{ ID: '311421', Category: 'Canneries', Name: 'Fruit & Vegetable Canning' },
|
|
15973
|
+
{ ID: '311422', Category: 'Canneries', Name: 'Specialty Canning' },
|
|
15974
|
+
{ ID: '311423', Category: 'Canneries', Name: 'Dried & Dehydrated Food Manufacturing' },
|
|
15975
|
+
{ ID: '311511', Category: 'Dairy Processors', Name: 'Fluid Milk Manufacturing' },
|
|
15976
|
+
{ ID: '311512', Category: 'Dairy Processors', Name: 'Creamery Butter Manufacturing' },
|
|
15977
|
+
{ ID: '311513', Category: 'Dairy Processors', Name: 'Cheese Manufacturing' },
|
|
15978
|
+
{ ID: '311514', Category: 'Dairy Processors', Name: 'Dry Condensed & Evaporated Dairy Products Mfg' },
|
|
15979
|
+
{ ID: '311520', Category: 'Dairy Processors', Name: 'Ice Cream & Frozen Dessert Manufacturing' },
|
|
15980
|
+
{ ID: '311611', Category: 'Meat and Seafood Processors', Name: 'Animal (Except Poultry) Slaughtering' },
|
|
15981
|
+
{ ID: '311612', Category: 'Meat and Seafood Processors', Name: 'Meat Processed From Carcasses' },
|
|
15982
|
+
{ ID: '311613', Category: 'Meat and Seafood Processors', Name: 'Rendering & Meat Byproduct Processing' },
|
|
15983
|
+
{ ID: '311615', Category: 'Meat and Seafood Processors', Name: 'Poultry Processing' },
|
|
15984
|
+
{ ID: '311710', Category: 'Meat and Seafood Processors', Name: 'Seafood Product Preparation & Packaging' },
|
|
15985
|
+
{ ID: '311811', Category: 'Bakeries', Name: 'Retail Bakeries' },
|
|
15986
|
+
{ ID: '311812', Category: 'Bakeries', Name: 'Commercial Bakeries' },
|
|
15987
|
+
{ ID: '311813', Category: 'Bakeries', Name: 'Frozen Cakes Pies & Other Pastries Manufacturing' },
|
|
15988
|
+
{ ID: '311821', Category: 'Bakeries', Name: 'Cookie & Cracker Manufacturing' },
|
|
15989
|
+
{ ID: '311824', Category: 'Bakeries', Name: 'Dry Pasta Dough/Flour Mixes Mfg-Purchased Flour' },
|
|
15990
|
+
{ ID: '311911', Category: 'Snack Food Processors and Manufacturers', Name: 'Roasted Nuts & Peanut Butter Manufacturing' },
|
|
15991
|
+
{ ID: '311919', Category: 'Snack Food Processors and Manufacturers', Name: 'Other Snack Food Manufacturing' },
|
|
15992
|
+
{ ID: '311920', Category: 'Snack Food Processors and Manufacturers', Name: 'Coffee & Tea Manufacturing' },
|
|
15993
|
+
{ ID: '311930', Category: 'Syrups, Spices and Condiment Manufacturers', Name: 'Flavoring Syrup & Concentrate Manufacturing' },
|
|
15994
|
+
{ ID: '311941', Category: 'Syrups, Spices and Condiment Manufacturers', Name: 'Mayonnaise Dressing & Other Prepared Sauce Mfg' },
|
|
15995
|
+
{ ID: '311942', Category: 'Syrups, Spices and Condiment Manufacturers', Name: 'Spice & Extract Manufacturing' },
|
|
15996
|
+
{ ID: '311991', Category: 'Syrups, Spices and Condiment Manufacturers', Name: 'Perishable Prepared Food Manufacturing' },
|
|
15997
|
+
{ ID: '311999', Category: 'Syrups, Spices and Condiment Manufacturers', Name: 'All Other Miscellaneous Food Manufacturing' },
|
|
15998
|
+
{ ID: '312111', Category: 'Beverage Manufacturing', Name: 'Soft Drink Manufacturing' },
|
|
15999
|
+
{ ID: '312112', Category: 'Beverage Manufacturing', Name: 'Bottled Water Manufacturing' },
|
|
16000
|
+
{ ID: '312120', Category: 'Beverage Manufacturing', Name: 'Breweries' },
|
|
16001
|
+
{ ID: '312130', Category: 'Beverage Manufacturing', Name: 'Wineries' },
|
|
16002
|
+
{ ID: '312140', Category: 'Beverage Manufacturing', Name: 'Distilleries' },
|
|
16003
|
+
{ ID: '424420', Category: 'Wholesalers and Distributors', Name: 'Packaged Frozen Food Merchant Wholesalers' },
|
|
16004
|
+
{ ID: '424430', Category: 'Wholesalers and Distributors', Name: 'Dairy Product (Exc Dried Or Canned) Mrchnt Whlsrs' },
|
|
16005
|
+
{ ID: '424440', Category: 'Wholesalers and Distributors', Name: 'Poultry & Poultry Product Merchant Wholesalers' },
|
|
16006
|
+
{ ID: '424450', Category: 'Wholesalers and Distributors', Name: 'Confectionery Merchant Wholesalers' },
|
|
16007
|
+
{ ID: '424460', Category: 'Wholesalers and Distributors', Name: 'Fish & Seafood Merchant Wholesalers' },
|
|
16008
|
+
{ ID: '424470', Category: 'Wholesalers and Distributors', Name: 'Meat & Meat Product Merchant Wholesalers' },
|
|
16009
|
+
{ ID: '424480', Category: 'Wholesalers and Distributors', Name: 'Fresh Fruit & Vegetable Merchant Wholesalers' },
|
|
16010
|
+
{ ID: '424520', Category: 'Wholesalers and Distributors', Name: 'Livestock Merchant Wholesalers' },
|
|
16011
|
+
{ ID: '424820', Category: 'Wholesalers and Distributors', Name: 'Wine & Distilled Alcoholic Beverage Mrchnt Whlsrs' },
|
|
16012
|
+
{ ID: '445110', Category: 'Food and Beverage Retailers', Name: 'Supermarkets/Other Grocery (Exc Convenience) Strs' },
|
|
16013
|
+
{ ID: '445210', Category: 'Food and Beverage Retailers', Name: 'Meat Markets' },
|
|
16014
|
+
{ ID: '445220', Category: 'Food and Beverage Retailers', Name: 'Fish & Seafood Markets' },
|
|
16015
|
+
{ ID: '445230', Category: 'Food and Beverage Retailers', Name: 'Fruit & Vegetable Markets' },
|
|
16016
|
+
{ ID: '445291', Category: 'Food and Beverage Retailers', Name: 'Baked Goods Stores' },
|
|
16017
|
+
{ ID: '445292', Category: 'Food and Beverage Retailers', Name: 'Confectionery & Nut Stores' },
|
|
16018
|
+
{ ID: '445299', Category: 'Food and Beverage Retailers', Name: 'All Other Specialty Food Stores' },
|
|
16019
|
+
{ ID: '445310', Category: 'Food and Beverage Retailers', Name: 'Beer, Wine & Liquor Stores' },
|
|
16020
|
+
{ ID: '493120', Category: 'Cold Warehouseing and Storage Facilities', Name: 'Refrigerated Warehousing & Storage' },
|
|
16021
|
+
{ ID: '722310', Category: 'Food Services', Name: 'Food Service Contractors' },
|
|
16022
|
+
{ ID: '722320', Category: 'Food Services', Name: 'Caterers' },
|
|
16023
|
+
{ ID: '722330', Category: 'Food Services', Name: 'Mobile Food Services' },
|
|
16024
|
+
{ ID: '722511', Category: 'Restaurants and Eating and Drinking Establishments', Name: 'Full-Service Restaurants' },
|
|
16025
|
+
{ ID: '722513', Category: 'Restaurants and Eating and Drinking Establishments', Name: 'Limited-Service Restaurants' },
|
|
16026
|
+
{ ID: '722514', Category: 'Restaurants and Eating and Drinking Establishments', Name: 'Cafeterias, Grill Buffets & Buffets' },
|
|
16027
|
+
{ ID: '722515', Category: 'Restaurants and Eating and Drinking Establishments', Name: 'Snack & Nonalcoholic Beverage Bars' },
|
|
16028
|
+
{ ID: '424410', Category: 'Wholesalers', Name: 'General Line Grocery Merchant Wholesalers' },
|
|
16029
|
+
{ ID: '424490', Category: 'Wholesalers', Name: 'Other Grocery & Related Products Merchant Whlsrs' },
|
|
16030
|
+
{ ID: '424810', Category: 'Wholesalers', Name: 'Beer & Ale Merchant Wholesalers' },
|
|
16031
|
+
{ ID: '424930', Category: 'Wholesalers', Name: 'Nursery Stock/Florists Supls Mrchnt Whlsrs' },
|
|
16032
|
+
{ ID: '484220', Category: 'Trucking and Freight', Name: 'Specialized Freight (Exc Used Gds) Trucking Local' },
|
|
16033
|
+
{ ID: '484230', Category: 'Trucking and Freight', Name: 'Specialized Freight (Exc Used Gds) Trckng Lng-Dist' },
|
|
16034
|
+
{ ID: '722410', Category: 'Eating and Drinking Establishments', Name: 'Drinking Places Alcoholic Beverages' },
|
|
16035
|
+
].sort((a, b) => {
|
|
16036
|
+
return (a.Category + ' - ' + a.Name).localeCompare(b.Category + ' - ' + b.Name);
|
|
16037
|
+
});
|
|
16038
|
+
|
|
15614
16039
|
class SimpleMapper {
|
|
15615
16040
|
reset() {
|
|
15616
16041
|
if (this.map) {
|
|
@@ -15992,6 +16417,58 @@ class WatershedSettings {
|
|
|
15992
16417
|
autoSelectLayer = false;
|
|
15993
16418
|
}
|
|
15994
16419
|
|
|
16420
|
+
function isGeoloader(obj) {
|
|
16421
|
+
return typeof obj === 'object' &&
|
|
16422
|
+
obj !== null &&
|
|
16423
|
+
typeof obj.LoadBoundary === 'function';
|
|
16424
|
+
}
|
|
16425
|
+
function isMultiPolygon(obj) {
|
|
16426
|
+
return typeof obj === 'object' &&
|
|
16427
|
+
obj !== null &&
|
|
16428
|
+
obj.type === 'MultiPolygon';
|
|
16429
|
+
}
|
|
16430
|
+
function isPolygon(obj) {
|
|
16431
|
+
return typeof obj === 'object' &&
|
|
16432
|
+
obj !== null &&
|
|
16433
|
+
obj.type === 'Polygon';
|
|
16434
|
+
}
|
|
16435
|
+
function isNumber2DArray(input) {
|
|
16436
|
+
return Array.isArray(input) &&
|
|
16437
|
+
input.every(row => Array.isArray(row) &&
|
|
16438
|
+
row.every(cell => typeof cell === 'number'));
|
|
16439
|
+
}
|
|
16440
|
+
function isNumber3DArray(input) {
|
|
16441
|
+
return Array.isArray(input) &&
|
|
16442
|
+
input.every(matrix => Array.isArray(matrix) &&
|
|
16443
|
+
matrix.every(row => Array.isArray(row) &&
|
|
16444
|
+
row.every(cell => typeof cell === 'number')));
|
|
16445
|
+
}
|
|
16446
|
+
function toMultiPolygon(geom) {
|
|
16447
|
+
if (isMultiPolygon(geom)) {
|
|
16448
|
+
return geom;
|
|
16449
|
+
}
|
|
16450
|
+
if (isPolygon(geom)) {
|
|
16451
|
+
return {
|
|
16452
|
+
type: 'MultiPolygon',
|
|
16453
|
+
coordinates: [geom.coordinates]
|
|
16454
|
+
};
|
|
16455
|
+
}
|
|
16456
|
+
if (isNumber2DArray(geom)) {
|
|
16457
|
+
let raw = [geom];
|
|
16458
|
+
const coords = raw;
|
|
16459
|
+
return {
|
|
16460
|
+
type: 'MultiPolygon',
|
|
16461
|
+
coordinates: coords
|
|
16462
|
+
};
|
|
16463
|
+
}
|
|
16464
|
+
let raw = geom;
|
|
16465
|
+
const coords = raw;
|
|
16466
|
+
return {
|
|
16467
|
+
type: 'MultiPolygon',
|
|
16468
|
+
coordinates: coords
|
|
16469
|
+
};
|
|
16470
|
+
}
|
|
16471
|
+
|
|
15995
16472
|
class HttpBoundaryLoader {
|
|
15996
16473
|
static NewCustom(http, path) {
|
|
15997
16474
|
const loader = new HttpBoundaryLoader(http);
|
|
@@ -16096,5 +16573,5 @@ class HttpBoundaryLoader {
|
|
|
16096
16573
|
* Generated bundle index. Do not edit.
|
|
16097
16574
|
*/
|
|
16098
16575
|
|
|
16099
|
-
export { AddLayer, AddSource, AreaMapperMapper, BackgroundMaskMapper, BaseMapLight, BasemapSelect, BasemapSelectMenu, CensusTractMapper, CroplandDataLayerMapper, CroplandDataLayerSettings, CroplandLegend, DEFAULT_GLYPHS, DrawingMapper, EsriMapper, EsriSettings, HardinessMapper, HardinessSettings, HttpBoundaryLoader, MapAreaSelectComponent, MapComponent, MapSelectionService, MapService, MapStyles, MapboxMapperGroup, NAASMapper, NAASSettings, NoOpMapper, RemoveLayer, RemoveSource, SaveMap, SelectMode, SimpleMapper, StandardLayersMapper, Styles, VectorTileServerMapper, WatershedMapper, WatershedSettings, discoverLayers, isGeoloader, isMultiPolygon, isNumber2DArray, isNumber3DArray, isPolygon, mapboxLoadImages, mapboxloadImage, pmtilesPixelInfo, sampleTilesForLayers, simpleClone, toMultiPolygon, trySync };
|
|
16576
|
+
export { AddLayer, AddSource, AreaMapperMapper, BackgroundMaskMapper, BackgroundMaskSettings, BaseMapLight, BasemapSelect, BasemapSelectMenu, CensusTractMapper, Codes, CroplandDataLayerMapper, CroplandDataLayerSettings, CroplandLegend, DEFAULT_GLYPHS, DrawingMapper, EsriMapper, EsriSettings, HardinessMapper, HardinessSettings, HttpBoundaryLoader, MapAreaSelectComponent, MapComponent, MapSelectionService, MapService, MapStyles, MapboxMapperGroup, NAASMapper, NAASSettings, NaicsMapper, NaicsMapperSettings, NoOpMapper, RemoveLayer, RemoveSource, SaveMap, SelectMode, SimpleMapper, StandardLayersMapper, Styles, VectorTileServerMapper, WatershedMapper, WatershedSettings, discoverLayers, isGeoloader, isMultiPolygon, isNumber2DArray, isNumber3DArray, isPolygon, mapboxLoadImages, mapboxloadImage, pmtilesPixelInfo, sampleTilesForLayers, simpleClone, toMultiPolygon, trySync };
|
|
16100
16577
|
//# sourceMappingURL=foodmarketmaker-mapag.mjs.map
|