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
5
votes
2 answers

How to make GeoJSON data uneditable through leaflet.pm

I have a geojson file and I get it with ajax. but I want to prevent the editing of the geometries I load during startup. Only the ones that are added with leaflet.pm should be editable. How can i do it ? leaflet.pm I'm using geojson coordinate json.…
vciloglu
  • 526
  • 2
  • 7
  • 19
4
votes
3 answers

Integrate EasyButton, Geoman with ngx-leaflet

I am using raw leaflet.js in my Angular Application which depends on some leaflet plugins like EasyButton, Geoman, Distortable Image. ngx-leaflet looks cool and simple. So I've decided to migrate to ngx-leaflet. But I am sure if it is possible to…
Arul Rozario
  • 679
  • 1
  • 9
  • 20
3
votes
2 answers

How to use / declare an external module, which won't pass strict and noImplicitReturns TypeScript settings in Angular 11?

We have an Angular 11 application with strict mode turned on. It has these values in the compilerOptions configurtation in tsconfig.json: "strict": true, "noImplicitReturns": true, Now we want to use an external library (leaflet geoman). The…
3
votes
0 answers

Add vertex to Leaflet polyline programmatically

I'm using Leaflet and Leaflet PM and their polyline tool to create a polyline. Everything works fine when clicking and adding new points to the map. This data I then use to store away somewhere else and do some other stuff with it. The thing is. I…
Daniel
  • 71
  • 4
2
votes
1 answer

Webpack lazy loading Leaflet-Geoman

I am trying to lazy load js drawing library Leaflet-Geoman I am using webpack and the following code to load private async loadGeoman () { await import(/* webpackChunkName: "leaflet-geoman" */ '@geoman-io/leaflet-geoman-free') } And then…
Marko Čepo
  • 185
  • 13
2
votes
1 answer

Is there any way to limit the size of the circle while it is being drawn in leaflet-geoman?

As you may know, in leaflet-geoman there's a function called "drawCircle" that can let you draw a circle having a pivot in the center and expanding the radius with the mouse. For my usage, I wanted to limit that feature WHILE the circle it's being…
2
votes
2 answers

How to get the geojson of all features added by Leaflet-geoman

I'm using Leaflet-geoman to draw circles and polygons in a map. How can I get the geojson of all features drawn in the map ?
Kleyson Rios
  • 2,597
  • 5
  • 40
  • 65
2
votes
0 answers

How to add properties to leaflet-geoman layer when using the toolbar

I need to add custom props to my created polys. To do so currently when the user select in the toolbar the polygon and create a shape, on the create event I convert it to json remove it from the map add the custom props to the json and reload the…
Brett
  • 1,717
  • 1
  • 26
  • 38
2
votes
2 answers

Cut holes in polygon with leaflet geoman

I'm using the fantastic "leaflet geoman" to draw and edit geometries, but having troubles understanding how the cutting tool works. How do I get the geometry of the layer that has been cut? This is my code: mymap.on('pm:create', function(e) { …
agh
  • 107
  • 1
  • 12
2
votes
0 answers

How to make adjacent polygons align with the edited polygon in leaflet?

Is there any way in Leaflet to edit a shape file (from database) consisting of adjacent polygons in the same manner as in QGIS using the "Reshape feature"-tool in the Advanced Edit toolbar? At the moment I'm using Leaflet.pm to edit. It works fine…
agh
  • 107
  • 1
  • 12
2
votes
1 answer

leaflet.pm edit mode get new coordinates within shape

I'm using leaflet js to build a map with some pins https://leafletjs.com/ and I'm also allowing drawing of shapes, e.g. polygons, circles etc. I also these to be edited using a plugin called leaflet.pm https://github.com/codeofsumit/leaflet.pm.…
user0129e021939232
  • 6,205
  • 24
  • 87
  • 140
1
vote
2 answers

Triggering Geoman event with custom button

In my React app, I'm using Geoman on a Leaflet map with several Geoman tools. Currently, I have an event listener that verify which tool is used and chose the right function to fire when the user has finished with the tool : useEffect(() => { …
FE-P
  • 69
  • 8
1
vote
1 answer

How to get latlngs values after edit a polygon in Leaflet-Geoman?

Suppose I have a geojson data: let featureCollection: GeoJSON.FeatureCollection = { type: 'FeatureCollection', features: [ { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ …
Huy
  • 191
  • 6
  • 18
1
vote
1 answer

Leaflet.js Circle to Polygon Conversion

I'm using Leaflet.js to save coverage maps and am giving the user the option of using polygons or circles. To keep all objects in the same format, I'm converting the circle to a polygon before saving. However, when I then reload the circle it is…
Jon Martin
  • 13
  • 4
1
vote
1 answer

geoman - how to listen to a feature change in edit mode after the feature has been created in draw mode

I am listening to adding a vertex during "draw mode" as documented in docs https://github.com/geoman-io/leaflet-geoman#draw-mode map.on('pm:drawstart', ({ workingLayer }) => { workingLayer.on('pm:vertexadded', e => { console.log(e); …
udo
  • 4,832
  • 4
  • 54
  • 82
1
2 3 4 5