Questions tagged [w3c-geolocation]

The W3C Geolocation API provides scripted access to geographical location information associated with a hosting device.

See also:

130 questions
3
votes
1 answer

Geolocation API and AJAX requests

I'm working on a personal project that uses the W3C Geolocation API to retrieve the user's location and then load the weather forecast of that location using Wunderground's API by making an AJAX request. The process is this: The user loads the…
Ketchuz
  • 45
  • 1
  • 5
3
votes
2 answers

Is there a way to know if geolocation is enabled for the current domain?

The website I'm working on uses HTML5 geolocation api. It works fine, but I need to know if the feature has been authorized. navigator.geolocation only tells if the feature is available. What I want to know is whether the user has enabled it…
Antoine
  • 5,055
  • 11
  • 54
  • 82
3
votes
0 answers

Why doesn't GeoLocation work on android?

To this date my android phone (and googles android emulator AVD/SDK) doesn't work with w3c geolocation API from web pages ex. the example at : http://www.w3schools.com/html/html5_geolocation.asp or alternative : http://ocupado.eu/info " The W3C…
3
votes
2 answers

Geolocation implementation in Opera

I'm testing HTML5 geolocation. I have some weird results in Opera and Opera Mobile. When I visit the site after some time (for example 25 minutes) after the last visit position timestamp is from some time in the past. But I pass options telling that…
Piotr Perak
  • 10,718
  • 9
  • 49
  • 86
3
votes
1 answer

Get GeoLocation using phonegap when Location services disabled in iPad

I am developing iPad application using phonegap (cordova 1.9.0). I need to get current position of the user. I used following code and it works fine when Location services are enabled. function onDeviceReady() { …
Poorna
  • 323
  • 7
  • 20
3
votes
3 answers

HTML5 geolocation won't work in Firefox, Chrome and Chromium

I'm trying to use the HTML5 geolocation API; but I have problems to make it work on Firefox Chrome and Chromium : init(); function init() {; // Get the current location getPosition(); } function getPosition() { …
Molochdaa
  • 2,158
  • 1
  • 17
  • 23
2
votes
2 answers

How to detect when user allows location in browser?

For a web Application, when the user makes a choice of radio button on a previous unrelated field, I am trigerring location for the next step by calling attemptLocation(). const attemptLocation = () => { if ("geolocation" in navigator) { The…
Kal
  • 1,656
  • 4
  • 26
  • 41
2
votes
1 answer

Background geolocation tracking using Service Worker for web app

I am developing a fitness-related web app that needs to track a user's geolocation in the background (with the user's permission, of course) in order to suggest recommendations. Since no browser has currently implemented Geolocation Sensor API and…
2
votes
0 answers

best practice to get user location using HTML5 geolocation

I want to get user location on my website using HTML5 Geolocation. To prevent user from getting a confirmation box when they visit my website, if the browser has Geolocation support I will show a small notification on website that ask the user to…
Masoud
  • 333
  • 1
  • 10
2
votes
3 answers

How can I access the Coordinates constructor directly in JavaScript?

Type checking in Vue requires the constructor function to be passed in as the type: props: { coords: { type: Coordinates, required: true, }, }, I can't work out how to find the Coordinates constructor. Can't use Object because it…
callumacrae
  • 8,185
  • 8
  • 32
  • 49
2
votes
1 answer

PhoneGap Geolocation is blocked in iOS10

My Phonegap app leverages the (Cordova 3.8) webviews 'W3C Geolocation API'. Since upgrading from iOS 9.x to iOS 10 (beta) however, using navigator.geolocation.getCurrentPosition(...) now returns an error: Access to geolocation was blocked over…
joepegler
  • 103
  • 1
  • 9
2
votes
0 answers

Differences in accuracy with HTML5 geolocation on PC and Android - make PC more accurate

I get my position with HTML5 geolocation and getCurrentPosition with enableHighAccuracy: true: navigator.geolocation.getCurrentPosition(function(position){ console.log(position.coords.latitude + ', ' + position.coords.longitude) }, …
2
votes
1 answer

Jquery ajax Post variables to php

my ajax.php script And my new.html page

Click the button to get your…

Furkan Penbegül
  • 109
  • 2
  • 4
  • 13
2
votes
1 answer

JavaScript - Adding a parameter to a success callback

Languages: Reactjs and vanilla JavaScript The question is more of just a general JavaScript callback question but I'll add my React code to show how I ended up in this predicament. Lets look,Tarantino style, at my confusing blunder: I'm trying to…
Nick Pineda
  • 6,354
  • 11
  • 46
  • 66
2
votes
2 answers

Google chrome geolocation not working

I'm working on cross platform application. navigator.geolocation was working fine, but since last 2 days it just giving problem in Google chrome. Is the api deprecated or some other issue for this api? I tested following code on many different…
1 2
3
8 9