mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 21 forks source link

Uncaught Error: Invalid LatLng object #64

Closed Geroh closed 2 years ago

Geroh commented 3 years ago

Hello, first thanks for this plugin! I have an issue in the backend. When I create a post with a OpenStreetMap custom field, everything is ok. I can choose an address and the datas are save well. But when I come back on the edit page of the post, the map doesn't appear, I can't change the address, and I have an error in the javascript console: Uncaught Error: Invalid LatLng object: (50,8134315, 4,3820142) in /wp-content/plugins/acf-openstreetmap-field/assets/js/acf-osm-frontend.min.js?ver=1.3.1 It seems that the "," is the issue, but in database it's a "." Do you have a solution? thanks in advance(d custom fields :)

mcguffin commented 3 years ago

Hej @Geroh, thanks for the report! This issue came up quite some time ago but was closed it due to inactivity: #34 It looks like some part of your setup (Browser, PHP, whatever, ...) is somewhere printing a localized string representation of the lat/lng values with commas. Unfortunately I'm not able to reproduce it. As a workaround I added some JS in acf-osm-frontend.js to make sure only valid floating point numbers are being passed to leaflet. I'll include it in the 1.3.2 update (later today). Regards