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 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.

Location-Picker

The Location-Picker packages this into a simple directive. It utilizes thereverse-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.

<!-- Requires access to the user's geo-location data -->
<location-picker
ng-model="pickedLocation"
limit-to="5"></location-picker>

Location-Lookup

The location-predictions directive generates a set of options which are passed into the Location-Lookup directive. Which in turn displays them as a list 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.

<!-- Requires user to enter a query -->
<location-lookup
ng-model="lookedUpLocation"
limit-to="4"></location-lookup>

Usage

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

The selection returns data of the following type:

{
name: 'CN Tower',
description: 'CN Tower, Front Street West, Toronto, ON, Canada',
latitude: 43.642566,
longitude: -79.38705700000003
}

It is easy to use, we have this kind of requriement in the proejct, can refer to this blog.

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


												

[AngularJS - app] AngularJS Location-picker app的更多相关文章

  1. Android 编程下 App Install Location

    从 API 8 开始(参考官方文档:App Install Location | Android Developers),你可以将你的应用安装在外部储存中(例如,安装到设备的 SD 卡上).这是一个可 ...

  2. 夺命雷公狗—angularjs—16—angularjs里面的缓存

    强大的angularjs也给我们预留了一套他的缓存机智,这样在某个程度上来说还是可以做到减轻一点服务器压力的.... <!DOCTYPE html> <html lang=" ...

  3. 夺命雷公狗—angularjs—10—angularjs里面的内置函数

    我们没学一门语言或者框架,几乎里面都有各自的语法和内置函数,当然,强悍的angularjs也不例外,他的方法其实常用的没多少,因为很多都可以用源生jis几乎都能完成一大部分.. <!doctyp ...

  4. 【js】手机浏览器端唤起app,没有app就去下载app 的方法

    这种功能的作用: 1.一般公司有自己的app,而app是需要不断有新用户涌入才能持续运营,达到不错的收入.就需要使用这种方式进行引入新的用户. 2.一些内容在网页端体验不好,或者一些功能需要app内才 ...

  5. iOS App Store上架新APP与更新APP版本

    iOS App Store上架新APP与更新APP版本 http://www.jianshu.com/p/9e8d1edca148

  6. walk around by The provided App differs from another App with the same version and product ID 分类: Sharepoint 2015-07-05 08:14 4人阅读 评论(0) 收藏

    'm currently developing a SharePoint 2013 application. After a few deployments via Visual Studio, I ...

  7. Android项目实战(二十二):启动另一个APP or 重启本APP

    一.启动另一个APP 目前公司项目需求,一个主APP,需要打开某些小APP,这些小APP是整合了Unity的,但是还是android程序(所有小APP的包名是已知的). 以前没做过,查询了一下实现方法 ...

  8. Android 一个app启动另一个app

    最近,一个app启动另一个app,这个玩法挺火的嘛,有没有试过更新QQ到5.1版本,QQ的健康里面就可以添加其他app,实现从QQ跳转到其他app应用.这个挺好玩的,一下子带来了多少流量啊. 一.先来 ...

  9. 【AngularJS】AngularJS 教程

    AngularJS通过新的属性和表达式扩展了HTML.------------->扩展HTML属性 AngularJS可以构建一个单页面应用程序(SPAs: Single Page Applic ...

随机推荐

  1. vijosp1507郁闷的出纳员

    一道平衡树实现的名次树,用了treap实现. 1.rand()产生的数可能比INF大,很可能改变树的结构. 2.删除时先递归,然后再删除自己,实现就变得简单多了. 3.因为很多情况树会是空的,所以设了 ...

  2. compass和sass很好的两篇文章

    Sass是一种"CSS预处理器",可以让CSS的开发变得简单和可维护.但是,只有搭配Compass,它才能显出真正的威力. 本文介绍Compass的用法.毫不夸张地说,学会了Com ...

  3. APIO2012派遣

    2809: [Apio2012]dispatching Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 1196  Solved: 586[Submit ...

  4. tomcat+oracle连接池

    tomcat 5.5.23 oracle 10g 全局配置 一.tomcat目录\common\lib下添加包ojdbc14.jar. 二.tomcat目录\conf\server.xml的<G ...

  5. ASDL + WN725N 配置无线AP

    1.  ASDL 正常拨号上网 2.  安装TP-LINK无线客户端应用程序 打开之后选择模拟AP 如下图设置----应用 3.  本地连接----属性----高级 如下图设置 4.  宽带连接--- ...

  6. 网站HTTP请求过程解析

    网站性能优化中首要的一条就是要减少HTTP请求,那么为要减少HTTP请求呢?其实有些HTTP分析工具可以帮我们了解当浏览器请求一个资源时大致需要经历的哪些过程: 1 域名解析(DNS Lookup): ...

  7. selenium运行chrome去掉command -line flag

    每次驱动chrome浏览器都会出现这玩意,比较烦人··想办法去掉了它: ChromeOptions options = new ChromeOptions();options.addArguments ...

  8. 第四章:ARP 地址解析协议

    网络接口有一个硬件地址,48bit的值,在硬件层次上进行的数据帧交换必须有正确的接口地址.tcp/ip有自己的地址,32bit的IP地址. 但是知道主机的IP地址并不能让内核发送一帧数据给主机.内核( ...

  9. NOIP2006 作业调度方案

    1.             作业调度方案 (jsp.pas/c/cpp) [问题描述] 我们现在要利用m台机器加工n个工件,每个工件都有m道工序,每道工序都在不同的指定的机器上完成.每个工件的每道工 ...

  10. 【VMware虚拟机】【克隆问题】在VMware 9.0下克隆CentOS6.5虚拟机无法识别eth网卡

    [日期]2014年4月23日 [平台]windows 8 vmware workstation 9.0 centos 6.5 [日志]1)执行ifconfig命令,输出: 2)查看/etc/udev/ ...