Giter Club home page Giter Club logo

address-suggestion's Introduction

address-suggestion

address-suggestion is a jQuery plugin which suggests and autocomplete the accurate address based on the partial address given by users.

Usage

demo/index.html shows an example

Detailed Steps

  • include required javascript files
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="lib/jquery.googlemaps.js"></script> <!-- this is the plugin -->
<script src="lib/jquery.mapcontainer.js"></script>
  • On the html page, place three placeholder elements. For example
<input id="address" type="text" />
<div id="suggestion"></div>
<div id="map"></div>
  • In your javascript file, initialize the plugin
//initialize the map element
var map = $('#map').acts_as_map_container();@
// params:
// container is required, which is the map element you just assigned to
// suggestion is the element which will contain the suggested address, defaults to #suggested
// delay is the delay time for requesting google map api, default to 500ms
var address = $('#address').acts_as_address({
    container: map,
    suggestion: '#suggestion',
    delay : 500
});

  • The latitude and longitude are stored in hidden fields if you need to grab them again.

  • Customize your css according to your needs. It only has the most basic styling applied.

Contribute

  • Fork the project
  • Start a feature/bugfix branch
  • Send pull request on github

address-suggestion's People

Contributors

zhengjia avatar

Stargazers

Alex Sologub  avatar Angus H. avatar  avatar Juan M. Fernandez avatar Francis Park avatar Martin Vanni avatar Andy Damevin avatar Tamas Kalman avatar Jonathan Becker avatar Steef de Winter avatar Pedro Coutinho avatar Sergey Gurinovich avatar Patrick Fitzgerald avatar  avatar Yılmaz Uğurlu avatar  avatar Boris Shifrin avatar Maxwell Salzberg avatar

Watchers

 avatar Muhammad Nasir Shamshad avatar

address-suggestion's Issues

Pull request

Hi,
I was pushing some deprecated method of jQuery but git says me that you don't have permissions to push. Kindly advise?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.