Skip to content

Commit 45137c5

Browse files
committed
reduce leaflet marker cluster size and max zoom level
1 parent ef4bb41 commit 45137c5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

include/functions_map.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
function osmcopyright($attrleaflet, $attrimagery, $attrmodule, $bl, $custombaselayer)
2828
{
29+
return '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>';
2930
$return = "";
3031

3132
if ($attrleaflet) $return .= '<a href="http://leafletjs.com/" target="_blank">Leaflet</a> ';
@@ -361,7 +362,7 @@ function osm_get_js($conf, $local_conf, $js_data)
361362
// we return directly as there is no addressPoints for GPX
362363
$js .= "\nvar Url = '".$baselayerurl."',
363364
Attribution = '".$attribution."',
364-
TileLayer = new L.TileLayer(Url, {maxZoom: 18, noWrap: ".$nowarp.", attribution: Attribution});\n";
365+
TileLayer = new L.TileLayer(Url, {maxZoom: 16, noWrap: ".$nowarp.", attribution: Attribution});\n";
365366
$js .= "var " . $divname . " = new L.Map('" . $divname . "', {" . $worldcopyjump . ", zoom: ".$zoom.", layers: [TileLayer], contextmenu: " . $local_conf['contextmenu'] . "});\n";
366367
$js .= $divname . ".attributionControl.setPrefix('');\n";
367368
$js .= "\nL.control.scale().addTo(" . $divname . ");\n";
@@ -370,13 +371,13 @@ function osm_get_js($conf, $local_conf, $js_data)
370371
// Create the map and get a new map instance attached and element with $divname
371372
$js .= "\nvar Url = '".$baselayerurl."',
372373
Attribution = '".$attribution."',
373-
TileLayer = new L.TileLayer(Url, {maxZoom: 18, noWrap: ".$nowarp.", attribution: Attribution}),
374+
TileLayer = new L.TileLayer(Url, {maxZoom: 16, noWrap: ".$nowarp.", attribution: Attribution}),
374375
latlng = new L.LatLng(".$local_conf['center_lat'].", ".$local_conf['center_lng'].");\n";
375376
$js .= "var " . $divname . " = new L.Map('" . $divname . "', {" . $worldcopyjump . ", center: latlng, ".$editor." zoom: ".$zoom.", layers: [TileLayer], contextmenu: " . $local_conf['contextmenu'] . "});\n";
376377
$js .= $divname . ".attributionControl.setPrefix('');\n";
377378
$js .= "var MarkerClusterList=[];\n";
378379
$js .= "if (typeof L.MarkerClusterGroup === 'function')\n";
379-
$js .= " var markers = new L.MarkerClusterGroup();\n";
380+
$js .= " var markers = new L.MarkerClusterGroup({maxClusterRadius: 30});\n";
380381
}
381382

382383
if ($local_conf['control'] === true)

0 commit comments

Comments
 (0)