diff --git a/app/assets/javascripts/routing.js.erb b/app/assets/javascripts/routing.js.erb
index f496262d2..98f6d86e8 100644
--- a/app/assets/javascripts/routing.js.erb
+++ b/app/assets/javascripts/routing.js.erb
@@ -100,8 +100,9 @@ OSM.Routing=function(map,name,jqSearch) {
$('#sidebar_content').empty();
var html='
Directions
'.replace(/~/g,"'");
html+="";
- $('#sidebar_content').html(html);
+ $('#sidebar_content').html(html);
// Add each row
+ var cumulative=0;
for (var i=0; i ");
row.append(""+instText);
row.append(" | "+dist);
- with ({n: i}) { row.on('click',function(e) { r.clickTurn(n); });
- }
+ with ({num: i, dist: step[3]}) {
+ row.on('click',function(e) {
+ r.clickTurn(num, r.polyline.getLatLngs()[dist]);
+ });
+ };
$('#turnbyturn').append(row);
+ cumulative+=step[2];
}
};
- r.clickTurn=function(num) {
- console.log("clicked turn",num);
+ r.clickTurn=function(num,latlng) {
+ L.popup().setLatLng(latlng).setContent(" "+(num+1)+" ").openOn(r.map);
};
|