如何在jquery中添加GoogleAPI密钥
我正在使用jQuery位置选择器插件。就我而言,谷歌地图不起作用。它显示此页面无法正确加载谷歌地图错误。我在谷歌和youtube上搜索来解决这个问题。我知道我必须添加MAPAPI密钥。但我的问题是如何在这个插件jquery代码中添加api密钥,因为没有添加api密钥的选项。它有纬度和经度。我是Jquery的新手。 插件Url:如何在jquery中添加GoogleAPI密钥,jquery,google-maps,Jquery,Google Maps,我正在使用jQuery位置选择器插件。就我而言,谷歌地图不起作用。它显示此页面无法正确加载谷歌地图错误。我在谷歌和youtube上搜索来解决这个问题。我知道我必须添加MAPAPI密钥。但我的问题是如何在这个插件jquery代码中添加api密钥,因为没有添加api密钥的选项。它有纬度和经度。我是Jquery的新手。 插件Url: $('#us3')。位置选择器({ 地点:{ 纬度:23.707310, 经度:90.415482 }, 半径:300, 输入绑定:{ 纬度输入:$('us3 lat'
$('#us3')。位置选择器({
地点:{
纬度:23.707310,
经度:90.415482
},
半径:300,
输入绑定:{
纬度输入:$('us3 lat'),
纵向输入:$('us3 lon'),
半径输入:$(“#us3半径”),
locationNameInput:$(“#us3地址”)
},
enableAutocomplete:正确,
onchanged:函数(当前位置、半径、isMarkerDroped){
//取消下面的注释行,以显示每个位置更改事件的警报
//警报(“位置已更改。新位置(“+currentLocation.latitude+”,“+currentLocation.latitude+”));
}
});
将此代码添加到您自己的代码之上
本页将为您提供帮助。
<script>
$('#us3').locationpicker({
location: {
latitude: 23.707310,
longitude: 90.415482
},
radius: 300,
inputBinding: {
latitudeInput: $('#us3-lat'),
longitudeInput: $('#us3-lon'),
radiusInput: $('#us3-radius'),
locationNameInput: $('#us3-address')
},
enableAutocomplete: true,
onchanged: function(currentLocation, radius, isMarkerDropped) {
// Uncomment line below to show alert on each Location Changed event
//alert("Location changed. New location (" + currentLocation.latitude + ", " + currentLocation.longitude + ")");
}
});
</script>
<script src="https://maps.googleapis.com/maps/api/jskey=YOUR_API_KEY&callback=initMap"async defer></script>