xdev-software / vaadin-maps-leaflet-flow

A Vaadin Flow Java API for Leaflet Maps 🗺️ Component (https://leafletjs.com/)
https://vaadin.com/directory/component/leafletmap-for-vaadin
Apache License 2.0
34 stars 16 forks source link

Use of LMapZoomPanOptions results in "Uncaught SyntaxError: missing ) after argument list" #330

Closed Aklakan closed 8 months ago

Aklakan commented 8 months ago

Using com.xdev-software:vaadin-maps-leaflet-flow:4.1.0.

The following snippet creates an invalid JavaScript payload:

LMapZoomPanOptions opts = new LMapZoomPanOptions();
opts.setDuration(1.0);
map.flyToBounds(bounds, opts);

The reason is, that several produced strings such as in LMap#435 lack the , when options are present.

For example, I get the incorrect payload:

document.getElementById('lComponentRegistry1').lComponents.get(1).flyToBounds(
    document.getElementById('lComponentRegistry1').lComponents.get(31){"duration":1.0})

The correct payload would be ...get(31), {"duration":1.0})

AB-xdev commented 8 months ago

Thank you for the issue.

This was indeed incorrect. I also found some other methods that build invalid Javascript.

The fix will be shipped with the next release