Skip to content

juliamae/geo-autocomplete

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

geo_autocomplete

A jQuery UI widget to turn a text field into a google maps autosuggest field.

The original version of this code can be located at geo-autocomplete on Google Code.

In addition to the functionality provided by the original widget, this widget allows for a pinDrop callback, which appends a "drop a pin" option to the autocomplete list.

Usage

var map = new google.maps.Map(document.getElementById("map_canvas"), {
  center: new google.maps.LatLng(40.7143528,-74.0059731)
});

$('#search_term').geo_autocomplete({
	maptype: 'roadmap',
	map: map,
	
	// Callback on pin drop
	pinDrop: function(event) {
	  console.log("lat: " + event.latLng.lat());
	  console.log("lng: " + event.latLng.lng());
  }
});

Copyright (c) 2010 Bob Hitching, Julia West; Dual licensed under the MIT and GPL licenses.

About

jQuery UI widget to autocomplete location using Google Maps v3 API.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%