[Angularjs-app] AngularJS Location-picker App

Source: Internet
Author: User

from:http://rangle.io/blog/two-ways-to-build-a-location-picker-for-a-mobile-angularjs-application/

Building mobile apps often requires working with location information. While, the Cordova geo-location plugin makes it quite trivial to get the latitude and longitude values for the user ' s Curr ENT location, "What we often want be location identifiers" That's meaningful to the User-and not necessarily Correspondi Ng to the place where the. Below We look at the ways at the acquiring meaningful location identifiers.

Location-picker

The Location-picker packages this to a simple directive. It utilizes the reverse-geocoder service to fetch a set of options for the user. The user selection is then bound to the object passed in through the ng-model attribute.

<!---  <location-picker      ng-model= " Pickedlocation "    limit-to=" 5 "></location-picker  >

Location-lookup

The location-predictions directive generates a set of options which is passed into the location-lookup directive. Which in turn displays them as a lists for the user to choose from. Once the user picks a location it uses the Google Places service to fetch the geo-location data for it.

<!---  <location-lookup      ng-model= " Lookeduplocation "    limit-to=" 4 "></location-lookup >

Usage

Both, Location-lookup and location picker, directives is fairly straight forward to use. They essentially behave as a <select> element. The selection is captured using ng-model . Optionally you can limit the number of choices by using the limit-to attribute.

The selection returns data of the following type:

{    ' CN Tower ',    ' CN Tower ', Front Street West, Toronto, ON, Canada'    ,43.642566  ,    -79.38705700000003}

It's easy-to-use and we have this kind of requriement in the proejct and can refer to this blog.

Git:https://github.com/winkervsbecks/locator

[Angularjs-app] AngularJS Location-picker App

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.