【发布时间】:2018-10-10 17:30:15
【问题描述】:
请为我提供以下代码的正确解决方案
如何传递 Google API 密钥
function load_map_from_address(mapid, address) {
// check if gps has been locally cached.
geocoder = new google.maps.Geocoder();
//alert(geocoder);
var geocoderAPIKey = 'geocoderAPIKey ';
geocoder.geocode({ 'address': address }, function (results, status) {
//alert(status);
if (status == "OK") {
var gps = results[0].geometry.location;
create_map(gps.lat(), gps.lng(), mapid);
}
else {
$('#' + mapid).html('<div class="map_canvas_text "><h4>address not found</h4></div>').show();
}
});
}
【问题讨论】:
标签: javascript asp.net google-maps