调用google地图Api出错,调用过的朋友帮忙看看。 调用 google 地图 api if (GBrowserIsCompatible()) 报缺少对象当输入的那个地址在地图中找不到之后,其他本来能打开的地图也会出现这个问题。项目急需,求求帮帮忙! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://topic.csdn.net/u/20090929/15/a3172044-8eef-4a65-bd84-6fd7e5a741ce.html http://blog.csdn.net/xiaofanku/article/details/3588315 我的js是这样的啊,改了utf-8依然不行<script charset="utf-8" src="http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAAMfk-guFd848mnquBN5sE2hTapdqtK2Hnl5DyQ9XWqz_dRHQjMxQHcA5EMoLwTISTl5JKi29gu3IJAg&sensor=false" type="text/javascript"></script>window.g = {}; window.$ = function(id){return document.getElementById(id)}; window.onload = function() { try{ if (GBrowserIsCompatible()) { g.map = new GMap2($("map")); g.map.addControl(new GLargeMapControl()); g.map.addControl(new GMapTypeControl()); g.map.addControl(new GScaleControl()); g.geocoder = new GClientGeocoder(); g.getCoordinates = function(address) { g.geocoder.getLatLng( address, function(point) { if (point) { g.map.setCenter(point, 13); var er = new GMarker(point); g.map.addOverlay(er); var info = "<strong>" + address + "</strong><br />坐标: " + point.lat() + "," + point.lng(); $("txtLongitude").value = point.lat();//经度 $("txtLatitude").value = point.lng();//纬度 er.openInfoWindowHtml(info); er.__address_info = info; GEvent.addListener(er, "click", function() { g.map.setCenter(this.getLatLng()); this.openInfoWindowHtml(this.__address_info); $("txtLongitude").value = point.lat();//经度 $("txtLatitude").value = point.lng();//纬度 }); } else { if($("Province").value==""){ document.getElementById("map").style.display="none"; }else{ alert("无法解析该省份: " + address); } } } ) } $("btn_go").onclick = function(){ g.getCoordinates($("Province").value); } $("btn_go").onclick(); }else{ alert('不支持该浏览器'); } }catch(e){ alert("运行发生js错误!"); } } window.onunload = function(){ try{ GUnload(); }catch(e){ //alert("卸载页面时发生js错误!"); } } 在html上是没有问题的,但转成了aspx页面就报缺少对象,就那句话,现在还搞不懂,烦死了 在head之间添加<meta http-equiv="content-type" content="text/html; charset=utf-8"/> 是一直是这样吗?刷新页面会不会有时正常呢 就是google map version 3,在网上去查 label 行间距 winform中关闭页面问题 asp.net操作Excel模板问题,急!!!! 请问是否有这样一个教程? 关于vs2003生成dll和使用命令行工具生成的dll文件的问题 *.vsi 的文件用什么软件打开呀? 为了把数据库里取出来的数据表示在页面上,大家一般是用DataGrid还是Repeater? 关于用户控件 JavaScript问题和.NET问题... 请问怎么能够在点命令按钮后刷新页面? 页面传值,不同电脑不一样 ###########multiview 小问题问题求解,急啊急~~~~~~~~~~
<script charset="utf-8" src="http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAAMfk-guFd848mnquBN5sE2hTapdqtK2Hnl5DyQ9XWqz_dRHQjMxQHcA5EMoLwTISTl5JKi29gu3IJAg&sensor=false"
type="text/javascript"></script>
window.g = {};
window.$ = function(id){return document.getElementById(id)};
window.onload = function() {
try{
if (GBrowserIsCompatible()) {
g.map = new GMap2($("map"));
g.map.addControl(new GLargeMapControl());
g.map.addControl(new GMapTypeControl());
g.map.addControl(new GScaleControl()); g.geocoder = new GClientGeocoder(); g.getCoordinates = function(address) {
g.geocoder.getLatLng(
address,
function(point) {
if (point)
{
g.map.setCenter(point, 13);
var er = new GMarker(point);
g.map.addOverlay(er);
var info = "<strong>" + address + "</strong><br />坐标: " + point.lat() + "," + point.lng();
$("txtLongitude").value = point.lat();//经度
$("txtLatitude").value = point.lng();//纬度
er.openInfoWindowHtml(info);
er.__address_info = info;
GEvent.addListener(er, "click", function() {
g.map.setCenter(this.getLatLng());
this.openInfoWindowHtml(this.__address_info);
$("txtLongitude").value = point.lat();//经度
$("txtLatitude").value = point.lng();//纬度
});
}
else
{
if($("Province").value==""){
document.getElementById("map").style.display="none";
}else{
alert("无法解析该省份: " + address);
}
}
}
)
}
$("btn_go").onclick = function(){
g.getCoordinates($("Province").value);
}
$("btn_go").onclick();
}else{
alert('不支持该浏览器');
}
}catch(e){
alert("运行发生js错误!");
}
}
window.onunload = function(){
try{
GUnload();
}catch(e){
//alert("卸载页面时发生js错误!");
}
}
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
是一直是这样吗?刷新页面会不会有时正常呢