support coordinates as start/end point: also accept semicolon as separator
This commit is contained in:
parent
58359fe4ac
commit
93bccf36ba
@ -50,7 +50,7 @@ function geocodeAddress(tf){
|
|||||||
freeform = document.getElementById('tfEndSearch').value;
|
freeform = document.getElementById('tfEndSearch').value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(freeform.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*,\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
|
if(freeform.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
|
||||||
|
|
||||||
var marker;
|
var marker;
|
||||||
if(tf == 'start'){
|
if(tf == 'start'){
|
||||||
@ -61,7 +61,7 @@ function geocodeAddress(tf){
|
|||||||
isEndPointSet = true;
|
isEndPointSet = true;
|
||||||
marker = 'end';
|
marker = 'end';
|
||||||
}
|
}
|
||||||
var coord = freeform.split(",");
|
var coord = freeform.split(/[,;]/);
|
||||||
lonlat = new OpenLayers.LonLat(coord[1],coord[0]);
|
lonlat = new OpenLayers.LonLat(coord[1],coord[0]);
|
||||||
setMarkerAndZoom(marker, lonlat);
|
setMarkerAndZoom(marker, lonlat);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user