我已经创建了MVC3 Web应用程序,我想GMAP我的联系页面上谷歌地图不工作MVC的Web应用程序
ERROR:
Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key
代码:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAASszoPf7kpR6gGrbmCayD7oU1BTox11w&sensor=false">
</script>
<script type="text/javascript">
var allMarks = [];
google.load("maps", "2");
//This function will help us to add the mark at
//location where user has double clicked. Then
//we will add all the marks in our array so that
//we can send it back to the controller
function initialize() {
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
map.setUIToDefault();
GEvent.addListener(map, "dblclick", function(overlay, latlng) {
if (latlng) {
var mark = new GMarker(latlng);
allMarks.push(latlng);
map.addOverlay(mark);
}
});
}
</script>
布提没有看到地图上还我未能生成API密钥:
http://code.google.com/apis/maps/documentation/javascript/tutorial.html
我想测试它在我的本地机器plz帮助。
不工作:(出现错误:( – Neo 2012-02-17 13:58:57