先限制输入起点
This commit is contained in:
@@ -145,7 +145,7 @@
|
|||||||
|
|
||||||
<div id="search-box">
|
<div id="search-box">
|
||||||
<div class="input-row">
|
<div class="input-row">
|
||||||
<input id="startInput" placeholder="起点: 默认使用当前位置" />
|
<input id="startInput" placeholder="起点: 请输入当前地点" />
|
||||||
</div>
|
</div>
|
||||||
<div class="input-row">
|
<div class="input-row">
|
||||||
<input id="endInput" placeholder="终点: 请输入目的地" />
|
<input id="endInput" placeholder="终点: 请输入目的地" />
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
});
|
});
|
||||||
map.setCenter(position);
|
map.setCenter(position);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
marker.moveTo(position, {
|
marker.moveTo(position, {
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
@@ -291,6 +291,11 @@
|
|||||||
var startKw = document.getElementById('startInput').value;
|
var startKw = document.getElementById('startInput').value;
|
||||||
var endKw = document.getElementById('endInput').value;
|
var endKw = document.getElementById('endInput').value;
|
||||||
|
|
||||||
|
if (!startKw) {
|
||||||
|
alert("请输入起点");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!endKw) {
|
if (!endKw) {
|
||||||
alert("请输入终点");
|
alert("请输入终点");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user