Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

leaflet_markers_legend()

Parameters

This function accepts no parameters.

Location

include/map_functions.php lines 502 to 532

Definition

 
function leaflet_markers_legend()
    {
    global 
$lang$marker_metadata_field$marker_metadata_array$MARKER_COLORS;

    if (!isset(
$marker_metadata_field) || $lang['custom_metadata_markers'] == '')
        { 
?>
        <b>  echo escape($lang['legend_text']); ?>&nbsp;</b>
        
        $restypes 
get_resource_types();
        foreach(
$restypes as $restype)
            {
            
$markercolour = (isset($restype["colour"]) && $restype["colour"] > 0) ? (int)$restype["colour"] : ($restype['ref'] % count($MARKER_COLORS));
            echo 
"<img src='../lib/leaflet_plugins/leaflet-colormarkers-1.0.0/img/marker-icon-" strtolower($MARKER_COLORS[$markercolour])  . ".png' alt='" $MARKER_COLORS[$markercolour] . " Icon' style='width:19px;height:31px;'>" $restype["name"] . "&nbsp;";
            }
        }
    else 
// Custom metadata field color markers legend.
        
?>
        <b>  echo $lang['custom_metadata_markers']; ?>&nbsp;</b> 

        
// Loop through and create the custom color marker legend text, ignoring the first 'unset' item
        
for ($i 0$i count($marker_metadata_array); $i++)
            {
            
$ltext[$i] = $marker_metadata_array[$i]['min'] . "-" $marker_metadata_array[$i]['max'];
            }

        for (
$i 0$i count($marker_metadata_array); $i++)
            {
            
?> <img src="../lib/leaflet_plugins/leaflet-colormarkers-1.0.0/img/marker-icon- echo strtolower($MARKER_COLORS[$i])?>.png" alt=" echo $MARKER_COLORS[$i]; ?> Icon" style="width:19px;height:31px;">  echo $ltext[$i]; ?> &nbsp; 
            
}
        }
    }

This article was last updated 19th March 2024 07:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.