Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I do not fully understand your question, but you could try to draw a bounding box and send a search through using the bounds as a bias.</p> <pre><code>var bounds; google.maps.event.addListener(drawingManager, 'rectanglecomplete', function (rectangle) { bounds = rectangle.getBounds(); //search google.maps.event.addListener(rectangle, 'bounds_changed', function () { bounds = rectangle.getBounds(); //search } } //this is a copy of the search function in my app function codeAddress(type, geo) { var bounds = map.getBounds(); //get the current map bounds (should not be greater than the bounding box) geocoder.geocode({ 'address': geo, 'bounds': bounds }, function (results, status) { //geocode the lat/long of incoming with a bias towards the bounds if (status == google.maps.GeocoderStatus.OK) { //if it worked map.setCenter(results[0].geometry.location); //set the center of map to the results testBounds(); //test to make sure we are indeed in the bounds (have to do this because gmaps only allows for a BIAS of bounds and is not strict) if (mapInBounds == "yes") { //if it is inside bounds if (searchCount &gt; 0) { //check to see if this is the first time searched, if not searchResult.setMap(null); //set old search result to not display on map } else { //if it is the first time searchCount++; //just interate } searchResult = new google.maps.Marker({ //create a new marker map: map, //add to current map position: results[0].geometry.location //set position to search results }); document.getElementById("search_results").innerHTML = "&lt;div id=\"searchResult\"&gt;" + geo + " &lt;a href=\"#\" onclick=\"searchResultDeleteMe();\"&gt;&lt;img src=\"images/delete.png\"/&gt;&lt;/a&gt;&lt;/div&gt;&lt;br\&gt;"; //add list div } else { //if location found was outside strict map bounds... displayMessage("Could not find within bounds."); //say so } } else { //if the entire geocode did not work alert(L6); //localization... } }); } //get the location of a lat/long or address function codeLatLng(latlng) { if (geocoder) { geocoder.geocode({ 'latLng': latlng }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { document.getElementById("rgItem").innerHTML = results[0].formatted_address; } else { document.getElementById("rgItem").innerHTML = "Geocoder failed due to: " + status; document.getElementById("rgItem").innerHTML = ""; } } }); } } //get th </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload