var default_attribute = osm_attribute; var default_attribute = osm_fr_attribute; var default_attribute = osm_otm_attribute; var default_attribute = oms_attribute; var default_attribute = ''; $varopts) { $varcode = mb_strtolower($leaflet_source["code"] . "_" . $variant); $varoptions = array(); $varoptions["maxZoom"] = $leaflet_source["maxZoom"]; $varoptions["attribution"] = $leaflet_source["attribution"]; // Options can be set at root or overridden by a variant if (isset($varopts["options"])) { foreach ($varopts["options"] as $option => $optval) { $varoptions[$option] = $optval; } } $attribution = isset($varoptions["options"]["attribution"]) ? $varoptions["options"]["attribution"] : $varoptions["attribution"]; echo "var " . $varcode . "_attribute = '" . $attribution . "';\n"; if (mb_strtolower($map_default) == mb_strtolower($leaflet_source["code"] . "." . $variant)) { echo "default_attribute = '" . $attribution . "';\n"; } echo "var " . $varcode . " = L.tileLayer.provider('" . $leaflet_source["code"] . "." . $variant . "', {\n"; echo " useCache: '" . ($map_default_cache ? "true" : "false") . "',\n"; echo " detectRetina: '" . ($map_retina ? "true" : "false") . "',\n"; foreach ($varoptions as $varoption => $optval) { if ($varoption == "attribution") { echo " " . escape($varoption) . ": '" . $optval . "',\n"; } else { echo " " . escape($varoption) . ": " . escape($optval) . ",\n"; } } echo "});\n"; } } echo "var rs_default = L.tileLayer.provider('ResourceSpace.OSM', { useCache: 'true', detectRetina: 'false', maxZoom: 3, attribution: '© OpenStreetMap contributors', });\n\n"; }