[OSM-talk] map with FF 3.5 geolocation und hostip

Frankie Roberto frankie at frankieroberto.com
Mon Jul 6 10:51:36 BST 2009


This thread seems to have been slightly side-tracked, but to take it back to
the original suggestion, browser-based geolocation APIs are really quite a
big deal, and are something we should definitely look to support.

The most obvious implementation we could do would be where users visit the
slippy map without having a location set in their cookie. Currently we guess
at a location via IP address, but it would be good (and not difficult) to
use the geolocation API here instead, falling back on the existing IP-based
method if the API isn't present or if the user declines to authorise
permission.

A more complicated interaction would be where the user has a location set in
their cookie (eg of the place they were last interested in), but has since
moved location, and wants to see the map of where they are now. For this,
we'd probably want some kind of button (which only appears if you have the
geolocation API in your browser) which would re-centre the map on their
browser-provided geolocation.

A final scenario is where the user is in motion, and wants the map to pan so
that it 'follows' their movements. This is unlikely for most desktop
computers, but can be interesting when you've got a laptop open on a train
(which is how I've tested it), or of course are using a mobile device (and
I'm not sure of any which implement the browser geolocation API yet, but it
can only be a matter of time).

I only currently only know of the W3C draft standard geolocation API (
http://dev.w3.org/geo/api/spec-source.html), which Firefox 3.5 implements,
or available on older versions using the Georde plugin, and the Google Gears
geolocation API (http://code.google.com/apis/gears/api_geolocation.html)
which is almost identical to the standard one, apart from a few minor
details.

I don't think OpenLayers currently supports this functionality natively
(although maybe there are plans to do so?), but I've got a script working
locally that interfaces with OpenLayers to provide this, and there are
dozens of others (Aaron has one too:
http://github.com/straup/js-iamheremap/tree/master, working example here:
http://www.aaronland.info/iamhere/).

If people think that adding this functionality would be useful, then I'd be
happy to help implement it (I've very nearly got the Rails port working
locally - just a couple more dependencies to go...)

Frankie

P.S  The next step for browser-based map interfaces might be a compass
bearing API - so that we can rotate maps to match the orientation of the
user... :-)

On Sat, Jul 4, 2009 at 7:41 PM, John Smith <delta_foxtrot at yahoo.com> wrote:

>
> --- On Sat, 4/7/09, Aun Yngve Johnsen <skippern at gimnechiske.org> wrote:
>
> > Totally agree, I would love to see more OSM in the press,
> > but I have absolutely no clue in how to manage it...
>
> Ask Apple or Mozilla for help?
>
>
>
>
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
>



-- 
Frankie Roberto
Experience Designer, Rattle
0114 2706977
http://www.rattlecentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20090706/2eadd2bf/attachment.html>


More information about the talk mailing list