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