谷歌maps范围搜索

http://code.google.com/p/goog-maps-demo/source/browse/trunk/examples/Map/fitBounds.html?r=6

http://www.tongmap.cn/code/webgis3.0--API/symbols/sic.LatLngBounds.html

1

 var geocoder = new google.maps.Geocoder();  //地图搜索对象
geocoder.geocode( { 'address': address, 'bounds': bounds}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK)
{
var i = 0; alert(address+","+results[i].geometry.location.lat()+","+results[i].geometry.location.lng()); if(results[i].geometry.location.lat() >= g_weidu_min && results[i].geometry.location.lat() <= g_weidu_max && results[i].geometry.location.lng() >= g_jingdu_min && results[i].geometry.location.lng() <= g_jingdu_max) map.setCenter(results[i].geometry.location); var marker = new google.maps.Marker({ map: map, //定义在map中显示标记。 position: results[i].geometry.location //定义标记的位置 }); markersArray.push(marker); } } else if(status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) { Pause(this,50);//调用暂停函数 geocode(address); }

  

2

posted @ 2011-07-13 17:05  wangkangluo1  阅读(390)  评论(0编辑  收藏  举报