Merge pull request #158 from DrVanScott/gui

Gui: allow coordinates to specify start/end point
This commit is contained in:
Project OSRM 2012-03-02 10:21:25 -08:00
commit e70bcfb343

View File

@ -50,6 +50,23 @@ function geocodeAddress(tf){
freeform = document.getElementById('tfEndSearch').value;
}
if(freeform.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
var marker;
if(tf == 'start'){
isStartPointSet = true;
marker = 'start';
}
if(tf == 'end'){
isEndPointSet = true;
marker = 'end';
}
var coord = freeform.split(/[,;]/);
lonlat = new OpenLayers.LonLat(coord[1],coord[0]);
setMarkerAndZoom(marker, lonlat);
return;
}
document.getElementById('information').style.visibility = 'visible';
document.getElementById('information').innerHTML = '<p class="infoHL">One moment please ...</p>';