html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
坐标获取$("#sp_butt").click(function(){
var sp3=document.getElementById("sp_location").value;
if(sp3==""){
alert("请输入地理位置!");
}else{
if($('label[for=latlng]').html() == '' && typeof(marker) == 'undefined')
geocoder.getLocation($('input[name=location]').val());
};
});
// QQ map.
var init = function() {
var callbacks={
//若服务请求成功,则运行以下函数,并将结果传入
complete:function(result){
var latlng = 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 = new qq.maps.Geocoder(callbacks);
}