Select to view content in your preferred language

SaveGPS Values Lat and Long (WIN)

1240
0
10-19-2010 09:29 AM
AkhilParujanwala
Regular Contributor
Hi, I am working on trying get Lat and Long values and then store them into the new feature being collected. There is a Windows Mobile sample which works perfectly fine (after some modifications). However when I tried to re-write the code to make it work for Windows Tablet versions, it doesn't work at all and causes the program crash.

below is the code I am using for testing purposes.

public class GPSValues_Win : ProjectExtension
    {

        private CollectFeaturesTask m_collectFeaturesTask;
        private GpsConnection gps;
        private GpsAveragingGeometryCollectionMethod m_GPSAveraging;      

        protected override void Initialize()
        {
            gps = MobileApplication.Current.GpsConnectionManager.Connection;            
            m_collectFeaturesTask = MobileApplication.Current.Project.Tasks.GetFirstExtensionOfType(typeof(CollectFeaturesTask)) as CollectFeaturesTask;
            m_GPSAveraging = new GpsAveragingGeometryCollectionMethod();            
            //m_GPSAveraging.Completed += new EventHandler<CompletedEventArgs>(Geometry_Completed);
            m_GPSAveraging.Completed += new EventHandler<CompletedEventArgs>(m_GPSAveraging_Completed);
            //ESRI.ArcGIS.Mobile.Client.Windows.MessageBox.ShowDialog("this happens whe you device to pick a collection method");
            
        }

        void m_GPSAveraging_Completed(object sender, CompletedEventArgs e)
        {
            ESRI.ArcGIS.Mobile.Client.Windows.MessageBox.ShowDialog("This happens when GPS is complete");            
        }        



The code sample for Windows Mobile that ESRI provides is located here:
http://www.arcgis.com/home/item.html?id=c11fa66674a9422c881061fec9197d73

Thanks in advance for your help.


Akhil P.
0 Kudos
0 Replies