Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
How to create editable polygons using react-native-maps library

I need to create editable polygons using react native maps, I am able to make polygons but they are intersecting. I need to create them as shown in the link. I have tried convex hull, and graham scan to sort coordinates but nothing seems to work.

What I want to achieve

this.state = { 
coordinates: [
{latitude: 28.539259979358434, longitude: 77.35132858157158},
]
}

onMapPress1(event) {
       this.setState({
           coordinates: [...this.state.coordinates, event.nativeEvent.coordinate]
       })
   }


                          <MapView
                               ref={
                                   map => {
                                       this.mapRef = map;
                                   }}
                               style={{ flex: 1 }}
                               provider={PROVIDER_GOOGLE}

                               initialRegion={this.getInitialCenterCordinate()}
                               onPanDrag={event => this.onMapDragging(event)}
                               onRegionChangeComplete={region => this.regionChanged(region)}
                               onPress={event => this.onMapPress1(event)}
                           >
                               <Polygon coordinates={this.state.coordinates} />
                               {this.state.coordinates.map((m, i) => (
                                   <Marker
                                       key={`${m.identifier}.${i}`}
                                       coordinate={m} />
                               ))}

                    </MapView>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!