[AngularJS - app] AngularJS Location-picker app
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的更多相关文章
- Android 编程下 App Install Location
从 API 8 开始(参考官方文档:App Install Location | Android Developers),你可以将你的应用安装在外部储存中(例如,安装到设备的 SD 卡上).这是一个可 ...
- 夺命雷公狗—angularjs—16—angularjs里面的缓存
强大的angularjs也给我们预留了一套他的缓存机智,这样在某个程度上来说还是可以做到减轻一点服务器压力的.... <!DOCTYPE html> <html lang=" ...
- 夺命雷公狗—angularjs—10—angularjs里面的内置函数
我们没学一门语言或者框架,几乎里面都有各自的语法和内置函数,当然,强悍的angularjs也不例外,他的方法其实常用的没多少,因为很多都可以用源生jis几乎都能完成一大部分.. <!doctyp ...
- 【js】手机浏览器端唤起app,没有app就去下载app 的方法
这种功能的作用: 1.一般公司有自己的app,而app是需要不断有新用户涌入才能持续运营,达到不错的收入.就需要使用这种方式进行引入新的用户. 2.一些内容在网页端体验不好,或者一些功能需要app内才 ...
- iOS App Store上架新APP与更新APP版本
iOS App Store上架新APP与更新APP版本 http://www.jianshu.com/p/9e8d1edca148
- 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 ...
- Android项目实战(二十二):启动另一个APP or 重启本APP
一.启动另一个APP 目前公司项目需求,一个主APP,需要打开某些小APP,这些小APP是整合了Unity的,但是还是android程序(所有小APP的包名是已知的). 以前没做过,查询了一下实现方法 ...
- Android 一个app启动另一个app
最近,一个app启动另一个app,这个玩法挺火的嘛,有没有试过更新QQ到5.1版本,QQ的健康里面就可以添加其他app,实现从QQ跳转到其他app应用.这个挺好玩的,一下子带来了多少流量啊. 一.先来 ...
- 【AngularJS】AngularJS 教程
AngularJS通过新的属性和表达式扩展了HTML.------------->扩展HTML属性 AngularJS可以构建一个单页面应用程序(SPAs: Single Page Applic ...
随机推荐
- [POJ 3420] Quad Tiling
Quad Tiling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3495 Accepted: 1539 Des ...
- 禅道,然之和蝉知入驻VM Depot
Posted on 四月 21, 2015 by 陈阳 近日, 易软天创与微软开放技术合作,在虚拟镜像中国站点vmdepot.msopentech.cn上成功部署易软天创的集成管理环境,为希望快速基于 ...
- 【 D3.js 高级系列 — 2.0 】 捆图
捆图(Bundle)是 D3 中比较奇特的一个布局,只有两个函数,而且需要与其它布局配合使用.本文讲述捆图的制作方法. 有关捆图的例子极少,很容易找到的是:http://bl.ocks.org/mbo ...
- CSS和SVG中的剪切——clip-path属性和<clipPath>元素
剪切是什么 剪切是一个图形化操作,你可以部分或者完全隐藏一个元素.被剪切的元素可以是一个容器也可以是一个图像元素.元素的哪些部分显示或隐藏是由剪切的路径来决定的. 剪切路径定义了一个区域,在这个区域内 ...
- java jvm学习笔记八(实现jar包的代码签名)
欢迎装载请说明出处:http://blog.csdn.net/yfqnihao/article/details/8267669 课程源码:http://download.csdn.net/detai ...
- js模拟键盘按键事件
var WshShell = new ActiveXObject('WScript.Shell') WshShell.SendKeys('{ }'); 说明:大括号内的是键盘上的按键如: 空格:{ } ...
- 时间管理(GTD)
今天中午看了30分钟老王讲战胜拖延症和时间管理 视频地址:多呗课堂 贴两个总结的图在此: 计划中使用的四象限法和十八分钟法很好. 今年多研究研究,实践一下Geting Things Done.
- IO 图
- matlab 函数说明--waitforbuttonpress
这个函数的名称取得不是太好,一眼看去,好像是等待按键的意思,但是实际上它等待的是按键或者鼠标事件,他的功能描述如下: 停止脚本的执行,直至当前活动的窗口上检测到了鼠标按下事件或者有效的键盘事件(有效是 ...
- leetcode@ [87] Scramble String (Dynamic Programming)
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrin ...