Skip to content

Conversation

@paul121
Copy link
Member

@paul121 paul121 commented Jun 13, 2025

Building off of #206 just thought I would try to bump us to the next minor release of OL v10.5 - release notes

This release is mostly just bug fixes but also includes some new features:

The Snap interaction now allows snapping to segment intersections; it also offers a new unsnap event
Added getLength method to the MultiLineString geometry class

cc @symbioquine re: snap and @mstenta re: MultiLineString lengths, I think this has been an ongoing feature request? Or maybe I'm thinking area of multiple/complex polygons?

@paul121
Copy link
Member Author

paul121 commented Jun 13, 2025

Unfortunately.... this seems to introduce a bug when drawing geometries. I'm able to create an initial geometry successfully (polygon, line or circle, doesn't matter) but when going to create a second geometry there is no snap functionality and upon completing the geometry it is immediately removed from the map. I get this error in the console:

farmOS-map-chunk-973a1b5a13c5e2a2732d.js:1 Uncaught TypeError: Cannot read properties of null (reading 'getView')
    at T.addFeature (farmOS-map-chunk-973a1b5a13c5e2a2732d.js:1:21437)
    at b.<anonymous> (farmOS-map-chunk-d2be14b34483cbc351e2.js:1:6699)
    at b.dispatchEvent (farmOS-map.js:2:283932)
    at b.finishDrawing (farmOS-map-chunk-973a1b5a13c5e2a2732d.js:1:14736)
    at b.handleUpEvent (farmOS-map-chunk-973a1b5a13c5e2a2732d.js:1:9484)
    at b.handleEvent (farmOS-map.js:2:53297)
    at b.handleEvent (farmOS-map-chunk-973a1b5a13c5e2a2732d.js:1:5569)
    at Yt.handleMapBrowserEvent (farmOS-map.js:2:339442)
    at u.dispatchEvent (farmOS-map.js:2:283932)
    at u.handlePointerUp_ (farmOS-map.js:2:301970)

I confirmed that this is not an issue with v10.4, it seems to only be with ^10.5. But it would be great if someone could test this (I used examples/simple-html-consumer) just to make sure it isn't an issue with ^10.4 in case my environment is a little weird (Since I don't do this often I get a little confused with how the examples work.. my workflow has been building the farmos-map src first, then building & running the example afterwards)

In #206 when upgrading to v10.4 we made a change to the edit control that could be related: 776b7aa As well as to snapping grid (and fwiw snapping grid should prob be tested more robustly with this change, too): 69ca701

I don't have time to test much further right now, just wanted to document what I found.

@paul121
Copy link
Member Author

paul121 commented Jun 16, 2025

Ha, well there is now OL v10.6 ... fewer changes than 10.5 but maybe, just maybe there is a fix for this drawing/snapping issue? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant