Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_geolibraries()

Description

Definition of providers.
see http://leafletjs.com/reference.html#tilelayer for options in the options map.


L.TileLayer.Provider.providers = {

<?php
foreach($geo_leaflet_sources as $leaflet_source)
{
echo htmlspecialchars($leaflet_source["code"]) . ": {\n";
if($geo_tile_caching)
{
$urlparams = array(
"provider" => $leaflet_source["code"],
);
$sourceurl = generateurl($baseurl . "/pages/ajax/tiles.php",$urlparams) . "&x={x}&y={y}&z={z}";
}
else
{
$sourceurl = $leaflet_source["url"];
}
echo " url: '" . $sourceurl . "',\n";
echo " options: {\n";
if(isset($leaflet_source["maxZoom"]) && is_int_loose($leaflet_source["maxZoom"]))
{
echo " maxZoom: " . (int)$leaflet_source["maxZoom"] . ",\n";
}
if(isset($leaflet_source["attribution"]))
{
echo " attribution: '" . $leaflet_source["attribution"] . "',\n";
}
echo " },\n"; // End of options
echo " variants: {\n";
foreach($leaflet_source["variants"] as $variant=>&$variantdata)
{
echo $variant . ": {\n ";
if(isset($variantdata["url"]))
{
if($geo_tile_caching)
{
$urlparams["variant"] = $variant;
$variantdata["url"] = generateurl($baseurl . "/pages/ajax/tiles.php",$urlparams) . "&x={x}&y={y}&z={z}";
}
echo " url: '" . $variantdata["url"] . "'\n";
}
echo "},\n";
}
echo " },\n"; // End of variants
echo "},\n"; // End of leaflet source
}
?>
ResourceSpace: {
url: '<?php echo $baseurl; ?>/pages/ajax/tiles.php?x={x}&y={y}&z={z}',
options: {
maxZoom: 3,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
},
variants: { OSM: {}}
}

};

L.tileLayer.provider = function (provider, options) {
return new L.TileLayer.Provider(provider, options);
};

return L;
}));
</script>
<?php
}

Parameters

This function accepts no parameters.

Location

include/map_functions.php lines 697 to 720

Definition

 
function get_geolibraries()
    {
    global 
$baseurl$pagename$map_default_cache$map_layer_cache$geo_leaflet_maps_sources,
    
$map_zoomnavbar$map_kml;
    
$map_pages = array(
        
"geo_edit",
        
"geo_search",
        
"search",
        
"view",
        
"edit",
        );
    if(!
in_array($pagename,$map_pages))
        {
        return 
false;
        }
?>

    <!--Leaflet Control Geocoder 1.10.0 plugin files-->
    <link rel="stylesheet" href=" echo $baseurl?>/lib/leaflet_plugins/leaflet-control-geocoder-1.10.0/dist/Control.Geocoder.css"/>
    <script src=" echo $baseurl?>/lib/leaflet_plugins/leaflet-control-geocoder-1.10.0/dist/Control.Geocoder.min.js"></script>

    <!--Polyfill for Internet Explorer and Edge browser compatibility-->
    <!--<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=es2015%2Ces2016%2Ces5%2Ces6%2Ces2017%2Cdefault%2Ces2018%2Ces7"></script>-->
    
    
}

This article was last updated 21st April 2021 17:05 Europe/London time based on the source file dated 29th March 2021 15:05 Europe/London time.