geolocation

navigator.geolocation.GetCurrentPosition throws “The last location provider was disabled” error

依然范特西╮ 提交于 2019-12-10 07:46:39
问题 I am trying to create a very basic HTML5 page that grabs the geolocation, but I'm getting an error. Here's what I have inside my 'script' tags: function GetGeo() { if (!navigator.geolocation) { alert("Could not find geolocation"); } else { navigator.geolocation.getCurrentPosition(showMap, function (error) { alert("error encountered: " + error.message ); }); } } function showMap(position) { window.alert(position.coords.latitude + ", " + position.coords.longitude); } The page just has a button

Iphone HTML5 Geolocation always return a error

孤街醉人 提交于 2019-12-10 04:24:37
问题 I trying to use html5 geolocation on Iphone, but it always returns a error. var win = function(position) { alert('Everything is fine! ' + position) }; var fail = function(e) { alert('Can\'t retrieve position.\nError: ' + e) }; navigator.geolocation.getCurrentPosition(win, fail); I testing on IOS Simulator and my device, but doesnt work. On Safari i just can get my position using a wireless internet connection (??). There's a way to make this work? 回答1: Make sure that your Location Services on

Checking if location services are enabled using react native

这一生的挚爱 提交于 2019-12-10 04:08:08
问题 I am currently working on an app using react native that requires location services to be on for some of its features. I have been researching if there is a simple way to test if the user has them turned on or not so I can display a different view if they aren't. I have not found any results other than ones that are specific to IOS or Android. Has anyone else found a solution to this? 回答1: Use the "react native android location services dialog box" module for android https://www.npmjs.com

What's the best way to lookup the US county a US city resides in?

自作多情 提交于 2019-12-10 02:09:34
问题 I'm looking for the best/easiest way to programmatically grab the name of the US county a given US city resides in. It doesn't seem there's a straightforward API available for such a (seemingly simple) task? 回答1: You can download a freely-available database of county/city/zip code info such as this one: http://www.unitedstateszipcodes.org/zip-code-database/ (no need to register or pay) Import it whole, or a subsection of it, into a local, persistent data store (such as a database) and query

Execute PHP script inside Joomla! cms once - geo based redirection

ぐ巨炮叔叔 提交于 2019-12-10 00:25:37
问题 Hi I'm trying to figure the best way to execute a PHP script inside Joomla! I want to redirect users if they are not from X country (already have a database and the script) I found this extension but I want to make my own stuff http://bit.ly/daenzU 1) How could I execute the script once for each visitor? Working with Cookies? 2) As I'll put the script inside Joomla! template, I'll modify templates/XXX/index.php 3) Based on 2), Joomla! loads templates/XXX/index.php each time a page loads, so I

Why is geosearching/location based searches returning zero results?

雨燕双飞 提交于 2019-12-09 19:36:32
问题 I am trying to use app engine's search API to search locations: https://developers.google.com/appengine/docs/python/search/overview#Performing_Location-Based_Searches The problem is no matter what I do, I get zero results. I set the search lat/lng as the the exact point on a document's GeoPoint property and it still returns zero. I know the regular search is working because if I change the query to be a regular full-text search, it works. Here is an example of my data (this is actually from

Javascript学习总结@html5实现定位地理位置

百般思念 提交于 2019-12-09 19:28:33
简述 最近在苦逼学习Javascript,并且是有任务需要去完成的,因此就有一个想法要总结记录一下自己的学习成果。这次的总结主题是html5实现定位地理位置的任务,结合原生的Javascript实现此功能。 html5 1. 什么是html5? 万维网的核心语言、标准通用标记语言下的一个应用超文本标记语言(HTML)的第五次重大修改版本,2014年10月29日,万维网联盟宣布,经过接近8年的艰苦努力,该标准规范终于制定完成,命名为html5。 HTML5草案的前身名为 Web Applications 1.0,于2004年被WHATWG提出,于2007年被W3C接纳,并成立了新的 HTML 工作团队。HTML 5 的第一份正式草案已于2008年1月22日公布。 HTML5 仍处于完善之中。然而,大部分现代浏览器已经具备了某些 HTML5 支持。2012年12月17日,万维网联盟(W3C)正式宣布凝结了大量网络工作者心血的HTML5规范已经正式定稿。根据W3C的发言稿称:“HTML5是开放的Web网络平台的奠基石。” 2. html5有什么特点和优势? 支持Html5的浏览器包括Firefox(火狐浏览器),IE9及其更高版本,Chrome(谷歌浏览器),Safari,Opera等;国内的遨游浏览器(Maxthon),以及基于IE或Chromium(Chrome的工程版或称实验版

Ways to get location of the client from the browser?

人盡茶涼 提交于 2019-12-09 19:12:19
问题 What i need is the lat/long of the client(via browser) Found some articles on the net,found some in stack overflow itself(an old article) Get GPS location from the web browser. it was answered almost 18months ago -- wondering if there's any other(more efficient) way of getting the information of the location of the user from the browser. Soo far,found 2 using Maxmind http://coding.smashingmagazine.com/2010/03/08/entering-the-wonderful-world-of-geo-location/ Other,using google's api http:/

Geolocation :基于浏览器的定位服务

浪尽此生 提交于 2019-12-09 18:58:51
1. 关于 Geolocation 对象 随着 Opera 10.6 和 Safari 5的相继发布,截止到目前为止,W3C 中一个名为 Geolocation 的 API 规范在所有非 IE 浏览器中都得到了实现。简单地说,Geoloaction 的作用就是通过浏览器感知用户的地理位置。 如果说地理位置的感知已经成为了一项成熟的技术,那么紧接着的问题就是 Geolocation 存在的意义是什么?就我目前对 Geolocation 的理解,我认为它存在的理由至少包含以下两点: 1. 公共数据: 目前的地理位置探测,其资料往往来源于服务商各自的数据,而使用浏览器内置的统一接口,将高效整合这一信息。 2. 精确定位: 无论是谷歌还是谷姐们,实现定位的原理无非是通过 IP 地址来探测用户的所在位置,众所周知,IP 的定位能力是比较差的,绝大多数情况下,它的精确度能达到数十公里就已经不错了,除此之外,没有别的任何办法,无论是服务器端语言还是客户端的 JavaScript 脚本,都无法从用户那里获取到更多对定位有所帮助的信息。然而作为用户机器上更为底层的浏览器,它将有权利支配其他有助于定位的设备,比如 GPS 和 WIFI。GPS 大家都已经很熟悉了,在信号良好的情况下,它可以精确到数米之内。而 WIFI 在国内基本上被废了,对于这项技术普及的国家,WIFI 的定位基本上可以精确到百米左右

App Doesn't Crash While Debugging, but Does When Running Normally

淺唱寂寞╮ 提交于 2019-12-09 18:25:42
问题 System Information Windows 10 Technical Preview (build 9926) Visual Studio Community 2013 Attempting to debug on: [AT&T] Lumia 635 (Windows 10 Technical Preview for phones build 9941 w/ Lumia Cyan) [AT&T] Lumia 1520 (Windows Phone 8.1 with Lumia Denim and PfD) [Unlocked] BLU Win Jr (Windows Phone 8.1 with PfD) [Verizon] Lumia Icon (Windows Phone 8.1 with Lumia Denim and PfD) I trying to get location services working in my app. Previously, I had Visual Studio throw the error. It was an