Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send coordinate to Editcontrol component to draw polygon on Map that can be editable ? #167

Open
sharifme04 opened this issue Nov 30, 2022 · 1 comment

Comments

@sharifme04
Copy link

sharifme04 commented Nov 30, 2022

Hi currently I am using that map, I see there are different methods available.
From those methods, we can get the coordinates and save those to the database if want to keep those coordinates.
But if I want to use those coordinates from the database to draw and edit the map again ., then how I will send those coordinates to EditControl to draw the polygon?

@sharifme04 sharifme04 changed the title How to send coordinate to Editcontrol component two draw polygon on Map that can be editable ? How to send coordinate to Editcontrol component to draw polygon on Map that can be editable ? Nov 30, 2022
@giovanesantossilva
Copy link

Hello, you can put the inside the along with Leaflet draw that he can control.

See https://react-leaflet.js.org/docs/example-layers-control.

For example:

<MapContainer
  zoom={14}
  center={position}
>
  <TileLayer
    url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
   />
     <FeatureGroup>
         <Circle
            center={center}
            pathOptions={{ fillColor: 'red' }}
            radius={100}
            stroke={false}
          />
        <DraftControl />
      </FeatureGroup>
</MapContainer>

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

No branches or pull requests

2 participants