added working timeslider example to curl.php

This commit is contained in:
user 2020-10-13 17:44:25 +02:00
parent c13e456b38
commit 6ccbea719b

View File

@ -183,7 +183,8 @@ function callAPI($url){
//.openPopup(); //.openPopup();
var scooter1 = L.marker([52.508926, 13.355061],
var scooter2 = L.marker([52.508926, 13.355061],
{time: "2020-10-09T08:00:29Z"}, {time: "2020-10-09T08:00:29Z"},
{icon: availableIcon}).addTo(map) {icon: availableIcon}).addTo(map)
.bindPopup('Last updated <?php echo $lst; ?>') .bindPopup('Last updated <?php echo $lst; ?>')
@ -194,7 +195,7 @@ function callAPI($url){
//.openPopup(); //.openPopup();
var scooter1 = L.marker([52.506926, 13.348061], var scooter3 = L.marker([52.506926, 13.348061],
{time: "2020-10-09T08:00:29Z"}, {time: "2020-10-09T08:00:29Z"},
{icon: availableIcon}).addTo(map) {icon: availableIcon}).addTo(map)
.bindPopup('Last updated <?php echo $lst; ?>') .bindPopup('Last updated <?php echo $lst; ?>')
@ -204,18 +205,28 @@ function callAPI($url){
.setIcon(isMaintenanceIcon); // scooter is rented .setIcon(isMaintenanceIcon); // scooter is rented
//.openPopup(); //.openPopup();
//scooter 3 different time and poss
var scooter3 = L.marker([52.509926, 13.348061],
{time: "2020-10-09T09:00:29Z"},
{icon: availableIcon}).addTo(map)
.bindPopup('Last updated <?php echo $lst; ?>')
.bindTooltip('artist name')
//.setIcon(availableIcon); // scooter is available
//.setIcon(isRentedIcon); // scooter is rented
.setIcon(isMaintenanceIcon); // scooter is rented
//.openPopup();
// time slider // time slider
//test markers //test markers
//var marker1 = L.marker([52.504926, 13.358061], {time: "2020-10-09T08:00:29Z"}); //var marker1 = L.marker([52.504926, 13.358061], {time: "2020-10-09T08:00:29Z"});
var marker2 = L.marker([52.506926, 13.358061], {time: "2020-10-09T09:00:29Z"}); //var marker2 = L.marker([52.506926, 13.358061], {time: "2020-10-09T09:00:29Z"});
var marker3 = L.marker([52.508926, 13.358061], {time: "2020-10-09T10:00:29Z"}); //var marker3 = L.marker([52.508926, 13.358061], {time: "2020-10-09T10:00:29Z"});
// var map = marker1; // var map = marker1;
// layerGroup = L.layerGroup([marker_e7a96a6d6b08479ba6d17d42769e5202]); // layerGroup = L.layerGroup([marker_e7a96a6d6b08479ba6d17d42769e5202]);
layerGroup = L.layerGroup([scooter1, marker2, marker3]); layerGroup = L.layerGroup([scooter1, scooter3]);
var sliderControl = L.control.sliderControl({layer:layerGroup}); var sliderControl = L.control.sliderControl({layer:layerGroup});
map.addControl(sliderControl); map.addControl(sliderControl);
sliderControl.startSlider(); sliderControl.startSlider();