-
Notifications
You must be signed in to change notification settings - Fork 19
Edit and rotate #334
Edit and rotate #334
Conversation
fix selection |
src/FeatureEditor/FeatureEditor.js
Outdated
const geometry = editFeatures.getArray()[0].getGeometry() | ||
const rotationDiff = val - rotation | ||
|
||
this.setState({ rotation: val }, () => geometry.rotate(-rotationDiff * (Math.PI / 45), anchor)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ 180
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment the weirdness
src/Popup/Popup.js
Outdated
map.getTargetElement() | ||
) | ||
) | ||
ReactDOM.createPortal( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert these changes, make Feature Editor a peer of Popup, and pass the editFeature from the edit action item to the FeatureEditor through context.
src/Map/Map.js
Outdated
@@ -158,6 +158,7 @@ class Map extends React.Component { | |||
|
|||
Map.defaultProps = { | |||
addMapToContext: () => {}, | |||
onEdit: () => {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
src/Popup/Popup.js
Outdated
|
||
// stop tracking movement when popup show is set to false | ||
this.movementListener && removeMovementListener(this.movementListener) | ||
|
||
this.setState({ ...this.defaultState }, () => onMapClick(this.state)) | ||
this.setState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
onClick = () => { | ||
const { addEditFeatureToContext, feature } = this.props | ||
|
||
addEditFeatureToContext(feature) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call callback... just in case
const { addEditFeatureToContext, feature, onEdit } = this.props | ||
|
||
addEditFeatureToContext(feature) | ||
onEdit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass feature through
Resolves: attach_gh_issue_here
PR Safety Checklist:
package.json
&package-lock.json
version numbers to appropriate releasenpm run docs
Quick Description of Changes (+ screenshots for ui changes):