Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Edit and rotate #334

Merged
merged 15 commits into from
Oct 27, 2021
Merged

Edit and rotate #334

merged 15 commits into from
Oct 27, 2021

Conversation

PatchesMaps
Copy link
Contributor

@PatchesMaps PatchesMaps commented Sep 16, 2021

Resolves: attach_gh_issue_here

PR Safety Checklist:

  • Added the task to the appropriate release doc under Enhancements or Bug Fixes
  • Bump package.json & package-lock.json version numbers to appropriate release
  • (optional) All external API changes have been documented
  • (optional) Build docs: npm run docs

Quick Description of Changes (+ screenshots for ui changes):

@PatchesMaps
Copy link
Contributor Author

fix selection

const geometry = editFeatures.getArray()[0].getGeometry()
const rotationDiff = val - rotation

this.setState({ rotation: val }, () => geometry.rotate(-rotationDiff * (Math.PI / 45), anchor))
Copy link
Contributor Author

@PatchesMaps PatchesMaps Sep 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ 180?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment the weirdness

map.getTargetElement()
)
)
ReactDOM.createPortal(
Copy link
Contributor Author

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: () => {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this


// stop tracking movement when popup show is set to false
this.movementListener && removeMovementListener(this.movementListener)

this.setState({ ...this.defaultState }, () => onMapClick(this.state))
this.setState(
Copy link
Contributor Author

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)
Copy link
Contributor Author

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()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass feature through

@PatchesMaps PatchesMaps self-assigned this Oct 19, 2021
@PatchesMaps PatchesMaps added ready to ship 🚀 All systems go- merge + ship! team reviewed 👀 PR reviewed by maintainers labels Oct 19, 2021
@stazrad stazrad merged commit a232e21 into master Oct 27, 2021
@stazrad stazrad deleted the edit branch October 27, 2021 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready to ship 🚀 All systems go- merge + ship! team reviewed 👀 PR reviewed by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants