Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have used Chrome for geolocating the current user and this has been working fine (I've shown my demo to around 10 people who have all confirmed this is working fine) - when using Firefox and Internet Explorer on laptops or desktops - no location is found and even when I allow my current location - no marker is placed and no current location is found.
Has this been reported before for all non-Chrome browser?
Comment | File | Size | Author |
---|---|---|---|
#5 | incorrect_location.jpg | 318.99 KB | GBain22 |
Comments
Comment #1
GBain22 CreditAttribution: GBain22 commentedEDIT: I have found this in the log getCurrentPosition() returned error 2: position unavailable (connection lost?). No fallback. Neither Smart IP nor GeoIP API are enabled.
I have used Smart IP and GeoIP and both return positions that are nowhere near the current user (usually in Liverpool or Manchester Uk) But positions returned by the fallbacks usually end up about 200 miles away.
I also get prompted to give my position by Firefox but nothing happens, and I don't get the "allow location" in IE at all
EDIT: Seems to work fine in IE10 on latest test but Firefox refused to locate despite clicking "always allow" location to be used
Comment #2
RdeBoerWhoa! This kind of browser behaviour is certainly new to me!
Thanks for your report GBain22.
This comes as an unwelcome surprise.... You are the first to report these issues... It coincides with me releasing 7.x-1.23 today....
Have you used IPGV&M previously? What I mean is: did this happen before?
Which mapping engine do you use with IPGV&M:
Google API
OpenLayers API
Leaflet API P
Hope to hear from you soon.
Rik
Comment #3
GBain22 CreditAttribution: GBain22 commentedHi Rik,
Thanks for the quick response, I am using Map (Leaflet API, via IPGV&M) and using "Center the map on the visitor's current location." - you can actually see the map here if you have time to look http://ol.kfdev.co.uk/currentlocation
I have 2 locations showing in Liverpool and I'm currently in Manchester (not sure if you're familiar with North West, England). My results are as expected when using a mobile phone (GPS seems to give my current location fine) but when using Desktops/Laptops I get
Google Chrome - correct results (sometimes a few miles out but not often)
Firefox - no location returned
IE10 - Seems to work ok now (same as Chrome)
IE9 and below - same as Firefox
Not sure why Firefox is playing up so much - is there anything I can try?
Comment #4
RdeBoerHi Garry,
So this is disturbingly weird...
I used your link from #3 and I see exactly what you are saying.
I first tried with Chrome (on my Mac laptop). Your map put the marker right in my front yard (in Melbourne, Australia).
Same with Safari, which is to be expected as Chrome and Safari are based on the same Webkit foundations (soon to be diverting, but that's another matter).
I then tried Firefox, I get a map that is centered somewhere East of Liverpool Lime Street Station..... Why?
Can't test IE8/9/10 tonight, as I'm at home on my Mac...
You need to tell me more about your setup... Like how come I dont' see the +/- zoom controls or the FULL attribution message in the bottom right corner....
Rik
PS: as an aside: do yourself a favour and install Leaflet More Maps for instant gratification.... I'm not joking.... If you love maps, you'll love Leaflet More Maps.... and it is such a light-weight module.
Comment #5
GBain22 CreditAttribution: GBain22 commentedHi Rik,
Can you try again? I presume it took you to Lime Street station as I have 2 results in the city centre and hadn't set my no results behaviour to set to "visitor" so it should go to your current location if there are no results. I'm assuming this will now function correctly.
This is my latest attempt in Firefox - I have clicked "always allow my location" and its located me in the city centre of Manchester when I'm in the south - I have no fallbacks enabled so I'm wondering where it's getting this information from - is this expected behaviour?
I have +/- controls do you not see them? And what is the full attribution message in the bottom right that you mention?
Ps Leaflet More Maps - is this usable with this current project?
Kind regards,
Garry.
Comment #6
RdeBoerWell I don't know whether it's what you did or what I'm drinking (it's midnight in Melbourne), but guess what....
I now:
o see the +/- in the bottom left (so relocated and styled differently -- you must be injecting some serious CSS there)
o in Firefox as well as Chrome: see the "Your retrieved location" marker, styled in bright green, positioned right on the couch where I'm typing this!
o attribution: just realised this only applies to Leaflet More Maps.... when you use Leaflet More Maps... the attribution is usually a little longer. That's all... ignore the attribution comment...
So tell me: what did you do to 1) make this not happen 2) make it happen?
PS: Leaflet More Maps will work with "this" project -- if it doesn't I'll be on it like a pack of wolves!
Comment #7
GBain22 CreditAttribution: GBain22 commentedI simply just changed the option for "No locatons behaviour" to "visitor" - but it still doesn't make much sense to me that it's working - I'm going to carry on testing on other peoples machines etc so I'll report back if I find anything is still being odd. Thanks so much for helping me anyway especially if you've been drinking haha
Love this project so much it's enabled me to do the impossible with drupal and integrate leaflet and views - I'll get back to you when I can to ensure this problem is solved.
Cheers,
Garry.
Comment #8
RdeBoerFinal sip:
Please do report back about your findings!
And don't forget: Leaflet More Maps -- no external libraries, not configuration, works out of the box....
And then after that, once you have a few more locations/markers on your map: Leaflet MarkerCluster ... beautiful... (one easy JS library install)
Nite, nite....
Rik
Comment #9
GBain22 CreditAttribution: GBain22 commentedHi Rik,
Problem seems to reside in IE9 and below - I'm consistently getting:
getCurrentPosition() returned error 2: position unavailable (connection lost?). Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET4.0C; BRI/2) -- No fallback. Neither Smart IP nor GeoIP API are enabled.
Not sure what could be done about this - seems to be fine in IE10 however.
Cheers,
Garry.
Comment #10
RdeBoerFor 7.x-1.23 I have discontinued the use of a piece of javascript that offered location support for browsers that didn't support HTML5-style getCurrentPosition().
I thought IE9 would at least have it... See http://diveintohtml5.info/geolocation.html
And certainly Firefox -- is Firefox still not working for you?
Hmm... You could give IPGV&M 7.x-1.22 a go... see if that improves things. If that is the case, then I'll bring back that javascript.... darn....
Comment #11
GBain22 CreditAttribution: GBain22 commentedSeems to be working ok but IE9 is playing up on different machines - I'll close issues for now. Thanks for all the feedback!
Comment #12
RdeBoer@GBain22, #11:
Re: "Seems to be working ok"... is that with IPGV&M 7.x-1.22 or 7.x-1.23 ?
Rik
Comment #13
dottormeno CreditAttribution: dottormeno commentedI used:
IPGV&M: 7.x-1.23
mapping engine with IPGV&M: OpenLayers API
Geofield 7.x-2.x
In views i have:
default contextual filter for proximity
Visitor location attribute (IPGV&M)
Location attribute to use: Latitude, Longitude
Broswer:
Firefox 24.0 not work
Chrome 28.0.1500.71 work
Safari work
Explorer 10 not work
I have this notices:
IPGV&M, 91.252.164.83: getCurrentPosition() returned error 3: timeout. Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 -- No fallback. Neither Smart IP nor GeoIP API are enabled.
Notice: Undefined index: latitude in ip_geoloc_plugin_argument_default_ip_geoloc->get_argument() (linea 48 di /var/www/vhosts/................../htdocs/sites/all/modules/ip_geoloc/views/ip_geoloc_plugin_argument_default_ip_geoloc.inc).
Notice: Undefined index: longitude in ip_geoloc_plugin_argument_default_ip_geoloc->get_argument() (linea 48 di /var/www/vhosts/....................../htdocs/sites/all/modules/ip_geoloc/views/ip_geoloc_plugin_argument_default_ip_geoloc.inc).
Comment #14
RdeBoer@dottormeno:
Thanks for your report... that's interesting that IE 10 and Firefox 24.0 don't work for you.
Do you get that error consistently "getCurrentPosition() returned error 3: timeout." ? Or just every now and then?
The "Notice: undefined index" is a bug that I will fix. It may be a side-effect of the above error. I'll have to check.
Rik
Comment #15
dottormeno CreditAttribution: dottormeno commentedThanks for the quick response, I have this error constantly
Comment #16
RdeBoerThe timeout message comes from the browser, the IPGV&M module simply displays it in the watchdog.
Are there any additional messages in the browser console?
Rik
Comment #17
dottormeno CreditAttribution: dottormeno commentedURL richiesta: https://www.googleapis.com/geolocation/v1/geolocate?key=no-google-api-key
Metodo di richiesta: POST
Codice di stato: HTTP/1.1 400 Bad Request
Header della richiesta 14:15:43.000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0
Pragma: no-cache
Host: www.googleapis.com
Content-Type: application/json; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Cache-Control: no-cache
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Header della risposta Δ78ms
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Firefox-Spdy: 3
X-Content-Type-Options: nosniff
Server: GSE
Expires: Wed, 25 Sep 2013 12:15:43 GMT
Date: Wed, 25 Sep 2013 12:15:43 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 132
Content-Encoding: gzip
Cache-Control: private, max-age=0
Alternate-Protocol: 443:quic
Comment #18
RdeBoerThat URL at the top of reply #17 is not issued by IPGV&M: https://www.googleapis.com/geolocation/v1/geolocate?key=no-google-api-key
Do you have a module enabled that may be issuing that GoogleAPI URL?
Because it fails, maybe the rest of the page doesn't load or doesn't have its javascript executed, so it could be the reason for what you're seeing.
I don't understand why it is dependent on your browser though...
Comment #19
cmonnow CreditAttribution: cmonnow commentedFor those visiting from Google with the problem that in Firefox the map fails to appear (appears as a grey box), and those with logging may have the error along the lines of "getCurrentPosition() returned error 3", it may be related to your version of Firefox.
This happened to me with the "approved" default version of Firefox in Ubuntu (version 26.0) and the problem appeared rectified once I installed the "official" equivalent version of Firefox (also happened to be 26.0) from Ubuntuzilla. I don't know if this was a co-incidence or not or if the solution would be advisable but it's what worked for me.
UPDATE: Note that while v26.0 is better it's still not perfect so you may want to downgrade your browser to v23.0 (or earlier).
Documented elsewhere:
(i) https://support.mozilla.org/en-US/questions/971765
(ii) http://stackoverflow.com/questions/19648455/firefox-navigator-geolocation-getcurrentposition-does-not-succeed-anymore/19658250#19658250
Comment #20
RdeBoer@cmonnow:
Thank you for you taking the time to write your post and for the links!
Rik
Comment #21
RdeBoerFirefox 27.0 is out now.
Comment #22
cmonnow CreditAttribution: cmonnow commentedWhile I don't use Windows it appears that Firefox 27 may still have the same issues (I personally use an unofficial Firefox in Ubuntu), according to one user in https://support.mozilla.org/en-US/questions/971765.
A workaround to the bug was to start Firefox as an Administrator once and this appeared to trigger the changes necessary to subsequently use geolocation in Firefox without admin privileges.
Comment #23
RdeBoerThanks for the update cmonnow!
Very helpful.
Rik