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

How to update MGLPolygon without removing and adding it ? #12248

Closed
BharathM02 opened this issue Jun 28, 2018 · 2 comments
Closed

How to update MGLPolygon without removing and adding it ? #12248

BharathM02 opened this issue Jun 28, 2018 · 2 comments
Labels

Comments

@BharathM02
Copy link

Platform: IOS
Mapbox SDK version: 4.1.0

What I’m doing :

  1. Adding a polygon in the MGLMapView and add a UIImageView to facilitate Drag and Drop of the polygon.

  2. After long pressing the polygon, now it's ready to move. I get the old center point of the polygon as CLLocationCoordinate and the current point from UIImageView’s touch move function, then find the difference between old point and current point. Loop all the points of the polygon and change the coordinate values with respect to the difference between two points.

  3. Now I have the new updated coordinates of the polygon .

  4. I removed the old polygon and added the new polygon in the mapView.

Expected behaviour

Screen shot of google maps behaviour

google polygon

Actual behavior

But in MapBox there is lots of flickering and movement doesn't seem to be native/realistic.

mapbox polygon

@fabian-guerra
Copy link
Contributor

Hi, @BharathM02. Thank you for using Mapbox. This repo is for reporting issues or requesting features related to the Mapbox Map SDK. For support or assistance with "how to" questions, please reach out to our support team or check our documentation. You can also ask other users on StackOverflow.

@BharathM02
Copy link
Author

Hi @fabian-guerra , sorry if the title mislead you to assume this as a support ticket. This is actually a issue and a feature request.

When i change the coordinates on a polygon, in addition to showing the new polygon, the old polygon isn't removed hence i need to remove the source polygon and add it as a new one, thus this doesn't render properly and looks non-realistic.

I hope my issue is related to #6177

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants