bozdoz / wp-plugin-leaflet-map

Add leaflet maps to Wordpress with shortcodes
https://wordpress.org/plugins/leaflet-map/
GNU General Public License v2.0
141 stars 72 forks source link

maxZoom > 18 #215

Closed hupe13 closed 1 year ago

hupe13 commented 1 year ago

see support forum

It is a bug. I added maxZoom to tile layers options and I get zoom > 18.

https://github.com/bozdoz/wp-plugin-leaflet-map/blob/39019ce82a5227915adb556b61035232a65f3a5a/shortcodes/class.map-shortcode.php#L199-L200

            'noWrap' => filter_var(empty($nowrap) ? $settings->get('tile_no_wrap') : $nowrap, FILTER_VALIDATE_BOOLEAN),
            'maxZoom' => $atts['maxZoom']
        );

maxZoom: 18 comes from:

https://github.com/Leaflet/Leaflet/blob/18d703176bec040a06f233702d3eec141e95daaf/src/layer/tile/TileLayer.js#L46-L48

bozdoz commented 1 year ago

Could you give me a shortcode to test this with?

hupe13 commented 1 year ago

https://leafext.de/debug/ openstreetmap.fr has a maxzoom of 20. Please zoom in and open the developer console. I load a changed leaflet-src.js with debug messages in console.log.

bozdoz commented 1 year ago

[leaflet-map height=200px width=100% max_zoom=23 !detect-retina zoomcontrol tileurl=https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png subdomains=abc]