I went to http://www.html5rocks.com, and some of the samples didn’t work. The one that did, however, was Geolocation. I thought it was neat because you didn’t need to utilize an iPhone/Android phone to get Geolocation data, and thus know where you are. I’ve read on Twitter that it’s not very accurate. Not sure how it works, but it’s been accurate for me. The browser support, however, has been atrocious. So far, the sample below only works in Chrome and Opera. Safari and Firefox don’t seem to work for me. Safari does pop up the permission dialogue, but just sits there; no error, no update. Regardless, I wanted to see if I could integrate that location data into Flash.
If you’re running in AIR2 or Flash Lite 4, there is already a native Geolocation API You can utilize straight from ActionScript 3. If you’re in the browser on the desktop, however, it’s not available unless you tap into the browser API’s which I’ve done.
Flex Geolocation Example – Larger View | Source
7 Replies to “Using Geolocation with Flex in the Browser”
How exactly does HTML5’s Geolocation work?
Link via Mrinal Wadhwa
Firefox worked here. (OSX, Firefox 3.6.6) but Safari5 failed.
I believe the browser wifi access points to triangulate your location. I noticed that I get a horrible geolocation point when I use my direct Ethernet connection at work. (I think it attempts IP geolocation, which is very ineffective). However, when I turned on my wifi, my browser was able to locate me very accurately. Creepily accurately.
Firefox 3.7 on Windows 7 worked here…it’s creepy, it pinpointed the exact building I am in.
You can try this library to integrate geolocation and flex easily: http://code.google.com/p/asgeolocation/
Worked fine for me on Firefox 3.6.6 – very accurately!!
@Sanjay The wifi is very accurate because wifi access points broadcast their location.
Comments are closed.