3liz / lizmap-javascript-scripts

Scripts for Lizmap Web Client
Mozilla Public License 2.0
22 stars 42 forks source link

Buffer_3.8.js Fixes compatibility #94

Open jancelin opened 4 days ago

jancelin commented 4 days ago

Description:
This pull request introduces improvements to the buffer feature for Lizmap, providing a more dynamic and user-friendly experience. Key enhancements include:

  1. Dynamic Labels on Buffers:

    • Labels now display the buffer radius in kilometers, dynamically positioned on the circle's perimeter.
  2. Improved Code Structure:

    • Introduced projection handling using EPSG:4326 for accurate buffer calculations.

Changelog:

Testing Instructions:

Related Issues:
Fixes compatibility issues with Lizmap 3.8

jancelin commented 3 days ago

LGTM for me.

I didn't expect a revival of this script :)

I'm curious why you are creating a circle by hand ? There isn't a function ? https://openlayers.org/en/latest/apidoc/module-ol_geom_Circle-Circle.html Or is-it because it's not exposed ?

It's OL 10, right ?

Hi @Gustry

We use this script on Centipede-RTK to visualise distances from GNSS bases. The dev page: https://map.centipede.fr It's OL10 but I haven't managed to integrate a function of this type. & I need the circles to be the right size no matter where in the world they are. That's why I use geographic coordinates rather than projected coordinates. image

jancelin commented 3 days ago

On closer inspection, I think there's a problem with the scale available in lizmap. I'll check this tomorrow.... I know that the geographical distance between my 2 coordinates (point CT and SLP) is about 20km. The lizmap scale at the bottom of the page apparently gives me an aberrant value.