Its fairly easy.

These are the steps:

1. Set up OL map (I assume you have this)
2. Read data from GPS
3. call map.setCenter with the GPS data

Step 2 varies, depending on the GPS brand.
Usually you can tweak the device to put out NMEA compliant data on a COM port.
NMEA is human readable, and specs can be found online.

Step 3 may cause trouble, because you have to interact with a javascript inside a page. On way is to simply host the page in an application, ie. a .Net form, then the access is there.

Another way is to create a webservice / micro webserver that returns the current position. A javascript inside the page can then poll the position (via AJAX), and update the center.

You may run into trouble if your map is projected into something thats not Lat/Lon compatible. In that case, take a look at the Proj.4 library, avalible for both javascript and regular programming.

Regards, Kenneth Skovhede, GEOGRAF A/S



Didrik Pinte skrev:
Hi,

One of my client asked me if it was possible to control the center of an
openlayer map by an external GPS connected to it's laptop ...
I have googled a bit about this but found nothing.

Does anybody have an interesting suggestion ? link ? idea ?

Thanks

Didrik
------------------------------------------------------------------------

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to