Browse Source

is lost icon

check if scooter was lost
master
Anton 4 years ago
parent
commit
0529bfd429
  1. 10
      api_fun/damaged_scooters/damaged_map/index.php

10
api_fun/damaged_scooters/damaged_map/index.php

@ -47,6 +47,13 @@ function makeMarker($id){ // generate appropriate markers based on latest JSON
$marker = 'var scooter'.$nam.' = L.marker(['.$pos.'], {time: "'.$lst.'"}).addTo(map) $marker = 'var scooter'.$nam.' = L.marker(['.$pos.'], {time: "'.$lst.'"}).addTo(map)
.bindPopup("<b>'.$nam.'</b><br><b>batteryLevel:</b>'.$bat.'<br><b>Status: </b>'.$act.'<br>Last updated: '.$lst=str_replace(array('T', 'Z'), ' ', $lst).'") .bindPopup("<b>'.$nam.'</b><br><b>batteryLevel:</b>'.$bat.'<br><b>Status: </b>'.$act.'<br>Last updated: '.$lst=str_replace(array('T', 'Z'), ' ', $lst).'")
.bindTooltip("'.$nam.'").setIcon(isMaintenanceIcon);'; .bindTooltip("'.$nam.'").setIcon(isMaintenanceIcon);';
};
//check if scooters is lost
if($act === "LOST"){
$marker = 'var scooter'.$nam.' = L.marker(['.$pos.'], {time: "'.$lst.'"}).addTo(map)
.bindPopup("<b>'.$nam.'</b><br><b>batteryLevel:</b>'.$bat.'<br><b>Status: </b>'.$act.'<br>Last updated: '.$lst=str_replace(array('T', 'Z'), ' ', $lst).'")
.bindTooltip("'.$nam.'").setIcon(isLostIcon);';
}; };
@ -107,6 +114,9 @@ function makeMarker($id){ // generate appropriate markers based on latest JSON
{"icon": "wrench", "iconColor": "white", "markerColor": "black", "prefix": "fa"} {"icon": "wrench", "iconColor": "white", "markerColor": "black", "prefix": "fa"}
); );
var isLostIcon = L.AwesomeMarkers.icon(
{"icon": "question", "iconColor": "white", "markerColor": "black", "prefix": "fa"}
);
var map = L.map('map', { zoomControl: false, attributionControl: false }).setView([52.516190, 13.377693], 11.5); var map = L.map('map', { zoomControl: false, attributionControl: false }).setView([52.516190, 13.377693], 11.5);

Loading…
Cancel
Save