React Leaflet - Draw, edit and delete polygon layer in map | Get polygon coordinates in leaflet

  Рет қаралды 26,781

Programming With Prem

Programming With Prem

3 жыл бұрын

This video explains how to draw, edit and delete polygon layer in react leaflet using react leaflet draw.
Demo + Source :
react-component-depot.netlify...
Subscribe to the channel for more videos.
/ @programmingwithprem
------------------------------
NEW HORIZONS - Lesion X / lesionxbeats
Creative Commons - Attribution 3.0 Unported - CC BY 3.0
Free Download / Stream: bit.ly/-new-horizons
Music promoted by Audio Library • NEW HORIZONS - Lesion ...
------------------------------
🎵 Track Info:
Title: NEW HORIZONS by Lesion X
Genre and Mood: Dance & Electronic + Happy

Пікірлер: 38
@eatandsell9016
@eatandsell9016 6 ай бұрын
You deserve 1 millions stars for this react js repo Hope you the best guy
@grol5555
@grol5555 3 жыл бұрын
A good guide, everything is simple and clear.
@programmingwithprem
@programmingwithprem 3 жыл бұрын
Glad you liked it. Please subscribe for more content like this!!!
@zakirashid4375
@zakirashid4375 2 жыл бұрын
Thank you sir, good job.
@masi.Afshar
@masi.Afshar 2 жыл бұрын
great job, thank you
@ramrajv
@ramrajv 5 ай бұрын
Thanks a lot for easing out so much work on editing the shape. Would be great if you could also include a modal to edit the lat and long of the shapes by inputting values manually along with on-map editing option.
@premshankartiwari8613
@premshankartiwari8613 2 жыл бұрын
Awesome explanation. I would like to know how can we unit test this. Do we need to pass lat long to map for drawing in React testing library?
@annamary3955
@annamary3955 2 жыл бұрын
Hi, Your videos are great. It was really helpful for me. But i have a doubt in reactjs leaflet maps. How can i clear the bounding box when a button called reset is clicked which is outside the map. Please help me. Thanks in advance.
@atticgismalawi8126
@atticgismalawi8126 2 жыл бұрын
hey do you have an update for the react leaflet v3
@zantokiwaki
@zantokiwaki Жыл бұрын
I tried your code, and get error in onEdited and onDeleted callback with "Property '_leaflet_id' does not exist on type '{}'.", do i need do declare leaflet_id first?
@therodri595
@therodri595 3 жыл бұрын
Great content man, can you try to do more advanced functions with leaflet i really love to see something like AI to find trends on data i have
@bommumahendarreddy3438
@bommumahendarreddy3438 7 ай бұрын
I want to draw single polygon only on the map not allowed to draw multiple polygons on map screen is it possible?
@dgiri2333
@dgiri2333 11 ай бұрын
Maplayers stored as "lat" and "lan" name combinations i need like geojson data extract from created and edit time how can do that and if endpoint to get geojson how fix on editcontrol and how to do CURD operations using this to endpoint
@devlopwithraza4017
@devlopwithraza4017 Жыл бұрын
not show lat-lng in console from mapLayers this variable why sir
@Cubas1111
@Cubas1111 Жыл бұрын
how do you generate the map?
@AbhishekKumar-yi8bu
@AbhishekKumar-yi8bu Жыл бұрын
hello, I have a problem in hooks, hooks data give error on my code
@ericadiasmatos1818
@ericadiasmatos1818 3 жыл бұрын
When I tried to "import 'leaflet-draw/dist/leaflet.draw.css'" i get -> Module not found. Tried looking in my node_modules for a leaflet-draw but it doesn't exist. All I have is a react-leaflet-draws wich doest have any css file in it :(
@programmingwithprem
@programmingwithprem 3 жыл бұрын
You should install leaflet-draw package using npm
@altairpenson8779
@altairpenson8779 3 жыл бұрын
Hi, thanks for video! and help me? please. I have polygons, markers, and i have to check which polygons contains markers...for example one marker and 5 polygons, inside of which polygon this marker?
@maximilianogabrielfranchve7367
@maximilianogabrielfranchve7367 Жыл бұрын
Did you find a solution?
@mohdanas8027
@mohdanas8027 2 жыл бұрын
Can we get the polygon area ?
@kafelinux
@kafelinux Жыл бұрын
awesome, is this support react native?
@nbx9629
@nbx9629 3 жыл бұрын
I tried to use this code, but some components don't exist, like the react-leaflet Map. In addition, EditControl was using the react-leaflet's MapControl and it does not exist. You're using an depreciated version?
@programmingwithprem
@programmingwithprem 3 жыл бұрын
I was using the relatively a new version of the react-leaflet@2.7 (Current: 3.0.5). But this should just work fine.
@nbx9629
@nbx9629 3 жыл бұрын
@@programmingwithprem I had to create my own draw handler, because this lib doesn’t work :(
@matheusantonelli5826
@matheusantonelli5826 3 жыл бұрын
I'm getting the same error
@markk4925
@markk4925 Жыл бұрын
Is it possible to do this without plugins?
@programmingwithprem
@programmingwithprem Жыл бұрын
If you just want to display the polygon with coordinates you dont have to use the plugin. You can directly use polygon component for that. import { Polygon } from "react-leaflet"; But, if you want option to create/edit/delete the shapes, you need the draw plugin.
@MrZiyak99
@MrZiyak99 3 жыл бұрын
Hey I save these data for these shapes in my database. When i now retrieve the database how do I save display these shapes?
@programmingwithprem
@programmingwithprem 3 жыл бұрын
You need to use polygon, marker etc from react-leaflet. import { Polygon, Marker } from 'react-leaflet'
@MrZiyak99
@MrZiyak99 3 жыл бұрын
@@programmingwithprem I tried that but it just displays the shapes. I was hoping to make those displayed shapes editable and deletable which I cannot do using this approach
@sachinhm5117
@sachinhm5117 3 жыл бұрын
@@MrZiyak99 i'm trying to do same, did u find any solution. If yes pls share how to edit saved shapes.
@Addy__
@Addy__ Жыл бұрын
Can I display all the shapes using one polygon tag or would I need one for each shape?
@SmokeyDev
@SmokeyDev Жыл бұрын
In order to edit put those shapes inside , for example {...your}
@mohdanas8027
@mohdanas8027 2 жыл бұрын
'Map' (imported as 'Map') was not found in 'react-leaflet'
@carracingsongs
@carracingsongs Жыл бұрын
I think Map has been replaced by MapContainer
Leaflet Draw Polygon | Create, Edit, Delete Geometrics
40:32
Mapbox - Interactive maps in React
23:32
Leigh Halliday
Рет қаралды 159 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
IQ Level: 10000
00:10
Younes Zarou
Рет қаралды 11 МЛН
Track your location with the JavaScript Geolocation API
17:55
Jad Joubran
Рет қаралды 42 М.
Next JS + Leaflet Map Tutorial
12:31
halfword
Рет қаралды 14 М.
How to create an Interactive map layers
29:55
Practical Code Academy
Рет қаралды 50 М.
Supercluster in React Leaflet
15:06
Federico Tartarini
Рет қаралды 10 М.
Leaflet Add Image To Marker Popup
8:32
GIS Solutions
Рет қаралды 2,5 М.
React-Leaflet demo
19:58
LogRocket
Рет қаралды 53 М.
Create maps using Leaflet in React JS (Tutorial)
17:17
The Art Of Coding
Рет қаралды 39 М.
Ускоряем ваш TV🚀
0:44
ARTEM_CHIBA
Рет қаралды 283 М.
📱магазин техники в 2014 vs 2024
0:41
djetics
Рет қаралды 667 М.
Частая ошибка геймеров? 😐 Dareu A710X
1:00
Вэйми
Рет қаралды 5 МЛН
Yanlışlıkla Telefonumu Parçaladım!😱
0:18
Safak Novruz
Рет қаралды 817 М.