How do I build something like this in Google Maps V3 API?

http://gmaps-samples-v3.googlecode.com/svn/trunk/localsearch/places.html In this example, I get many results returned when I perform a search. Because that's using the local search API. But in V3, I only get one result returned. My code is: var address = $("#id_address_input").val(); var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { $("#badlocation_holder").hide(); $("#map_canvas").show(); $("#map_canvas_holder").show().css("background-color", "#E6E6FA").animate({"background-color":"#f5f5f5"}, 800); var myOptions = { zoom: 15, center: results[0].geometry.location, streetViewControl:false, mapTypeControl:false, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel:false, }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, draggable:true });

以上就是How do I build something like this in Google Maps V3 API?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏