htmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"/TR/xhtml1/DTD/xhtml1-transitional.dtd">
坐标获取
$("#sp_butt").click(function(){
varsp3=document.getElementById("sp_location").value;
if(sp3==""){
alert("请输入地理位置!");
}else{
if($('label[for=latlng]').html()==''&&typeof(marker)=='undefined')
geocoder.getLocation($('input[name=location]').val());
};
});
//QQmap.
varinit=function(){
varcallbacks={
//若服务请求成功,则运行以下函数,并将结果传入
complete:function(result){
varlatlng=result.detail.location;
if($("input[name='latlng']").val()==''){
$("input[name='latlng']").val(latlng);
$("label[for='latlng']").html($("input[name='latlng']").val());
}
},
//若服务请求失败,则运行以下函数
error:function(){
alert("出错了。请先填写地址!");
}
}
//创建类实例
geocoder=newqq.maps.Geocoder(callbacks);
}