skeate / Leaflet.timeline

Display arbitrary GeoJSON on a map with a timeline slider and play button
https://skeate.github.io/Leaflet.timeline
ISC License
386 stars 67 forks source link

Using Leaflet.timeline on touch devices #149

Open MarcelWaldvogel opened 4 years ago

MarcelWaldvogel commented 4 years ago

The time slider controls are rather small, so it is hard to hit them on touch devices. I increased their overall size using the following additional CSS. However, I am still not able to operate the time slider using the finger; events go through to the underlying map. Is there anything I can do to fix this?

.leaflet-control.leaflet-timeline-control .button-container button { height: 40px; }
.leaflet-control .time-text { font-size: 150%; }
.leaflet-control.leaflet-timeline-control .sldr-ctrl-container { width: 25%; }
.leaflet-control.leaflet-timeline-control input[type="range"] { width: 70%; }
.time-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 1px;
  margin-top: 19.5px;
  background: #d3d3d3;
  outline: nxone;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}
.time-slider:hover {
  opacity: 1;
}
.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  border: 1px solid black shadow;
  background: white;
  cursor: pointer;
  -webkit-box-shadow: 2px 2px 1px 0px rgba(0,0,0,0.75);
  box-shadow: 2px 2px 1px 0px rgba(0,0,0,0.75);
}
.time-slider::-moz-range-thumb {
  width: 40px;
  height: 40px;
  border: 1px solid black shadow;
  background: white;
  cursor: pointer;
  -moz-box-shadow: 2px 2px 1px 0px rgba(0,0,0,0.75);
  box-shadow: 1px 1px 1px 0px rgba(0,0,0,0.75);
}
skeate commented 4 years ago

I made some changes to the events (in the examples on the site; haven't published a new version yet) -- can you try them out? It works for me in mobile Firefox and Chrome

MarcelWaldvogel commented 4 years ago

Yes, indeed it does on both Firefox/Chrome on Mobile, thank you very much for the fast and successful response!

I am getting used to having a bigger slider on all devices (have tuned it slightly for better UX). Would you be interested in a pull request which would make the slider bigger on all devices?

skeate commented 4 years ago

Couldn't hurt