Questions tagged [leaflet-geoman]

Leaflet-Geoman is a plugin for Leaflet, the open-sorce javascript library for mobile-friendly maps, and allows drawing, editing, dragging, cutting, splitting, measuring and pinning geometry layers.
It supports Markers, CircleMarkers, Polylines, Polygons, Circles, Rectangles, ImageOverlays, LayerGroups, GeoJSON, MultiLineStrings and MultiPolygons.

61 questions
0
votes
0 answers

Remove marker is disabled after one marker remove from map

I am using the react-leaflet/core library together with the plugin Leaflet-Geoman which using the removalMode to delete the marker from map Below is my code import { useLeafletContext } from "@react-leaflet/core"; const Geoman = (props) => { …
0
votes
0 answers

Adding direction handles to geoman markers

I would like to add a direction handle to [some] geoman leaflet markers. There are packages out there already like leaflet-editable-marker that add things like direction/transformation rulers etc to leaflet. I want [some] outline markers for my…
Igor Shmukler
  • 1,742
  • 3
  • 15
  • 48
0
votes
1 answer

Custom transform control for geoman

I am trying to add a custom transform control to geoman, to do certain transformations with polylines and polygons. I see that on edit, geoman draws hint lines above vertices etc. I would like my tool to highlight polylines/polygons with the same…
Igor Shmukler
  • 1,742
  • 3
  • 15
  • 48
0
votes
0 answers

Updating custom actions in leaflet geoman for React

I'm using leaflet-geoman for a project and am faced with a difficulty when trying to implement custom actions in a control. I'm using a custom control entitled "Spray", which is sprays a number of points over an area of the map. That number of…
Louri
  • 25
  • 6
0
votes
2 answers

Leaflet geoman "Button with this name already exists" error when creating a new button in react

I am trying to create a custom button for arrows in the drawing tool of leaflet-geoman. The idea was to work with the copyDrawControl function, and to use Line as a model to make Polylines with arrow tips. I wrote a code mostly inspired from this…
Louri
  • 25
  • 6
0
votes
1 answer

How to edit only selected feature from geojson using leaflet geoman

I have a GeoJson having 40,000 features as MultiPolygon.Can anyone guide me that how can i select individual polygon from it and edit that selected one. Right now when I click edit in Leaflet-Geoman toolbar it selects all 40,000 features and make…
0
votes
1 answer

Update Turf JS area in Leaflet popup using Geoman "edit layers"

I have a QGIS project that I exported to a web map using QGIS2WEB. Using Turf JS, I have a popup that displays the area of each polygon in my web map. Using Geoman, I would like to be able to edit the polygons in the web map and have the area…
0
votes
1 answer

Geoman in leaflet, how to disable a click on a polygon?

How can I remove a click on a polygon. I dont want the mouse to switch to 'clickable mode' when hovering over a polygon. Why do I need this? There's another layer that (should come) on top of the polygon but since the polygon is clickable you cant…
ProcolHarum
  • 721
  • 3
  • 17
0
votes
1 answer

How to track the polygon change event?

I need to get the new coordinates of the polygon if the finish button was pressed. I applied pm:update, but this event is not triggered when rotating or moving the polygon. I also tried to use pm:action click, but this event does not give me the…
Domex
  • 25
  • 5
0
votes
1 answer

Geoman event pm:create doesn't fire when adding layers programmatically

I'm using react-leaflet with the Geoman plugin, and I notice that pm:create doesn't fire when I add new layers programmatically. This code runs on startup and again anytime the activeFeatureGroup is changed: map.pm.setGlobalOptions({ …
0
votes
1 answer

Drawing different objects on leaflet map with custom controls

I would like to draw different type of objects on a leaflet map with leaflet-geoman. I have a geojson layer not editable (agricol parcels) on overlay pane and I want to choose in a combobox (or buttons nethermind) the type of object to draw. It can…
GuenLM
  • 13
  • 4
0
votes
1 answer

leaflet geoman - load pre-existing polygon to map

I have the following jsfiddle and wonder how can I click the dummy button add the predefine polygon coordinates? [[[7.43067, 49.109838], [7.43067, 50.331436], [10.135936, 50.331436], [10.135936, 49.109838]]] My javasript: var osmUrl =…
ProcolHarum
  • 721
  • 3
  • 17
0
votes
1 answer

Maintaining the topology on a MultiLineString

I'm trying to get topological movement of lines with Leaflet-Geoman plugin using TopoJSON. There is a method called topojson.mesh , which Returns the GeoJSON MultiLineString geometry object representing the mesh for the specified object in the…
user14900872
0
votes
1 answer

React useCallback function runs in infinite loop

I am trying to use leaflet-geoman library in a React project. I need to create a custom toolbar button that enables and disables global drag mode. When toolbar button is clicked, map.pm.enableGlobalDragMode(); function enables global mode. When…
Matt
  • 8,195
  • 31
  • 115
  • 225
0
votes
1 answer

geoman - how to access the resulting GeoJSON object after a feature has been removed in removalMode

I have a FeatureCollection from which I remove single Features. I can get the removed feature by adding an event listener pm:remove like following: layer.on('pm:remove', e => { // do stuff regarding the removed feature …
udo
  • 4,832
  • 4
  • 54
  • 82