Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
working on speed
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bailey committed Oct 8, 2015
1 parent 63d2437 commit e1d5d1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion speeds.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<body>
<div id="map" class="map"></div>
<script type="text/javascript">
function speed2color(speed){
h = speed
return Array(255*Math.sin(h),255*Math.sin(h+120),255*Math.sin(h+240),1);
}
var stops = {{!stops}};
var speeds = {{!speeds}};
var stopSource = new ol.source.Vector({
Expand All @@ -34,7 +38,7 @@
return function(feature, resolution) {
var style = new ol.style.Style({
text: new ol.style.Text({ text: feature.getId(), scale: 1.5, fill: new ol.style.Fill({ color: 'rgba(0, 0, 0, 1)' }), stroke: new ol.style.Stroke({ color: 'rgba(255, 255, 255, 1)' }), offsetY: -20, offsetX: -20 }),
stroke: new ol.style.Stroke({ color: 'rgba(' + Math.floor(feature.getId()) + ',' + Math.floor(feature.getId()) + ',' + Math.floor(feature.getId()) + ', 1)' }),
stroke: new ol.style.Stroke({ width: feature.getId(), color: speed2color(feature.getId()) }),
})
return [style];
}
Expand Down

0 comments on commit e1d5d1a

Please sign in to comment.