@xyo-network/react-map 2.67.6 → 2.67.7
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/dist/browser/Components/MapBoxPoints.d.cts.map +1 -1
- package/dist/browser/Components/MapBoxPoints.d.mts.map +1 -1
- package/dist/browser/Components/MapBoxPoints.d.ts.map +1 -1
- package/dist/browser/MapBoxClasses/MapHeat.d.cts.map +1 -1
- package/dist/browser/MapBoxClasses/MapHeat.d.mts.map +1 -1
- package/dist/browser/MapBoxClasses/MapHeat.d.ts.map +1 -1
- package/dist/browser/MapBoxClasses/MapPoints.d.cts.map +1 -1
- package/dist/browser/MapBoxClasses/MapPoints.d.mts.map +1 -1
- package/dist/browser/MapBoxClasses/MapPoints.d.ts.map +1 -1
- package/dist/browser/MapBoxClasses/MapSettings.d.cts.map +1 -1
- package/dist/browser/MapBoxClasses/MapSettings.d.mts.map +1 -1
- package/dist/browser/MapBoxClasses/MapSettings.d.ts.map +1 -1
- package/dist/browser/index.cjs +29 -34
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +29 -34
- package/dist/browser/index.js.map +1 -1
- package/dist/node/Components/MapBoxPoints.d.cts.map +1 -1
- package/dist/node/Components/MapBoxPoints.d.mts.map +1 -1
- package/dist/node/Components/MapBoxPoints.d.ts.map +1 -1
- package/dist/node/MapBoxClasses/MapHeat.d.cts.map +1 -1
- package/dist/node/MapBoxClasses/MapHeat.d.mts.map +1 -1
- package/dist/node/MapBoxClasses/MapHeat.d.ts.map +1 -1
- package/dist/node/MapBoxClasses/MapPoints.d.cts.map +1 -1
- package/dist/node/MapBoxClasses/MapPoints.d.mts.map +1 -1
- package/dist/node/MapBoxClasses/MapPoints.d.ts.map +1 -1
- package/dist/node/MapBoxClasses/MapSettings.d.cts.map +1 -1
- package/dist/node/MapBoxClasses/MapSettings.d.mts.map +1 -1
- package/dist/node/MapBoxClasses/MapSettings.d.ts.map +1 -1
- package/dist/node/index.cjs +29 -34
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +29 -34
- package/dist/node/index.js.map +1 -1
- package/package.json +10 -10
- package/src/Components/AnimatedHeatMapLoaded.tsx +3 -3
- package/src/Components/LayerAnimator.tsx +4 -4
- package/src/Components/MapBoxPoints.tsx +5 -8
- package/src/Contexts/HeatMapInitializer/Provider.tsx +1 -1
- package/src/MapBoxClasses/MapHeat.ts +9 -8
- package/src/MapBoxClasses/MapPoints.ts +1 -0
- package/src/MapBoxClasses/MapSettings.ts +6 -10
- package/src/hooks/useDynamicPositioning.tsx +2 -2
- package/src/hooks/useQuadKeyPayloadsToFeatures.tsx +1 -1
|
@@ -29,12 +29,13 @@ export class MapHeat extends MapBase<Polygon> {
|
|
|
29
29
|
} else {
|
|
30
30
|
bounds = new LngLatBounds()
|
|
31
31
|
|
|
32
|
+
// eslint-disable-next-line unicorn/no-array-for-each
|
|
32
33
|
features.forEach((feature: Feature<Polygon>) => {
|
|
33
|
-
feature.geometry.coordinates
|
|
34
|
-
|
|
34
|
+
for (const coordinates of feature.geometry.coordinates) {
|
|
35
|
+
for (const position of coordinates) {
|
|
35
36
|
bounds.extend(position as [number, number])
|
|
36
|
-
}
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
38
39
|
})
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -61,9 +62,9 @@ export class MapHeat extends MapBase<Polygon> {
|
|
|
61
62
|
this.updateLayer(map, layers[0], sources[0])
|
|
62
63
|
this.updateLayer(map, layers[1], sources[1])
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
for (const layer of layers) {
|
|
65
66
|
map.setPaintProperty(layer.id, 'fill-opacity', 0)
|
|
66
|
-
}
|
|
67
|
+
}
|
|
67
68
|
|
|
68
69
|
const frameLength = 3000
|
|
69
70
|
const initialPad = 0.5
|
|
@@ -161,7 +162,7 @@ export class MapHeat extends MapBase<Polygon> {
|
|
|
161
162
|
return GeoJson.featuresSource(featuresCollection)
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
layers.
|
|
165
|
+
for (const [index, layer] of layers.entries()) {
|
|
165
166
|
const existingSource = this.config.map.getSource(layer.source as string) as GeoJSONSource
|
|
166
167
|
const source = getSource(index)
|
|
167
168
|
if (existingSource) {
|
|
@@ -170,7 +171,7 @@ export class MapHeat extends MapBase<Polygon> {
|
|
|
170
171
|
this.config.map.addSource(layer.source as string, source)
|
|
171
172
|
}
|
|
172
173
|
layer.update(this.config.map, true)
|
|
173
|
-
}
|
|
174
|
+
}
|
|
174
175
|
|
|
175
176
|
return this
|
|
176
177
|
}
|
|
@@ -24,6 +24,7 @@ export class MapPoints extends MapBase<Point> {
|
|
|
24
24
|
} else {
|
|
25
25
|
bounds = new LngLatBounds()
|
|
26
26
|
|
|
27
|
+
// eslint-disable-next-line unicorn/no-array-for-each
|
|
27
28
|
this.config.features.forEach((feature: Feature<Point>) => {
|
|
28
29
|
bounds.extend(feature.geometry.coordinates as [number, number])
|
|
29
30
|
})
|
|
@@ -57,9 +57,9 @@ export class MapSettings {
|
|
|
57
57
|
if (value) {
|
|
58
58
|
// initial values
|
|
59
59
|
this.mapListeners.logData(undefined, map)
|
|
60
|
-
|
|
60
|
+
for (const event of debugEvents) map.on(event, this.mapListeners.logData)
|
|
61
61
|
} else {
|
|
62
|
-
|
|
62
|
+
for (const event of debugEvents) map.off(event, this.mapListeners.logData)
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -102,10 +102,8 @@ export class MapSettings {
|
|
|
102
102
|
this.geoLocateControl = this.geoLocateControl || geolocateControl
|
|
103
103
|
this.navControl = this.navControl || navControl
|
|
104
104
|
|
|
105
|
-
if (!map.hasControl(this.geoLocateControl)) {
|
|
106
|
-
|
|
107
|
-
map.addControl(this.geoLocateControl)
|
|
108
|
-
}
|
|
105
|
+
if (!map.hasControl(this.geoLocateControl) && requestLocation) {
|
|
106
|
+
map.addControl(this.geoLocateControl)
|
|
109
107
|
}
|
|
110
108
|
|
|
111
109
|
if (!map.hasControl(this.navControl)) {
|
|
@@ -116,10 +114,8 @@ export class MapSettings {
|
|
|
116
114
|
}
|
|
117
115
|
|
|
118
116
|
private static removeControls(map: Map) {
|
|
119
|
-
if (this.geoLocateControl && map.hasControl(this.geoLocateControl)) {
|
|
120
|
-
|
|
121
|
-
map.removeControl(this.geoLocateControl)
|
|
122
|
-
}
|
|
117
|
+
if (this.geoLocateControl && map.hasControl(this.geoLocateControl) && this.requestLocation) {
|
|
118
|
+
map.removeControl(this.geoLocateControl)
|
|
123
119
|
}
|
|
124
120
|
|
|
125
121
|
if (this.navControl && map.hasControl(this.navControl)) {
|
|
@@ -22,8 +22,8 @@ const defaultAspectRatioRange = [0.5, 2]
|
|
|
22
22
|
*
|
|
23
23
|
* Note: Values are based off the zoom level
|
|
24
24
|
*/
|
|
25
|
-
const latRange = [0.
|
|
26
|
-
const lngRange = [-81.
|
|
25
|
+
const latRange = [0.912_164_420_526_366_4, 1.717_850_315_594_39]
|
|
26
|
+
const lngRange = [-81.474_201_485_195_9, 12.788_958_675_506_933]
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Function to interpolate an aspect ratio value across a range of degrees and aspect ratios
|
|
@@ -29,7 +29,7 @@ const useQuadKeyPayloadsToFeatures = (payloads?: NetworkLocationHeatmapQuadkeyAn
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
// Convert Multiple Payloads from Quadkey to GeoJson
|
|
31
31
|
if (Array.isArray(payloads)) {
|
|
32
|
-
if (compact(payloads).length
|
|
32
|
+
if (compact(payloads).length > 0) {
|
|
33
33
|
const mappedFeatures = payloads?.map((payload) => payload?.result.map(quadKeyToFeature))
|
|
34
34
|
|
|
35
35
|
setMultipleFeatureSets(mappedFeatures.map((features) => features?.map(setDensity) ?? []))
|