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
1
vote
1 answer

Limit maker points in Polyline (to be a Line) using leaflet-geoman

I want to enable the user to draw a Line (which is a Polyline with only 2 points). I enable drawing and the listen for vertexadded. When the _rings marker count equals 2, I disable drawing. This feels wrong for several reasons: I access a private…
Hoetmaaiers
  • 3,413
  • 2
  • 19
  • 29
1
vote
1 answer

How to use geoman-io with ngx-leaflet

I am trying to use geoman-io plugin (https://github.com/geoman-io/leaflet-geoman) in ngx-leaflet application. I've found this post: Integrate EasyButton, Geoman with ngx-leaflet , but the only solution provided in this post, that works for me, is to…
hawran
  • 131
  • 3
  • 11
1
vote
1 answer

How to get instance of L.DivIcon leaflet

I am trying to add classes to markers which works fine. However when it is a divIcon it requires different styling. So I am trying to set another className if the Instance is a DivIcon. The Code below is always true because L.divIcon is still a…
Henrik Maaland
  • 210
  • 2
  • 14
1
vote
1 answer

Setting event listener of a class property

I'm using Leaflet and Leaflet-geoman in conjunction with wfs-t to create an editable map object. I have a class EditMap that has a leaflet map as a property. I'm trying to listen for the 'pm:create' event on this map for every class. Here is my…
giscoder12
  • 25
  • 4
1
vote
1 answer

Leaflet - Selecting multiple geoJSON polygon features using Leaflet-Geoman plugin

I am creating an application that requires the selection of multiple polygon features from a geoJSON file and highlighting them. I have managed to accomplish this using the Leaflet-Geoman plugin and attaching the listener map.on('pm:create', and…
John
  • 11
  • 2
1
vote
1 answer

LeafletJS GeoMan into JSON data

I've added GeoMan to my leaflet map and just wondering if there is a way I can export all the drawn features into JSON. I'm using it for development only so the JSON can go into console.log I'm just struggling to work it out. This is the only code I…
1
vote
1 answer

LeafletJs GeoMan Polygon Edit

When i create a new Polygon, on "PM:DRAWSTART" i initialize event "pm:vertexadded" It's allow me to detect if: New point is inside an existing polygons, so i remove it. * If last line created intersect with an existing polygons ( TurfJS…
Shaan1974
  • 65
  • 1
  • 4
1
vote
1 answer

Can I add additional custom icons to the Leaflet.PM Toolbar

I am trying to use Leaflet.pm library (https://github.com/codeofsumit/leaflet.pm). I wanted to know if its possible to add additional icons to the toolbar. For example, there is standard polyline icon but I would like to add another polyline which…
user2018413
  • 91
  • 1
  • 5
1
vote
2 answers

Accessing features from checkboxes that are inside Leaflet popup

I'm working in leaflet, and I'm drawing a polygon with the Leaflet PM plugin On I finish the drawing I run the following event mymap.on('pm:create', function(e) { var strPopup = '
sibams
  • 187
  • 4
  • 13
0
votes
0 answers

Create algorithm for creating polygons inside of given bounds

I am using react-leaflet and leaflet geoman. For this project I am creating placements (camping spots) on a festival map. Then I got the new map.png and some of the camping spots is rotated. I have a algorithm that is given bounds and it's creating…
0
votes
0 answers

Editing layers in Leaflet-Geoman (in NextJs)

I would like to enable users to do CRUD operations using Geoman on a Leaflet map in NextJs. My code works well for creating and removing layers, but when I try to edit my layers (whether I move them, add extra points to them, or cut holes in them)…
peternovak
  • 103
  • 1
  • 11
0
votes
1 answer

Leaflet geoman : draw rectangle with long click

i am using the plugin Geoman-io from leaflet to draw some rectangle onto a map. It's working perfectly. But i would like to be able to draw a rectangle with on long hold click instead of two click. Current behavior: select rectangle form -> user…
tlvi38
  • 281
  • 1
  • 6
0
votes
0 answers

Leaflet Geoman - How to add custom properties to layer / geojson on Geoman pm:create

I need to add a name and ID to the properties of a GeoJSON object when drawing a shape with Leaflet Geoman. I'm writing the layers to a custom layer group: map.pm.setGlobalOptions({ layerGroup: stand_geojson_layer }); I can successfully convert…
0
votes
1 answer

Editing Geoman map cursor tooltip

In my React app, I'd like to edit the text displayed in the cursor tool-tip when using a Geoman tool (and providing texts for different languages like Geoman does). Is there any built-in way to do this or should I use a querySelector ?
FE-P
  • 69
  • 8
0
votes
1 answer

Dragging/moving multiple geojsons on leaflet-geoman

I'd like to move/drag geojson features on map so that the distance to each other stays the same. Choose geojsons by clicking them and then dragging them together. How should I make this? Thanks! I read about syncLayersOnDrag but can not get it to…