Skip to content

Commit

Permalink
gpx.speed: Add gpx coloring extension
Browse files Browse the repository at this point in the history
  • Loading branch information
shramov committed May 31, 2012
1 parent 9fc43be commit 29e850c
Show file tree
Hide file tree
Showing 4 changed files with 80,163 additions and 1 deletion.
26 changes: 26 additions & 0 deletions examples/gpx-speed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="/leaflet/leaflet.css" />
<script src="/leaflet/leaflet.js"></script>
<script src="../layer/vector/GPX.js"></script>
<script src="../layer/vector/GPX.Speed.js"></script>
</head>
<body>
<!-- define a DIV into which the map will appear. Make it take up the whole window -->
<div style="width:100%; height:100%" id="map"></div>
<script type='text/javascript'>
var map = new L.Map('map', {center: new L.LatLng(58.4, 43.0), zoom: 11});
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');

var track = new L.GPX("speed.gpx", {async: true})
.on("loaded", function(e) { map.fitBounds(e.target.getBounds()); })
.speedSplitEnable({maxSpeed: 100, chunks: 1000});

map.addLayer(track);
map.addLayer(osm);
map.addControl(new L.Control.Layers({}, {'GPX':track}));
</script>

</body>
</html>
Loading

0 comments on commit 29e850c

Please sign in to comment.