The new leaflet library has a circle marker. Attached patch adds it to the button options.

Comments

beljaako created an issue. See original summary.

ayalon’s picture

Status: Needs review » Closed (won't fix)

It's intentionally because neither WKT nor GeoJSON support circles. So there is no clue of drawing a cicle if it cannot be saved correctly to the geofield.

martijn de wit’s picture

Title: Add drawCircleMarker tot the toolbar » Add drawCircleMarker to the toolbar
Status: Closed (won't fix) » Needs review

I think there is a misunderstanding. It's about the drawCircleMarker tool. Not drawing circles, but an other kind of marker.

https://www.npmjs.com/package/@geoman-io/leaflet-geoman-free#leaflet-geo...

martijn de wit’s picture

StatusFileSize
new1015 bytes

Here is a patch for 2.Alpha 2 release.

itamair’s picture

Actually also the "Adds button to draw circle markers" is not supported in GeoJson/Geofield and it would be translated as a simple marker (as the "drawMarker" option).
The #4 patch introduces useless duplications on both "drawCircleMarker" default value and element settings ... so it is not needed (on the present 8.x-2.x-dev)..
The here attached #5 just reverts its un-needed code lines (that introduce duplications) and fixes typos in the "unsupported by GeoJSON" notice ...

vlooi vlerke’s picture

@Martijn, Thanks for the patch. It helped me getting rid of that annoying drawcircleMarker by enabling me to un-tick it in the UI

I can now un select "Adds button to draw circle markers." in mange form display

Without your patch the DrawCircleMarker is set to true by default and you cant disable it.
Its that annoying circle icon that you see even if you turn all buttons in the form display off.
Thanks

scott.whittaker’s picture

The patch in #4 works for me. The patch in #5 breaks my maps.

Also I appreciate the label warning that circle and circle marker are not supported by GeoJSON, but I'm not sure disabling the checkbox is the right call. Circle markers are saved as POINT data in GeoJSON, the same as marker pins. For my application I prefer the circle marker to dropping a pin, so I'd prefer to keep that as an option.

Circles with variable radius don't really work though, so I potentially support disabling them.

guncha25’s picture

Adding patch for 2.x-alpha1

itamair’s picture

This module has been embedded and enhanced in the Leaflet module (2.0) itself: https://www.drupal.org/project/leaflet_widget/issues/3160066
I would rather patch Leaflet on this ...