Closed Lus0rius closed 1 year ago
That is an interesting problem. How can I test this?
I have german and english sites and I can confirm this: Even if I enter values for the default settings with a dot on the settings page, they are displayed with a comma on german sites. In the database the values are stored with a dot.
When I write the values with a comma [leaflet-marker lat=0,0 lng=0,7]default[/leaflet-marker]
, I get a TypeError.
But I have never seen the geocoder error. When does it occur?
After further testing, the geocoder error comes from a marker whose address is not found. The default longitude and latitude values are taken into account even if they contain commas (like hupe13 said, they must be stored internally with a dot). Sorry about that useless thread.
the geocoder error comes from a marker whose address is not found
This is actually fixed. But that does not seem to be the case. I have not tested properly, I'm sorry @bozdoz.
should be:
if (isset($location->lat) && isset($location->lng)) {
$this->lat = $location->lat;
$this->lng = $location->lng;
}
or similar. Then the not found marker is on 0,0.
@hupe13 is that all that needs changing?
Yes, I just tested it again. The marker then appears at the null point [0, 0] because of https://github.com/bozdoz/wp-plugin-leaflet-map/blob/93bb4d9ff89673d9e1036dc3d0bb29cbdbcea543/class.geocoder.php#L14
Hi,
I believe it is not intended that settings match the user's culture. For example, in French, the separator between the unit and the decimals is a , not a . So even if i write a dot in the "Default latitude" setting, it gets converted to a comma.
At the same time, I get an error "Warning: Undefined property: stdClass::$lat in /home/clients/.../sites/wp-content/plugins/leaflet-map/class.geocoder.php on line 70", and the same for longitude.