Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_geolibraries()

Description

Checks the current page and includes necessary geolocation libraries for Leaflet maps.

This function loads the Leaflet Control Geocoder plugin and checks if the current page requires geolocation capabilities.
It also handles polyfills for browser compatibility, specifically for Internet Explorer and Edge.

Parameters

This function accepts no parameters.

Return

void Outputs the HTML and JavaScript for including geolocation libraries if applicable.

Location

include/map_functions.php lines 774 to 797

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 9th November 2024 15:35 Europe/London time based on the source file dated 7th November 2024 17:40 Europe/London time.