react-spatial 1.8.1 → 1.8.2-beta.0

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.
@@ -147,7 +147,7 @@ class Geolocation extends PureComponent {
147
147
  this.projection
148
148
  );
149
149
  this.point.setCoordinates(position);
150
- if (this.isRecenteringToPosition) {
150
+ if (alwaysRecenterToPosition && this.isRecenteringToPosition) {
151
151
  map.getView().setCenter(position);
152
152
  if (!alwaysRecenterToPosition) {
153
153
  this.isRecenteringToPosition = false;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Geolocation/Geolocation.js"],
4
- "sourcesContent": ["import React, { PureComponent } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport OLMap from \"ol/Map\";\nimport { transform } from \"ol/proj\";\nimport Point from \"ol/geom/Point\";\nimport Feature from \"ol/Feature\";\nimport { unByKey } from \"ol/Observable\";\n\nimport Style from \"ol/style/Style\";\nimport Circle from \"ol/style/Circle\";\nimport Fill from \"ol/style/Fill\";\nimport Stroke from \"ol/style/Stroke\";\n\nimport VectorLayer from \"ol/layer/Vector\";\nimport VectorSource from \"ol/source/Vector\";\n\nimport { FaRegDotCircle } from \"react-icons/fa\";\n\nconst propTypes = {\n /**\n * CSS class of the button.\n */\n className: PropTypes.string,\n\n /**\n * Children content of the Geolocation button.\n */\n children: PropTypes.node,\n\n /**\n * An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * Function triggered when geolocating is not successful.\n */\n onError: PropTypes.func,\n\n /**\n * Function triggered after successful geoLocation calls. Takes the ol/map, the current lat/lon coordinate and the component instance as arguments.\n */\n onSuccess: PropTypes.func,\n\n /**\n * Function triggered after the geolocation is activated. Takes the ol/map and the component instance as arguments.\n */\n onActivate: PropTypes.func,\n\n /**\n * Function triggered after the geolocation is deactivated. Takes the ol/map and the component instance as arguments..\n */\n onDeactivate: PropTypes.func,\n\n /**\n * If true, the map is not centered after it has been dragged once.\n */\n noCenterAfterDrag: PropTypes.bool,\n\n /**\n * If true, the map will constantly recenter to the current Position\n */\n alwaysRecenterToPosition: PropTypes.bool,\n\n /**\n * Color (Number array with rgb values) or style function.\n * If a color is given, the style is animated.\n */\n colorOrStyleFunc: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.number),\n PropTypes.func,\n ]),\n};\n\nconst defaultProps = {\n className: \"rs-geolocation\",\n children: <FaRegDotCircle focusable={false} />,\n onError: () => {},\n onSuccess: () => {},\n onActivate: () => {},\n onDeactivate: () => {},\n noCenterAfterDrag: false,\n alwaysRecenterToPosition: true,\n colorOrStyleFunc: [235, 0, 0],\n};\n\n/**\n * The GeoLocation component creates a button to display the current device's location on an\n * [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\nclass Geolocation extends PureComponent {\n constructor(props) {\n super(props);\n\n this.layer = new VectorLayer({\n source: new VectorSource(),\n });\n\n this.isRecenteringToPosition = true;\n\n this.state = {\n active: false,\n };\n this.point = undefined;\n }\n\n componentWillUnmount() {\n this.deactivate();\n }\n\n toggle() {\n const { active } = this.state;\n const { onError } = this.props;\n const geolocation = \"geolocation\" in navigator;\n\n if (!geolocation) {\n onError();\n } else if (!active) {\n this.activate();\n } else {\n this.deactivate();\n }\n }\n\n error() {\n const { onError } = this.props;\n\n this.deactivate();\n onError();\n }\n\n deactivate() {\n const { map, onDeactivate } = this.props;\n window.clearInterval(this.interval);\n this.layer.setMap(null);\n navigator.geolocation.clearWatch(this.watch);\n\n this.setState({\n active: false,\n });\n\n this.isRecenteringToPosition = true;\n this.point = undefined;\n onDeactivate(map, this);\n unByKey(this.dragListener);\n }\n\n activate() {\n const { map, noCenterAfterDrag, onActivate } = this.props;\n\n this.projection = map.getView().getProjection().getCode();\n this.point = new Point([0, 0]);\n this.highlight();\n this.layer.setMap(map);\n this.setState({ active: true });\n\n this.watch = navigator.geolocation.watchPosition(\n this.update.bind(this),\n this.error.bind(this),\n {\n enableHighAccuracy: true,\n },\n );\n\n if (noCenterAfterDrag) {\n this.dragListener = map.on(\"pointerdrag\", () => {\n this.isRecenteringToPosition = false;\n });\n }\n\n onActivate(map, this);\n }\n\n update({ coords: { latitude, longitude } }) {\n const { map, alwaysRecenterToPosition, onSuccess } = this.props;\n\n const position = transform(\n [longitude, latitude],\n \"EPSG:4326\",\n this.projection,\n );\n this.point.setCoordinates(position);\n\n if (this.isRecenteringToPosition) {\n map.getView().setCenter(position);\n if (!alwaysRecenterToPosition) {\n this.isRecenteringToPosition = false;\n }\n }\n\n onSuccess(map, [latitude, longitude], this);\n }\n\n highlight() {\n const { colorOrStyleFunc } = this.props;\n const feature = new Feature({\n geometry: this.point,\n });\n\n if (Array.isArray(colorOrStyleFunc)) {\n const color = colorOrStyleFunc;\n\n let decrease = true;\n let opacity = 0.5;\n let rotation = 0;\n\n window.clearInterval(this.interval);\n this.interval = window.setInterval(() => {\n rotation += 0.03;\n decrease = opacity < 0.1 ? false : decrease;\n decrease = opacity > 0.5 ? true : decrease;\n opacity += decrease ? -0.03 : 0.03;\n if (feature) {\n feature.changed();\n }\n }, 50);\n\n feature.setStyle(() => {\n const circleStyle = new Style({\n image: new Circle({\n radius: 20,\n rotation,\n fill: new Fill({\n color: \"rgba(255, 255, 255, 0.01)\",\n }),\n stroke: new Stroke({\n lineDash: [30, 10],\n width: 6,\n color: `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${opacity})`,\n }),\n }),\n });\n\n circleStyle.getImage().setRotation(rotation);\n\n return [\n new Style({\n image: new Circle({\n radius: 10,\n fill: new Fill({\n color: `rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.5)`,\n }),\n }),\n }),\n circleStyle,\n ];\n });\n } else {\n feature.setStyle(colorOrStyleFunc);\n }\n\n this.layer.getSource().clear();\n this.layer.getSource().addFeature(feature);\n }\n\n render() {\n const { children, className } = this.props;\n // Remove component props from other HTML props.\n const other = Object.entries(this.props).reduce((props, [key, value]) => {\n return propTypes[key] ? props : { ...props, [key]: value };\n }, {});\n const { active } = this.state;\n\n return (\n <div\n role=\"button\"\n tabIndex=\"0\"\n className={`${className} ${active ? \"rs-active\" : \"\"}`}\n onClick={() => {\n return this.toggle();\n }}\n onKeyPress={(e) => {\n return e.which === 13 && this.toggle();\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...other}\n >\n {children}\n </div>\n );\n }\n}\n\nGeolocation.propTypes = propTypes;\nGeolocation.defaultProps = defaultProps;\n\nexport default Geolocation;\n"],
5
- "mappings": "AAAA,OAAO,SAAS,qBAAqB;AACrC,OAAO,eAAe;AAEtB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,OAAO,WAAW;AAClB,OAAO,aAAa;AACpB,SAAS,eAAe;AAExB,OAAO,WAAW;AAClB,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,YAAY;AAEnB,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AAEzB,SAAS,sBAAsB;AAE/B,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,EAIhB,WAAW,UAAU;AAAA;AAAA;AAAA;AAAA,EAKrB,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA,EAKpB,KAAK,UAAU,WAAW,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA,EAKjC,SAAS,UAAU;AAAA;AAAA;AAAA;AAAA,EAKnB,WAAW,UAAU;AAAA;AAAA;AAAA;AAAA,EAKrB,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAKtB,cAAc,UAAU;AAAA;AAAA;AAAA;AAAA,EAKxB,mBAAmB,UAAU;AAAA;AAAA;AAAA;AAAA,EAK7B,0BAA0B,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpC,kBAAkB,UAAU,UAAU;AAAA,IACpC,UAAU,QAAQ,UAAU,MAAM;AAAA,IAClC,UAAU;AAAA,EACZ,CAAC;AACH;AAEA,MAAM,eAAe;AAAA,EAC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U,UAAU,IAAI,KAAK;AAErC,UAAM,QAAQ,OAAO,QAAQ,KAAK,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,KAAK,MAAM;AACvE,aAAO,UAAU,GAAG,IAAI,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,MAAM;AAAA,IAC3D,GAAG,CAAC,CAAC;AACL,UAAM,EAAE,OAAO,IAAI,KAAK;AAExB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAS;AAAA,QACT,WAAW,GAAG,SAAS,IAAI,SAAS,cAAc,EAAE;AAAA,QACpD,SAAS,MAAM;AACb,iBAAO,KAAK,OAAO;AAAA,QACrB;AAAA,QACA,YAAY,CAAC,MAAM;AACjB,iBAAO,EAAE,UAAU,MAAM,KAAK,OAAO;AAAA,QACvC;AAAA,QAEC,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,YAAY;AACxB,YAAY,eAAe;AAE3B,eAAe;",
4
+ "sourcesContent": ["import React, { PureComponent } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport OLMap from \"ol/Map\";\nimport { transform } from \"ol/proj\";\nimport Point from \"ol/geom/Point\";\nimport Feature from \"ol/Feature\";\nimport { unByKey } from \"ol/Observable\";\n\nimport Style from \"ol/style/Style\";\nimport Circle from \"ol/style/Circle\";\nimport Fill from \"ol/style/Fill\";\nimport Stroke from \"ol/style/Stroke\";\n\nimport VectorLayer from \"ol/layer/Vector\";\nimport VectorSource from \"ol/source/Vector\";\n\nimport { FaRegDotCircle } from \"react-icons/fa\";\n\nconst propTypes = {\n /**\n * CSS class of the button.\n */\n className: PropTypes.string,\n\n /**\n * Children content of the Geolocation button.\n */\n children: PropTypes.node,\n\n /**\n * An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * Function triggered when geolocating is not successful.\n */\n onError: PropTypes.func,\n\n /**\n * Function triggered after successful geoLocation calls. Takes the ol/map, the current lat/lon coordinate and the component instance as arguments.\n */\n onSuccess: PropTypes.func,\n\n /**\n * Function triggered after the geolocation is activated. Takes the ol/map and the component instance as arguments.\n */\n onActivate: PropTypes.func,\n\n /**\n * Function triggered after the geolocation is deactivated. Takes the ol/map and the component instance as arguments..\n */\n onDeactivate: PropTypes.func,\n\n /**\n * If true, the map is not centered after it has been dragged once.\n */\n noCenterAfterDrag: PropTypes.bool,\n\n /**\n * If true, the map will constantly recenter to the current Position\n */\n alwaysRecenterToPosition: PropTypes.bool,\n\n /**\n * Color (Number array with rgb values) or style function.\n * If a color is given, the style is animated.\n */\n colorOrStyleFunc: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.number),\n PropTypes.func,\n ]),\n};\n\nconst defaultProps = {\n className: \"rs-geolocation\",\n children: <FaRegDotCircle focusable={false} />,\n onError: () => {},\n onSuccess: () => {},\n onActivate: () => {},\n onDeactivate: () => {},\n noCenterAfterDrag: false,\n alwaysRecenterToPosition: true,\n colorOrStyleFunc: [235, 0, 0],\n};\n\n/**\n * The GeoLocation component creates a button to display the current device's location on an\n * [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\nclass Geolocation extends PureComponent {\n constructor(props) {\n super(props);\n\n this.layer = new VectorLayer({\n source: new VectorSource(),\n });\n\n this.isRecenteringToPosition = true;\n\n this.state = {\n active: false,\n };\n this.point = undefined;\n }\n\n componentWillUnmount() {\n this.deactivate();\n }\n\n toggle() {\n const { active } = this.state;\n const { onError } = this.props;\n const geolocation = \"geolocation\" in navigator;\n\n if (!geolocation) {\n onError();\n } else if (!active) {\n this.activate();\n } else {\n this.deactivate();\n }\n }\n\n error() {\n const { onError } = this.props;\n\n this.deactivate();\n onError();\n }\n\n deactivate() {\n const { map, onDeactivate } = this.props;\n window.clearInterval(this.interval);\n this.layer.setMap(null);\n navigator.geolocation.clearWatch(this.watch);\n\n this.setState({\n active: false,\n });\n\n this.isRecenteringToPosition = true;\n this.point = undefined;\n onDeactivate(map, this);\n unByKey(this.dragListener);\n }\n\n activate() {\n const { map, noCenterAfterDrag, onActivate } = this.props;\n\n this.projection = map.getView().getProjection().getCode();\n this.point = new Point([0, 0]);\n this.highlight();\n this.layer.setMap(map);\n this.setState({ active: true });\n\n this.watch = navigator.geolocation.watchPosition(\n this.update.bind(this),\n this.error.bind(this),\n {\n enableHighAccuracy: true,\n },\n );\n\n if (noCenterAfterDrag) {\n this.dragListener = map.on(\"pointerdrag\", () => {\n this.isRecenteringToPosition = false;\n });\n }\n\n onActivate(map, this);\n }\n\n update({ coords: { latitude, longitude } }) {\n const { map, alwaysRecenterToPosition, onSuccess } = this.props;\n\n const position = transform(\n [longitude, latitude],\n \"EPSG:4326\",\n this.projection,\n );\n this.point.setCoordinates(position);\n\n if (alwaysRecenterToPosition && this.isRecenteringToPosition) {\n map.getView().setCenter(position);\n if (!alwaysRecenterToPosition) {\n this.isRecenteringToPosition = false;\n }\n }\n\n onSuccess(map, [latitude, longitude], this);\n }\n\n highlight() {\n const { colorOrStyleFunc } = this.props;\n const feature = new Feature({\n geometry: this.point,\n });\n\n if (Array.isArray(colorOrStyleFunc)) {\n const color = colorOrStyleFunc;\n\n let decrease = true;\n let opacity = 0.5;\n let rotation = 0;\n\n window.clearInterval(this.interval);\n this.interval = window.setInterval(() => {\n rotation += 0.03;\n decrease = opacity < 0.1 ? false : decrease;\n decrease = opacity > 0.5 ? true : decrease;\n opacity += decrease ? -0.03 : 0.03;\n if (feature) {\n feature.changed();\n }\n }, 50);\n\n feature.setStyle(() => {\n const circleStyle = new Style({\n image: new Circle({\n radius: 20,\n rotation,\n fill: new Fill({\n color: \"rgba(255, 255, 255, 0.01)\",\n }),\n stroke: new Stroke({\n lineDash: [30, 10],\n width: 6,\n color: `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${opacity})`,\n }),\n }),\n });\n\n circleStyle.getImage().setRotation(rotation);\n\n return [\n new Style({\n image: new Circle({\n radius: 10,\n fill: new Fill({\n color: `rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.5)`,\n }),\n }),\n }),\n circleStyle,\n ];\n });\n } else {\n feature.setStyle(colorOrStyleFunc);\n }\n\n this.layer.getSource().clear();\n this.layer.getSource().addFeature(feature);\n }\n\n render() {\n const { children, className } = this.props;\n // Remove component props from other HTML props.\n const other = Object.entries(this.props).reduce((props, [key, value]) => {\n return propTypes[key] ? props : { ...props, [key]: value };\n }, {});\n const { active } = this.state;\n\n return (\n <div\n role=\"button\"\n tabIndex=\"0\"\n className={`${className} ${active ? \"rs-active\" : \"\"}`}\n onClick={() => {\n return this.toggle();\n }}\n onKeyPress={(e) => {\n return e.which === 13 && this.toggle();\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...other}\n >\n {children}\n </div>\n );\n }\n}\n\nGeolocation.propTypes = propTypes;\nGeolocation.defaultProps = defaultProps;\n\nexport default Geolocation;\n"],
5
+ "mappings": "AAAA,OAAO,SAAS,qBAAqB;AACrC,OAAO,eAAe;AAEtB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,OAAO,WAAW;AAClB,OAAO,aAAa;AACpB,SAAS,eAAe;AAExB,OAAO,WAAW;AAClB,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,YAAY;AAEnB,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AAEzB,SAAS,sBAAsB;AAE/B,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,EAIhB,WAAW,UAAU;AAAA;AAAA;AAAA;AAAA,EAKrB,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA,EAKpB,KAAK,UAAU,WAAW,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA,EAKjC,SAAS,UAAU;AAAA;AAAA;AAAA;AAAA,EAKnB,WAAW,UAAU;AAAA;AAAA;AAAA;AAAA,EAKrB,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAKtB,cAAc,UAAU;AAAA;AAAA;AAAA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AAC;AAAA,UACH,CAAC;AAAA,UACD;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AACL,cAAQ,SAAS,gBAAgB;AAAA,IACnC;AAEA,SAAK,MAAM,UAAU,EAAE,MAAM;AAC7B,SAAK,MAAM,UAAU,EAAE,WAAW,OAAO;AAAA,EAC3C;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,UAAU,UAAU,IAAI,KAAK;AAErC,UAAM,QAAQ,OAAO,QAAQ,KAAK,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,KAAK,MAAM;AACvE,aAAO,UAAU,GAAG,IAAI,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,MAAM;AAAA,IAC3D,GAAG,CAAC,CAAC;AACL,UAAM,EAAE,OAAO,IAAI,KAAK;AAExB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAS;AAAA,QACT,WAAW,GAAG,SAAS,IAAI,SAAS,cAAc,EAAE;AAAA,QACpD,SAAS,MAAM;AACb,iBAAO,KAAK,OAAO;AAAA,QACrB;AAAA,QACA,YAAY,CAAC,MAAM;AACjB,iBAAO,EAAE,UAAU,MAAM,KAAK,OAAO;AAAA,QACvC;AAAA,QAEC,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,YAAY;AACxB,YAAY,eAAe;AAE3B,eAAe;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-spatial",
3
3
  "license": "MIT",
4
4
  "description": "Components to build React map apps.",
5
- "version": "1.8.1",
5
+ "version": "1.8.2-beta.0",
6
6
  "dependencies": {
7
7
  "@geops/geops-ui": "0.1.18",
8
8
  "@material-ui/core": "4.12.4",
@@ -67,7 +67,7 @@
67
67
  "mobility-toolbox-js": "2.3.7",
68
68
  "ol": "8.2.0",
69
69
  "postcss": "^8.4.33",
70
- "prettier": "3.1.1",
70
+ "prettier": "3.2.4",
71
71
  "proj4": "2.10.0",
72
72
  "prop-types": "15.8.1",
73
73
  "react": "18",
@@ -75,8 +75,8 @@
75
75
  "react-styleguidist": "13.1.1",
76
76
  "react-svg-loader": "3.0.3",
77
77
  "react-test-renderer": "18.2.0",
78
- "sass": "1.69.7",
79
- "sass-loader": "13.3.3",
78
+ "sass": "1.70.0",
79
+ "sass-loader": "14.0.0",
80
80
  "standard-version": "9.5.0",
81
81
  "stream-array": "1.1.2",
82
82
  "style-loader": "3.3.4",