Problem/Motivation

From what I have read in other issues there is support for drawing geometries on leaflet maps by now, I can't get working though. I create add a geometry field to a content type and chose "Geolocation Geometry Leaflet - GeoJSON" as widget type. I also active the map feature "Draw Shapes", even though it might not be necessary. There are just no drawing controls on the map. What am I missing?

Comments

janc48 created an issue. See original summary.

christianadamski’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new282.21 KB

Hey,

works perfectly fine for me. No further action needed. "Draw Shapes" is also for the formatter/output, not the widget. I tested this with the Geometry Demo Article - Polygon field.

See attached image.

Any different settings?

janc48’s picture

StatusFileSize
new29.56 KB

Here is what I do:
1. Add geospatial field of type "Geolocation Geometry - Polygon"
2. Set form widget type to "Geolocation Geometry Leaflet - GeoJSON"
3. Open the widget settings once to populate its values but leave them default. (you said that "Draw Shapes" is only for the display)

As a result I am getting a map without drawing controls and a GeoJSON field. The widget doesn't have that header "Map Widget - " and the description text like yours (see attached image). I get those only when using the field type "Geolocation - Coordinates" but not for the other field types.

I tried to install "Geometry Demo" but that gave me a "InvalidArgumentException:
Field field_geolocation_geometry_point is unknown.".

christianadamski’s picture

Hmm. Could you test latest 4.x-dev? I just tested on simplytest.me and 4-dev works perfectly fine there.

If you can confirm, I would prepare a new release

janc48’s picture

Yes, 4.x-dev shows me drawing controls. That's awesome!

There is no Leaflet widget for multi-typed fields (Geometry, Geometry Collection), so I can only have one geometry type per field. Right?

christianadamski’s picture

Status: Postponed (maintainer needs more info) » Fixed

Right. It's just to complicated.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

janc48’s picture

Is drawing for types Geometry Line and Geometry Point not working yet? When using a Point Field I can't actually set the point on the map, with the Line field are no drawing controls at all.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.