GithubHelp home page GithubHelp logo

vivektiwary / geo-location-library-angular Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 6 KB

AutoComplete current city, state, area using Google Maps Api and Geolocation Service in AngularJS

JavaScript 93.40% HTML 6.60%

geo-location-library-angular's Introduction

Simple library for getting Current City, State, Country and Locality name

Dependencies

How to use it?

It is really simple

  • Include the geo_library_service.js in a script tag source and
  • In your angular module put a dependency for geoAutoComplete.
  	angular.module('myApp', ['geoAutoComplete'])

This library provides you few directive for getting city, state, and current locality. The directives are: * geoCity * geoState * geoNeighbourhood

They can be used like:

	<geo_city css-class='city-box' country-city-map='countryCityMap'> </geo_city>
	<geo_state css-class='city-box' country-state-map='countryStateMap'> </geo_state>
	<geo_neighbourhood css-class='city-box'></geo_neighbourhood>

Note:

Here we have the option to define our city and state list. In the above html, 'country-city-map' and 'country-state-map' expects an object containing country with cities and country with states respectively.

ex:

	$scope.countryCityMap = {
	  'india': ['Chennai', 'Bangalore', 'Mumbai', 'New Delhi', 'Patna']
	};

	$scope.countryStateMap = {
	  'india': ['Karnataka', 'Bihar', 'Maharashtra', 'Punjab']
	};

According to this list, the select option will come. One more thing we have the option to stick our own css too.

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.