GPS Layer showing the current location and accuracy.
Inheritance: GraphicsLayer, INotifyPropertyChanged
Example #1
0
        private static void OnGeoCoordinatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GpsLayer obj = (GpsLayer)d;

            if (obj.GeoCoordinateChanged != null)
            {
                obj.GeoCoordinateChanged(obj, EventArgs.Empty);
            }
            obj.OnPropertyChanged("GeoCoordinate");
        }
Example #2
0
        private static void OnIsEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GpsLayer layer = d as GpsLayer;

            if (!(bool)e.NewValue)
            {
                if (layer.GeoPositionWatcher != null)
                {
                    layer.GeoPositionWatcher.Stop();
                }
            }
            else
            {
                layer.TryStartGps();
            }
        }
Example #3
0
        private static void GeoPositionWatcherPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GpsLayer layer = d as GpsLayer;

            if (e.OldValue != null)
            {
                layer.DetachListeners(e.OldValue as IGeoPositionWatcher <GeoCoordinate>);
            }
            if (e.NewValue != null)
            {
                layer.AttachListeners(e.NewValue as IGeoPositionWatcher <GeoCoordinate>);
                if (layer.IsInitialized && layer.IsEnabled)
                {
                    layer.TryStartGps();
                }
            }
        }
Example #4
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Wheels@SG;component/AppPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ApplicationTitle = ((System.Windows.Controls.TextBlock)(this.FindName("ApplicationTitle")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.esriMap = ((ESRI.ArcGIS.Client.Map)(this.FindName("esriMap")));
     this.myGpsLayer = ((ESRI.ArcGIS.Client.Toolkit.DataSources.GpsLayer)(this.FindName("myGpsLayer")));
     this.button1 = ((System.Windows.Controls.Button)(this.FindName("button1")));
     this.button2 = ((System.Windows.Controls.Button)(this.FindName("button2")));
     this.MyInfoWindow = ((ESRI.ArcGIS.Client.Toolkit.InfoWindow)(this.FindName("MyInfoWindow")));
     this.createEvent = ((System.Windows.Controls.Primitives.Popup)(this.FindName("createEvent")));
     this.tbEventName = ((System.Windows.Controls.TextBox)(this.FindName("tbEventName")));
     this.tbDescription = ((System.Windows.Controls.TextBox)(this.FindName("tbDescription")));
     this.tbAddress = ((System.Windows.Controls.TextBox)(this.FindName("tbAddress")));
     this.btn_checkin = ((System.Windows.Controls.Button)(this.FindName("btn_checkin")));
     this.btn_cancel = ((System.Windows.Controls.Button)(this.FindName("btn_cancel")));
 }