drag marker to fix location
Address form enhanced by Maptimize.AddressChooser
// Create Maptimize.AddressChooser
var widget = new Maptimize.AddressChooser.Widget(
{ onInitialized: function(widget) {
// Add small map control (zoom and pan)
widget.getMap().setUIToDefault();
// Center map on selected address or on user location
widget.initMap();
// Focus street field
document.getElementById('street').focus();
},
spinner: 'big_spinner'});
Javascript code
Introduction
Maptimize.AddressChooser is a Javascript script to create a nice address form for any websites that need to collect addresses. For example getting user's address, place's location or anything that can be localized on a map. This script just add behavior on HTML form, it does'nt generate HTML markup and can be plugged on any existing forms.This widget behavior has been inspired by Google Local Business Center.
Features
Maptimize.AddressChooser's features are:- Javascript framework-agnostic. You can use it as is or with any great frameworks like Prototype, JQuery, YUI ...
-
Mapping system independent. The current implementation is based on Google Map using a Google Map proxy object.
But you can create your own map proxy (Yahoo Map for instance). You need to implement public method of Map Proxy object. - Interactive map display location while you are typing an address. But it can be disabled if you want, for instance, a button 'display on map'.
- Handle placemark suggests (check out example based on scriptaculous autocomplete).
- Center map on user location (based on its IP) if mapping system allows it.
- Fully customizable.
- Works on Safari, Firefox, IE 6/7, Chrome and Opera.
- Documentation generated with PDoc.
- Packed version is only 6Ko.
- Open source, full code is available on github.
- ...
Download
- Full code from github. If you fix bugs or add features, it's the best way to start with.
- Full code from a zip file.
- Or if you just want the javascript file: Uncompressed or Packed version.