How to Use Geolocation in Chrome Browser
Posted on 04. Mar, 2010 by Daniel Cawrey in Tutorials
The developer channel of Chrome has been updated today and the geolocation API is now built in. This allows developers to now work on apps and extensions that can take into account a user’s geographic coordinates. I’m not sure specifically what type of applications would incorporate this feature, but I could imagine this bringing a new tool in terms of localized social networking that could be pretty useful.
To use the geolocation feature, you must have the Google Chrome developer channel release of Chrome (version 5.0.342.1) and you must run a commnad line switch of “–enable-geolocation” when executing the chrome.exe application.
The release notes referenced that you could test this by going to http://maps.google.com and it would recognize that the feature was turned on. However, I could not get it to work at that URL. Instead I found another link in the notes to go to http://maps.google.co.uk/maps/m which must be the UK URL for the mobile maps app. When I went to this site, I was prompted with this messgae in Chrome:
I clicked the “Allow” button, and up popped my location. If you have ever used the Google Maps application on your smartphone, it is exactly like that, with the major difference being that you computer has much more processing power with which to build some useful tools and games around.
This has to be done every time you start Chrome if want this experimental API to be turned on. There are probably going to be some interesting apps that will be developed for this, and it is clear that this is a move further towards mobile computing for Chromium. Having this on the browser is only a start for where this is going in an operating system architecture. With that being said, what kind of apps do you envision there being with the geolocation API?






Scott
04. Mar, 2010
For the life of me I can’t figure out how to get ‘–enable-geolocation’ to work.
I keep getting an error message, saying Target is not valid, how do you get that to work?
Thanks!
Daniel Cawrey
04. Mar, 2010
I had that issue too – the only way I got it to work was by entering it directly into the command line.
I’ve been thinking about this since I wrote the article, and its probably best that you must do this to make it work for now. I don’t know if I’m entirely comfortable with having geolocation on all the time…
Scott
04. Mar, 2010
i have right clicked and went to properties of the shortcut and i just get an error message when i try any switch back!
i have to be missing something…
Thanks for replying!
Flowers Example « River Allen — SEng 130
11. Apr, 2011
[...] Support: Firefox, Safari, Chrome (developer version [link]) [...]