Closed hupe13 closed 1 year ago
why INT?
Today I answered a support question. Apologies for communicating in german, we then switched to mail. The problem was, some markers were displayed, others not. The reason was, the user has defined a floating point number for min_zoom: "2.7". Then he defined "2" and it worked. I was able to reproduce the error.
I read the documentation about zoom again. Floating point numbers only occur when fractional zoom is used. Such an option does not exist in Leaflet Map.
Valid values for min_zoom, max_zoom and zoom are integers from 0 to 20. max_zoom depends on the used tiles.
I think I understand. Zoom can be fractional, min and max can only be ints. Is that true?
Yes, min and max should be ints. From the documentation:
Fractional zoom is disabled by default. To enable it, use the map’s zoomSnap option.
This is not used in Leaflet Map, therefore values for zoom should be int.
https://github.com/bozdoz/wp-plugin-leaflet-map/blob/fa440060e7b9a0b77dc160a8adc201801502e77c/shortcodes/class.map-shortcode.php#L215 should be
'zoom' => FILTER_VALIDATE_INT,
here also: https://github.com/bozdoz/wp-plugin-leaflet-map/blob/fa440060e7b9a0b77dc160a8adc201801502e77c/shortcodes/class.map-shortcode.php#L159
Should I change this?