我应该在代码库中使用Google API密钥在哪里?

时间:2017-01-29 20:16:24

标签: php api

$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address=' + addresses[i] + '&sensor=false', null, function (data) {


var p = data.results[0].geometry.location
var latlng = new google.maps.LatLng(p.lat, p.lng);

var marker = new google.maps.Marker({

    position: new google.maps.LatLng(p.lat, p.lng),
    map: map,
    icon: marker_icon, // This path is the custom pin to be shown. Remove this line and the proceeding comma to use default pin

});


bounds.extend(marker.position);

我应该在哪里使用Google API密钥?

API密钥的标记中是否有新条目?

2 个答案:

答案 0 :(得分:1)

  

https://maps.googleapis.com/maps/api/geocode/json?address= {地址}&安培;关键= {} YOUR_API_KEY

Source - Google Maps API

答案 1 :(得分:0)

{"data":{"value":300}, "SEQN":700 , "msg":"IT WORKS!!" }�������������������������
在你的HTML

https://developers.google.com/maps/documentation/javascript/

相关问题