@performant-software/geospatial 1.1.5-beta.2 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/geospatial",
3
- "version": "1.1.5-beta.2",
3
+ "version": "1.1.5",
4
4
  "description": "TODO: ADD",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",
@@ -1,7 +1,7 @@
1
1
  // @flow
2
2
 
3
- import React, { useEffect, useMemo } from 'react';
4
3
  import { MixedGeoJSONLayer, PulsingMarkerLayer, type Map } from '@peripleo/maplibre';
4
+ import React, { useEffect } from 'react';
5
5
  import { DEFAULT_FILL_STYLE, DEFAULT_POINT_STYLE, DEFAULT_STROKE_STYLE } from '../utils/MapStyles';
6
6
  import MapUtils from '../utils/Map';
7
7
 
@@ -22,19 +22,19 @@ type Props = {
22
22
  fillStyle?: { [key: string]: any },
23
23
 
24
24
  /**
25
- * GeoJSON layer point style.
25
+ * TOOD: Comment me.
26
26
  */
27
- pointStyle?: { [key: string]: any },
27
+ map?: Map,
28
28
 
29
29
  /**
30
- * GeoJSON layer stroke style
30
+ * GeoJSON layer point style.
31
31
  */
32
- strokeStyle?: { [key: string]: any },
32
+ pointStyle?: { [key: string]: any },
33
33
 
34
34
  /**
35
- * Hook used to retrieve the map instance.
35
+ * GeoJSON layer stroke style
36
36
  */
37
- useMap?: () => Map
37
+ strokeStyle?: { [key: string]: any }
38
38
  };
39
39
 
40
40
  const DEFAULT_BUFFER = 2;
@@ -43,17 +43,15 @@ const DEFAULT_BUFFER = 2;
43
43
  * This component renders a location marker to be used in a Peripleo context.
44
44
  */
45
45
  const LocationMarker = (props: Props) => {
46
- const map = useMemo(() => props.useMap(), [props.useMap]);
47
-
48
46
  /**
49
47
  * Sets the bounding box on the map.
50
48
  */
51
49
  useEffect(() => {
52
- if (map && props.data) {
50
+ if (props.map && props.data) {
53
51
  const boundingBox = MapUtils.getBoundingBox(props.data, props.buffer);
54
- map.fitBounds(boundingBox);
52
+ props.map.fitBounds(boundingBox);
55
53
  }
56
- }, [map, props.buffer, props.data]);
54
+ }, [props.buffer, props.data, props.map]);
57
55
 
58
56
  return (
59
57
  <>