<commit_before>---
layout: post
title: Location Services With AngularJS
demo: http://winkervsbecks.github.io/the-core
source: https://github.com/winkerVSbecks/the-core
---

<p data-height="600" data-theme-id="7569" data-slug-hash="4d0c2a06e9671ec046baf30a16d811a8" data-default-tab="result" data-user="winkerVSbecks" class='codepen'>See the Pen <a href='http://codepen.io/winkerVSbecks/pen/4d0c2a06e9671ec046baf30a16d811a8/'>4d0c2a06e9671ec046baf30a16d811a8</a> by <NAME> (<a href='http://codepen.io/winkerVSbecks'>@winkerVSbecks</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
<script async src="//codepen.io/assets/embed/ei.js"></script>

{% include demo-source.html %}

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 current location, what we often want is location identifiers that are meaningful to the user - and not necessarily corresponding to the place where the user is right now. Below we look at two ways at acquiring meaningful location identifiers.

## 1. Geo-Location to Nearby Locations
We fetch nearby locations based on the geo-location data and allow the user to pick the most appropriate option. For this method we can split the tasks into two services:

### Location
The [Location service](https://github.com/winkerVSbecks/locator/blob/master/src/location-picker/services/location.js) checks to see if geo-location is available and grabs the current location. It also allows us to register *on-ready-tasks* with it. Therefore, all the other directives/services which depend on the geo-location data only bootstrap once the data is available.

The geo-location data is captured using using the `navigator.geolocation.getCurrentPosition` method. This works for both desktop browsers and Cordova/PhoneGap.

### Reverse Geocoder
Reverse geocoding is the process of converting geographic coordinates (like latitude 43.647118 and longitude -79.420194) into a human-readable address (such as Ossington Ave at Argyle St, Toronto, ON, M6J 2Z5).<commit_msg>fixed demo/source links for locator post<commit_after>---
layout: post
title: Location Services With AngularJS
demo: http://winkervsbecks.github.io/locator
source: https://github.com/winkerVSbecks/locator
---

<p data-height="600" data-theme-id="7569" data-slug-hash="4d0c2a06e9671ec046baf30a16d811a8" data-default-tab="result" data-user="winkerVSbecks" class='codepen'>See the Pen <a href='http://codepen.io/winkerVSbecks/pen/4d0c2a06e9671ec046baf30a16d811a8/'>4d0c2a06e9671ec046baf30a16d811a8</a> by <NAME> (<a href='http://codepen.io/winkerVSbecks'>@winkerVSbecks</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
<script async src="//codepen.io/assets/embed/ei.js"></script>

{% include demo-source.html %}

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 current location, what we often want is location identifiers that are meaningful to the user - and not necessarily corresponding to the place where the user is right now. Below we look at two ways at acquiring meaningful location identifiers.

## 1. Geo-Location to Nearby Locations
We fetch nearby locations based on the geo-location data and allow the user to pick the most appropriate option. For this method we can split the tasks into two services:

### Location
The [Location service](https://github.com/winkerVSbecks/locator/blob/master/src/location-picker/services/location.js) checks to see if geo-location is available and grabs the current location. It also allows us to register *on-ready-tasks* with it. Therefore, all the other directives/services which depend on the geo-location data only bootstrap once the data is available.

The geo-location data is captured using using the `navigator.geolocation.getCurrentPosition` method. This works for both desktop browsers and Cordova/PhoneGap.

### Reverse Geocoder
Reverse geocoding is the process of converting geographic coordinates (like latitude 43.647118 and longitude -79.420194) into a human-readable address (such as Ossington Ave at Argyle St, Toronto, ON, M6J 2Z5).
{'fraction_non_alphanumeric': 0.0918918918918919, 'fraction_numerical': 0.0408930669800235, 'mean_word_length': 5.231332357247438, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3599058', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1244, 'n_words': 464}