Skip navigation.

Log in | Sign up

Opera Core Concerns

Official blog for Core developers at Opera

Geolocation-enabled build

, ,

We are delighted to release the first build of Opera with geolocation support. The geolocation Working Group of the W3C has recently relased the first Working Draft of the geolocation API specification, and we are now releasing the first Labs build with support for the API.

The API is used in a web page's Javascript code to retrieve the current latitude and longitude of the browser. The following snippet shows how a web page would request the browser's location:

// One-shot position request:
navigator.geolocation.getCurrentPosition(showMapCallback);

function showMapCallback(position) {
  // Show a map centered at (position.coords.latitude, position.coords.longitude).
}

As you can see, the API is very simple, and doesn't get much more complicated with more advanced functionalities (see more examples from the specification)

Geolocation on the web is not new. Many sites already use the IP address of the browser to serve targetted content, mostly ads (you will have seen the 'Find a Friend in [your city]' banners). However, that method is notoriously inaccurate and cannot be reliably used for more advanced geolocation services. On the other hand, the device which the browser is running on is more likely to have an accurate idea of its location if it has a GPS unit or can triangulate the wireless access points or cell towers, or look up its IP address. Even if the device doesn't have the right hardware, a location provider web service can be used. This build uses the Skyhook service, and therefore you will need to register your site on loki.com in order for your geo-enabled web application to be allowed to request the locations of users. Additionally, if you're running Windows XP you will also need to run svcsetup.exe, which ensures that wifi scanning will not be affected by various "wifi managers" that are shipped with many laptops. All this won't be necessary in future releases, but for now if you experience crashes, it is likely because you need to run svcsetup.exe first.

More importantly, leaving it to the browser to transmit its location means that the user can remain in control of their privacy. This build will prompt the user if they agree to send their location, every time a site requests it. While the UI in this build is experimental, it provides one possible way of protecting the user's privacy.

The W3C Geolocation API is likely to become a widely adopted standard, and Opera is providing this early implementation of the API to let developers and users start experimenting with it. We would be very grateful for feedback from both developers and users, on the API itself and on what functionality and level of privacy control you would like to see exposed in the user interface.

Once you have installed this build, you can go and test it out on our geolocation demo page, which will show were you are on a map, and will display scheduled near you.

Test automation with OperaWatirOpera's site patching

Comments

Tamil 26. March 2009, 12:00

godjonez 26. March 2009, 12:17

The build crashes every time I click on "Yes" to allow my location to be sent to that demo page.

This is in 32-bit Windows XP Professional, SP3.

EDIT: Managed to get it to work, a problem with the skyhook program.

sirnh1 26. March 2009, 12:20

Originally posted by maxfroumentin:

This build will prompt the user if they agree to send their location, every time a site requests it.


Sounds nice. Haven't tried the build (yet), but is there also an option (in the interface) to never show the prompt, but allways automaticly either refuse or allow the request no matter what page/site you are viewing?

Zotlan 26. March 2009, 12:36

Location was off by about a kilometre using IP address. Still, it's an interesting concept.

Originally posted by sirnh1:

Sounds nice. Haven't tried the build (yet), but is there also an option (in the interface) to never show the prompt, but allways automaticly either refuse or allow the request no matter what page/site you are viewing?


You can set it to remember your decision per site.
The Wingogi builds are meaningless as far as interface is concerned though. They're there to test the engine. They don't even use Opera's regular interface.


EDIT: interestingly www.nu.nl (very popular Dutch site with news snippets) also asks for your location but Wingogi crashes when you say yes.

sirnh1 26. March 2009, 12:49

hmmm... I just tried the build. Clicking the 'yes' button causes a crash for me (on the demo page), unless I check the 'remember me'-box.

Originally posted by Zotlan:

The Wingogi builds are meaningless as far as interface is concerned though


I know, but only realized it was a 'wingogi' build when I was unzipping my download :o:

mgillespie 26. March 2009, 13:30

Interestingly that this build identifies itself as Opera 9.70, with Presto 2.2.0 (Acid3 100%)

Is this an indication that the 9.x line of Opera may be getting the new Presto Engine, before Opera 10 arrives???

Hmmm, interesting.....

Chas4 26. March 2009, 13:49

:cool:

olli 26. March 2009, 14:02

mgillespie: No

sirnh1 26. March 2009, 14:23

After playing a little more with this build, I found that after clicking the 'retry' button, opera sometimes crashes. It even crashed once when I was only starting it (I pressed the retry button, opera crashed. I started this build again and as soon as the interface appeared opera crashed again.
It didn't even seem to try to load the page... :eyes: After starting again, all looked normal again... :eyes: )

EDIT: The test build says: "What's on near you. Showing events near Amsterdam". Sorry to say but Amsterdam is not where I am. (Amsterdam is in the netherlands, and I'm in belgium)

Yes I did run svcsetup.exe first, but still have a few dozen crashes...

Hmmm... 9 posts and 3 from me. I think I'll stop playing for today... :o:

Eddie_Lopez 26. March 2009, 14:36

maxfroumentin- nice avatar :smile:

ariesptn 26. March 2009, 17:01

That is a nice concept. Can't wait to try it.

Galileo 26. March 2009, 18:34

It works fine :smile: Crash report through the bug report wizard?

elvasvj 6. April 2009, 12:05

When will you test it on Opera Mini? Idea is natural and it's great to see u guys working on the subject.

netwolf 24. June 2009, 14:24

Will Opera 10 have geolocation support implemented?

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.