javascript - google geocode address closest to latlng or bounds -


Using geocoder JS objects, trying to search for the closest address of a landing in the I example For, I am passing an address for landing portraits for Ireland and should return an Irish address to another country (or within any county, etc.), but returning a Spanish location ...

Can anyone help with this Is?

  function code address () {var address = document.getElementById ('address'). Value; Var latlng = new google.maps.LatLng (53.2734, -7.778320310000026); geocoder.geocode ({'address': address, 'latLng': latlng}, function (result, status) {if (status == google.maps.GeocoderStatus.OK) {map.setCenter (result [0]. homometry location ); Map.setZoom (15); Marker = new google.maps.Marker ({Map: Map, Location: Results [0] .geometry.location, draggable: true});} and {alerts ('geocode was not following Successful for reasons: '+ status);} document. GetElementById (' lat '). Value = marker.position.lat (); document.getElementById (' long '). Value = marker.position.lng (); google .maps.event.addListener (marker, 'drand', function () {document.getElementById ('lat'). value = marker.position.lat (); document.getElementById ('long'). value = marker Position Lng ();});});    

There is no latLng for request

Use componentRestrictions to limit the results of a specific country:

  {address: address, componentRestrictions: {country: 'ie '}}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -