react-leaflet-semicircle
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -7,2 +7,10 @@ ### Changelog | ||
### [2.0.0](https://github.com/clementallen/react-leaflet-semicircle/compare/v1.0.1...v2.0.0) | ||
> 19 January 2019 | ||
- Remove wrapper functions around plugin [`#15`](https://github.com/clementallen/react-leaflet-semicircle/pull/15) | ||
- Added more component tests [`#14`](https://github.com/clementallen/react-leaflet-semicircle/pull/14) | ||
- Upgraded auto-changelog dependency [`6f87be7`](https://github.com/clementallen/react-leaflet-semicircle/commit/6f87be7ea37f464422ed491dd4c5dd9cf3ff678d) | ||
#### [1.0.1](https://github.com/clementallen/react-leaflet-semicircle/compare/v1.0.0...v1.0.1) | ||
@@ -9,0 +17,0 @@ |
@@ -47,9 +47,9 @@ "use strict"; | ||
key: "createLeafletElement", | ||
value: function createLeafletElement(props) { | ||
// props.leaflet is not used but destructured out so it's not passed to this.leafletComponent | ||
var position = props.position, | ||
leaflet = props.leaflet, | ||
options = _objectWithoutProperties(props, ["position", "leaflet"]); // eslint-disable-line no-unused-vars | ||
// props.leaflet is not used but destructured out so it's not passed to this.leafletComponent | ||
// eslint-disable-next-line no-unused-vars | ||
value: function createLeafletElement(_ref) { | ||
var position = _ref.position, | ||
leaflet = _ref.leaflet, | ||
options = _objectWithoutProperties(_ref, ["position", "leaflet"]); | ||
return new this.leafletComponent(position, options); | ||
@@ -59,30 +59,15 @@ } | ||
key: "updateLeafletElement", | ||
value: function updateLeafletElement(fromProps, _ref) { | ||
var startAngle = _ref.startAngle, | ||
stopAngle = _ref.stopAngle; | ||
value: function updateLeafletElement(fromProps, _ref2) { | ||
var startAngle = _ref2.startAngle, | ||
stopAngle = _ref2.stopAngle; | ||
if (fromProps.startAngle !== startAngle) { | ||
this.setStartAngle(startAngle); | ||
this.leafletElement.setStartAngle(startAngle); | ||
} | ||
if (fromProps.stopAngle !== stopAngle) { | ||
this.setStopAngle(stopAngle); | ||
this.leafletElement.setStopAngle(stopAngle); | ||
} | ||
} | ||
}, { | ||
key: "setDirection", | ||
value: function setDirection(direction, size) { | ||
this.leafletElement.setDirection(direction, size); | ||
} | ||
}, { | ||
key: "setStartAngle", | ||
value: function setStartAngle(angle) { | ||
this.leafletElement.setStartAngle(angle); | ||
} | ||
}, { | ||
key: "setStopAngle", | ||
value: function setStopAngle(angle) { | ||
this.leafletElement.setStopAngle(angle); | ||
} | ||
}, { | ||
key: "leafletComponent", | ||
@@ -89,0 +74,0 @@ get: function get() { |
{ | ||
"name": "react-leaflet-semicircle", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "React wrapper of leaflet-semicircle", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"coverage": "jest --coverage", | ||
"cover": "jest --coverage --collectCoverageFrom=src/**/*.js", | ||
"lint": "eslint ./src/**/*.js ./__tests__/**/*.js", | ||
@@ -43,3 +43,3 @@ "changelog": "auto-changelog -p --tag-prefix v", | ||
"@babel/preset-react": "^7.0.0", | ||
"auto-changelog": "^1.10.3", | ||
"auto-changelog": "^1.11.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
@@ -46,0 +46,0 @@ "babel-jest": "^23.6.0", |
@@ -17,3 +17,3 @@ # react-leaflet-semicircle | ||
_Tested with Leaflet 1.4.0 and React-Leaflet 2.1.4_ | ||
_Tested with Leaflet 1.4.0 and React-Leaflet 2.2.0_ | ||
@@ -79,3 +79,7 @@ ## Installation | ||
```javascript | ||
<SemiCircleMarker position={[51.505, -0.09]} startAngle={90} stopAngle={180} /> | ||
<SemiCircleMarker | ||
position={[51.505, -0.09]} | ||
startAngle={90} | ||
stopAngle={180 | ||
/> | ||
``` | ||
@@ -93,5 +97,5 @@ | ||
### Component methods | ||
### Additional component methods | ||
Each component comes with methods that can be accessed via [React Refs](https://reactjs.org/docs/refs-and-the-dom.html). | ||
Each component comes with additional methods that can be accessed via [React Refs](https://reactjs.org/docs/refs-and-the-dom.html). | ||
@@ -119,3 +123,3 @@ #### Setup | ||
```javascript | ||
this.semiCircleRef.current.setDirection(90, 90); | ||
this.semiCircleRef.current.leafletElement.setDirection(90, 90); | ||
``` | ||
@@ -125,6 +129,6 @@ | ||
Set the start angle of the semicircle to `angle` | ||
Use `setStartAngle(angle)` to set the start angle of the semicircle to `angle` | ||
```javascript | ||
this.semiCircleRef.current.setStartAngle(90); | ||
this.semiCircleRef.current.leafletElement.setStartAngle(90); | ||
``` | ||
@@ -134,6 +138,6 @@ | ||
Set the stop angle of the semicircle to `angle` | ||
Use `setStopAngle(angle)` to set the stop angle of the semicircle to `angle` | ||
```javascript | ||
this.semiCircleRef.current.setStopAngle(90); | ||
this.semiCircleRef.current.leafletElement.setStopAngle(90); | ||
``` |
@@ -5,5 +5,5 @@ import { Path } from 'react-leaflet'; | ||
export default class AbstractComponent extends Path { | ||
createLeafletElement(props) { | ||
// props.leaflet is not used but destructured out so it's not passed to this.leafletComponent | ||
const { position, leaflet, ...options } = props; // eslint-disable-line no-unused-vars | ||
// props.leaflet is not used but destructured out so it's not passed to this.leafletComponent | ||
// eslint-disable-next-line no-unused-vars | ||
createLeafletElement({ position, leaflet, ...options }) { | ||
return new this.leafletComponent(position, options); | ||
@@ -14,21 +14,9 @@ } | ||
if (fromProps.startAngle !== startAngle) { | ||
this.setStartAngle(startAngle); | ||
this.leafletElement.setStartAngle(startAngle); | ||
} | ||
if (fromProps.stopAngle !== stopAngle) { | ||
this.setStopAngle(stopAngle); | ||
this.leafletElement.setStopAngle(stopAngle); | ||
} | ||
} | ||
setDirection(direction, size) { | ||
this.leafletElement.setDirection(direction, size); | ||
} | ||
setStartAngle(angle) { | ||
this.leafletElement.setStartAngle(angle); | ||
} | ||
setStopAngle(angle) { | ||
this.leafletElement.setStopAngle(angle); | ||
} | ||
get leafletComponent() { | ||
@@ -35,0 +23,0 @@ throw new Error('leafletComponent getter not implemented'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25535
13
138
184