@ssplib/react-components 0.0.286 → 0.0.287

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.
@@ -6,6 +6,7 @@ interface DraggableMarkerProps {
6
6
  onChange?: (coord: LatLngExpression) => void;
7
7
  children?: ReactElement;
8
8
  showPopup?: boolean;
9
+ fixedPosition?: boolean;
9
10
  }
10
11
  export default function DraggableMarker({ ...props }: DraggableMarkerProps): JSX.Element;
11
12
  export {};
@@ -33,6 +33,8 @@ function DraggableMarker(_a) {
33
33
  }), []);
34
34
  (0, react_leaflet_1.useMapEvents)({
35
35
  click(e) {
36
+ if (props.fixedPosition)
37
+ return;
36
38
  setPosition({ lat: e.latlng.lat, lng: e.latlng.lng });
37
39
  },
38
40
  });
@@ -12,5 +12,6 @@ export interface MapProps {
12
12
  popupContent?: ReactElement;
13
13
  style?: BoxProps;
14
14
  mapStyle?: React.CSSProperties;
15
+ fixedPosition?: boolean;
15
16
  }
16
17
  export declare function Map(props: MapProps): JSX.Element;
@@ -18,6 +18,6 @@ function Map(props) {
18
18
  react_1.default.createElement(react_leaflet_1.MapContainer, { center: props.firstCoords, zoom: 19, scrollWheelZoom: true, style: props.mapStyle },
19
19
  react_1.default.createElement(react_leaflet_1.TileLayer, { attribution: '\u00A9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' }),
20
20
  props.pulseMarkerList && props.pulseMarkerList.map((coord, idx) => react_1.default.createElement(AnimatedMarker_1.default, { key: JSON.stringify(coord) + idx, coords: coord })),
21
- react_1.default.createElement(DraggableMarker_1.default, { startCoord: props.firstCoords, onChange: props.onCoordsChange, showPopup: typeof props.popupContent !== 'undefined' }, props.popupContent))));
21
+ react_1.default.createElement(DraggableMarker_1.default, { startCoord: props.firstCoords, onChange: props.onCoordsChange, showPopup: typeof props.popupContent !== 'undefined', fixedPosition: props.fixedPosition }, props.popupContent))));
22
22
  }
23
23
  exports.Map = Map;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.286",
3
+ "version": "0.0.287",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",