Access GPS from Silverlight Application

2610
5
10-12-2011 08:46 AM
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I have a scenario where I'd like to build a Silverlight app for editing data in the field.  Since the users will need to know their current location they'd like to be able to display on the map their current location from a GPS unit connected to the laptop. 

Is this even possible?  If so, anybody have any pointers to get me started?
0 Kudos
5 Replies
dotMorten_esri
Esri Notable Contributor
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
See this blogpost: http://davetimmins.wordpress.com/2011/09/20/geolocation-with-the-esri-silverlight-api/


Hmmmm..  I like it.  The only issue I have is that I'm still in the world of Visual Basic so I'll have to convert it.

Second, if I'm connected to GPS, will it give me GPS location, or is it still network location?
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
Hmmmm..  I like it.  The only issue I have is that I'm still in the world of Visual Basic so I'll have to convert it.

Second, if I'm connected to GPS, will it give me GPS location, or is it still network location?


Update:  Got the code converting and working on my site.  I'm still wondering about question #2... IF I connect a GPS to a laptop, is there a way to use its location as opposed to the network?  I've changed the javascript code to read: 
navigator.geolocation.watchPosition(success, fail, { enableHighAccuracy: true, maximumAge:600000});

however I don't notice a difference in location
0 Kudos
IgressT
New Contributor II
I have a similar application going on in VB6. I have a GPS receiver attached to the laptop and through Microsoft Comm control I read the incoming string which is in NMEA format and parse it to get latitude and longitude values and then show it on my map...
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I have a similar application going on in VB6. I have a GPS receiver attached to the laptop and through Microsoft Comm control I read the incoming string which is in NMEA format and parse it to get latitude and longitude values and then show it on my map...


Easy enough to do with a desktop application, but I'm trying to do this with a silverlight app.  Since Silverlight runs in a sandbox, it cannot connect to physical devices on the local machine.  I came across this:  http://interopcom.codeplex.com however I've not been able to get it to work.  Morton's post above worked well in theory but the accuracy is just way too far off.  Sometimes the location is miles away from where I really am. 

Still looking for suggestions.
0 Kudos