geolocation

get current latitude and longitude from gps enabled device

☆樱花仙子☆ 提交于 2019-11-30 06:38:34
问题 I would like to get the latitude and longitude of current location from gps enabled mobile device right from the web browser. May I know is this possible? how to do it? does it require geolocation api? Some coding example would be helpful. Thanks. 回答1: Use the HTML5 Geolocation API, here's the official spec and examples. EDIT I've updated my answer to include current browser support. W3C Geolocation API support Firefox 3.5+ Safari 5.0+ Chrome 5.0+ Opera iPhone 3.0+ Android 2.0+ · · Other

iOS Find Location (Latitude,longitude) from Zipcode

有些话、适合烂在心里 提交于 2019-11-30 05:40:06
What could be the best way to get location for a given zipcode. Would it work for countries outside US/Canada .Thanks Stefan Steiger Use the Google geolocating API (try it out on google.com/maps): Input for a Swiss ZIP code for example: CH-9014 or a french one: FR-34000 or german: de-12101 or US: us-90210 or canada: ca-J5Z 1A1 or china: cn-100000 for example : yields { "status": "OK", "results": [ { "types": [ "postal_code" ], "formatted_address": "9014 St Gallen, Switzerland", "address_components": [ { "long_name": "9014", "short_name": "9014", "types": [ "postal_code" ] }, { "long_name": "St

Windows Phone 8.1 location-tracking

随声附和 提交于 2019-11-30 05:06:01
I want to realize an App that continuously send device's position to a web service. Looking in the documentation, I've found Geolocation class and some articles where position-tracking is discussed: How to continuously track the phone's location for Windows Phone 8 How to run location-tracking apps in the background for Windows Phone 8 Implementing both example projects discussed in these articles, I've noticed that the geolocator_PositionChanged() event is not fired at every position update. There is a delay (about 10/15 minutes) between 2 execution of the event. The strange thing is that

allow to use geolocation for a website for which I previously refused it

时光怂恿深爱的人放手 提交于 2019-11-30 05:02:26
Once I refused a website to get my geolocation info, but right now I would like it to do this. How can I allow this? I tried to find it in webbrowser settings, but with no success. Basically I need this for Chrome, but I would be nice (for other users) to see a solution for other browsers. Chrome Version 23.0.1271.64 should show you a location denied icon to the right of the address bar, which when clicked will show you clear options. Alternatively you can find the setting under settings->advanced->content settings->location->manage exceptions Just use this cool instructions. I hope it will be

geolocation without requesting permission

喜你入骨 提交于 2019-11-30 05:00:14
问题 Ive noticed that modern html5 based geolocation always asks the user "do you want to share your location with this website?". Which is fine, but I know there are other routes of trying to determine a ballpark geolocation without having to request this permission. If I recall, these services uses ip databases to try to track geolocaiton info and provide it to a web app. So, in my website I would like to get a "best guess" at the user's zip code, without the geolocation permission being

List of countries and cities to be used in Facebook Graph API for targeting

♀尐吖头ヾ 提交于 2019-11-30 04:51:15
问题 I am looking for a list of countries/states/cities that can be used with Facebook Graph API when publishing targeted posts. I found one JSON file available on this page but the file doesn't parse correctly and I also doubt whether it can be used for post targeting since the file is for advertisements. Also, I am not sure whether the third party data like the one provided by MaxMind can be used directly with Facebook API. Does anyone have such a list or can atleast point me to a right

MKMapView MKCircle renders a circle with too big radius

时间秒杀一切 提交于 2019-11-30 04:48:29
问题 I'm facing with a strange behaviour of MKCircle appearance. Basically I'm trying to draw a circle with a radius of 8500 km with an arbitrary center. Here is my code: private func addCircle() { mapView.removeOverlays(mapView.overlays) let circle = MKCircle(centerCoordinate: mapCenter, radius: 8500000.0) mapView.addOverlay(circle) } I also have a custom double tap gesture handler, which overwrites the standard one for map view and allows to change the map center by double tapping on the map

Saving variables outside of navigator.geolocation.getCurrentPosition? (javascript)

自作多情 提交于 2019-11-30 04:44:15
问题 I'm trying to play with the scope of js to pull a variable out of navigator.geolocation.getCurrentPosition var lat; function callback (position) { lat = position.coords.latitude; } navigator.geolocation.getCurrentPosition(callback,fail,{timeout:10000}); // after getCurrentPosition succeeds alert(lat); // this alerts null The above code cannot store position.coords.latitude in the lat variable because of the scope. Is there a way to do this? 回答1: You have to remember the async\ajax nature.

Calculating Speed for a navigation app without getSpeed() method

无人久伴 提交于 2019-11-30 04:25:23
I am developing an app which is more of a time-shift racing between your friends. I need to calculate speed of a moving vehicle, and I don't want to use Location.getSpeed() method. (Explained in detail in the bottom why I don't want to use it) I am trying to calculate speed with the help of Latitude and Longitude available to me, and this is where I need help. The help needed: I would want to know is: If the algorithm is correct Should I calculate in Centimeters instead of meters And if there's any code/library already available which does it. I am using the following code: This gives me

City Country State Database [closed]

耗尽温柔 提交于 2019-11-30 04:04:07
I am looking for a good City, Country State database It does not have to be crazy detailed, something that has a good coverage of Cities and their corresponding State,Countries in the world will do it for me. Appreciate if you can point me some links. Thanks Yahoo! provides a Creative Commons license to its geodata, including unique identifiers (Where-On-Earth IDs) and hierarchical information for millions of places on earth, including cities, metropolitan areas, states, countries and other types of divisions. Much of this data is downloadable and they also have an easy-to-use API . http://www