This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
forked from ubilabs/geocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for result limiting within a given country.
- Loading branch information
Blake Simpson
committed
May 24, 2012
1 parent
125cb25
commit e3dc63b
Showing
2 changed files
with
126 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>$.geocomplete()</title> | ||
<meta charset="UTF-8"> | ||
<link rel="stylesheet" type="text/css" href="styles.css" /> | ||
</head> | ||
<body> | ||
|
||
<form> | ||
<input id="geocomplete" type="text" placeholder="Type in an address" size="90" /> | ||
<input id="find" type="button" value="find" /> | ||
</form> | ||
|
||
<div class="map_canvas"></div> | ||
|
||
<p>Try searching for somewhere. All results should be within Germany. <br /> | ||
For further details on result limiting via country: <a href="http://code.google.com/apis/maps/documentation/javascript/places.html#adding_autocomplete">http://code.google.com/apis/maps/documentation/javascript/places.html#adding_autocomplete</a> and read about '<em>componentRestrictions</em>'. <br /> | ||
The Geocoder can also be limited by region: <a href="https://developers.google.com/maps/documentation/javascript/reference#GeocoderRequest">https://developers.google.com/maps/documentation/javascript/reference#GeocoderRequest</a> | ||
</p> | ||
|
||
|
||
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | ||
|
||
<script src="../jquery.geocomplete.js"></script> | ||
<script src="logger.js"></script> | ||
|
||
<script> | ||
$(function(){ | ||
var center = new google.maps.LatLng(51.165691,10.451526); | ||
|
||
$("#geocomplete").geocomplete({ | ||
map: ".map_canvas", | ||
types: ['establishment'], | ||
country: 'de' | ||
}); | ||
|
||
var map = $("#geocomplete").geocomplete("map") | ||
|
||
map.setCenter(center); | ||
map.setZoom(6); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.