我正在使用这个插件来自动完成位置输入字段。
到目前为止我所做的是——
$(function()
{
$("#find_product_location").geocomplete(
{
map : "#product_location",
mapOptions :
{
mapTypeId : 'roadmap', //roadmap, satellite,hybrid, terrain,
scrollwheel : true,
zoom: 10,
center : new google.maps.LatLng(37.42152681633113, -119.27327880000001),
},
markerOptions:
{
draggable: true
},
})
.bind("geocode:result", function(event, result)
{
console.log('Success');
//console.log(result);
})
.bind("geocode:error", function(event, status)
{
console.log('Error');
//console.log(status);
})
.bind("geocode:multiple", function(event, results)
{
console.log('Multiple');
//console.log(results);
});
});
#product_location
{
width: 100%;
height: 400px;
}
<input id="find_product_location" type="text" placeholder="Type Your Address"/>
<input id="find" type="button" value="find" />
<div id="product_location"></div>
<script src="http://maps.googleapis.com/maps/api/js?sensor=true&libraries=places"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/geocomplete/1.7.0/jquery.geocomplete.min.js"></script>
But the problem is, when a location is selected, there is a marker created and the marker is showed in the map.
我的要求是我不想要这里的标记。
我只想拥有其他功能(自动缩放设置、更改地图位置等)。
有人可以帮忙吗?