Move empty value check out of endpoint.getGeocode
This commit is contained in:
parent
e624871eb4
commit
51cbbe6d5a
1 changed files with 1 additions and 7 deletions
|
@ -43,18 +43,12 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch
|
||||||
setLatLng(latlng);
|
setLatLng(latlng);
|
||||||
setInputValueFromLatLng(latlng);
|
setInputValueFromLatLng(latlng);
|
||||||
changeCallback();
|
changeCallback();
|
||||||
} else {
|
} else if (endpoint.value) {
|
||||||
endpoint.getGeocode();
|
endpoint.getGeocode();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
endpoint.getGeocode = function () {
|
endpoint.getGeocode = function () {
|
||||||
// if no one has entered a value yet, then we can't geocode, so don't
|
|
||||||
// even try.
|
|
||||||
if (!endpoint.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
endpoint.awaitingGeocode = true;
|
endpoint.awaitingGeocode = true;
|
||||||
|
|
||||||
var viewbox = map.getBounds().toBBoxString(); // <sw lon>,<sw lat>,<ne lon>,<ne lat>
|
var viewbox = map.getBounds().toBBoxString(); // <sw lon>,<sw lat>,<ne lon>,<ne lat>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue