var point1;
geocoder.getLatLng("sheffield", function(point1)
{
if (!point1) {
//alert("can't parse" + address);
} else {
//alert(point);
}
}
);请问这样的话,point1是上面定义的point1么?应该怎么定义全局变量啊?谢谢
geocoder.getLatLng("sheffield", function(point1)
{
if (!point1) {
//alert("can't parse" + address);
} else {
//alert(point);
}
}
);请问这样的话,point1是上面定义的point1么?应该怎么定义全局变量啊?谢谢
楼主【jyf7356759】截止到2008-07-21 19:40:09的历史汇总数据(不包括此帖):
发帖的总数量:124 发帖的总分数:2315 每贴平均分数:18
回帖的总数量:376 得分贴总数量:96 回帖的得分率:25%
结贴的总数量:100 结贴的总分数:2155
无满意结贴数:5 无满意结贴分:110
未结的帖子数:24 未结的总分数:160
结贴的百分比:80.65 % 结分的百分比:93.09 %
无满意结贴率:5.00 % 无满意结分率:5.10 %
楼主加油
function convertAddress(address) {
var point;
var gpoint;
if (geocoder) {
geocoder.getLatLng(address, function(point)
{
if (!point) {
//alert("can't parse" + address);
} else {
//alert(point);
gpoint = new GLatLng(point);
}
}
);
}
return gpoint;
}
我想返回gpoint值 = new GLatLng(point),但是只能返回空的gpoint,请问应该怎么改呢?
geocoder.getLatLng(address, function(point)
{
if (!point) {
//alert("can't parse" + address);
} else {
//alert(point);
gpoint = new GLatLng(point);
}
}
);
geocoder.getLatLng(address, function(point)
{
if (!point) {
//alert("can't parse" + address);
} else {
//alert(point);
gpoint = new GLatLng(point);
}
}
);
}
这个方法是没问题的,我就是想写个方法,得到gpoint的值,但是搞不定,谁能帮我看看啊,谢谢了。
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(address, function(point)
{
if (!point) {
//alert("can't parse" + address);
} else {
//alert(point);
var er = createTabbedMarker(point);
map.addOverlay(er);
}
}
);
}
}
我现在想要写个方法,能把上面那个方法里面的point给调出来用。大家帮帮忙啊!谢谢。
if (geocoder) {
geocoder.getLatLng(address,
function(point) {
if (!point) {
//alert("can't parse" + address);
} else {
//alert(point);
var er = createTabbedMarker(point);
map.addOverlay(er);
gpoint = point; //赋值给 gpoint
}
}
);
}
}
你也可以在外面做个hidden,然后var apoint = document.getElementById("point").value;
这样用起来方便
如果在函数内部想调用全局变量,就得用到this,就是这么个道理。。
这是关于Google地图的...
那个geocoder.getLatLng()方法就好像一个独立的整体,只允许进来,不允许出去...
郁闷呢,我也等着在这个geocoder.getLatLng()方法外用里面的point呢!
不知道哪位大哥能帮我们解决下问题呢?