map_playback.html 914 Bytes
Newer Older
zauberstuhl's avatar
zauberstuhl committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<script>
  var trackplayback = new L.TrackPlayBack({{.CurrentUser.Locations.LatLngTimeJSON}}, mymap, {
    clockOptions: {
      // the default speed
      // caculate method: fpstime * Math.pow(2, speed - 1)
      // fpstime is the two frame time difference
      speed: 20,
      // the max speed
      maxSpeed: 65
    },
    // trackPoint options
    trackPointOptions: {
      isDraw: true,
      useCanvas: false,
      stroke: false,
      color: '#ef0300',
      fill: true,
      fillColor: '#ef0300',
      opacity: 1,
      radius: 5
    },
    trackLineOptions: {
      isDraw: false,
    },
    targetOptions: {
      useImg: false,
      width: 8,
      height: 8,
      color: '#000',
      fillColor: '#2881c3'
    }
  });
  var trackplaybackControl = L.trackplaybackcontrol(trackplayback);
  trackplaybackControl.addTo(mymap);
  // remove checkbox
  $(".trackplayback-checkbox").hide();
</script>