/// <summary> /// Raises the element changed event. /// </summary> /// <param name="e">E event.</param> protected override void OnElementChanged(ElementChangedEventArgs<View> e) { base.OnElementChanged(e); if (e.OldElement == null) { this.mapView = Control as MapView; this.mapView.GetMapAsync(this); this.myMap = e.NewElement as FieldMap; } }
/// <summary> /// Get calles when Map is displayed. /// </summary> /// <param name="e">Event Arguments.</param> protected override void OnElementChanged(ElementChangedEventArgs<View> e) { base.OnElementChanged(e); if (e.OldElement == null) { this.mapView = Control as MKMapView; this.mapView.ShowsUserLocation = true; this.mapView.DidUpdateUserLocation += this.SetUserPostionOnce; this.mapView.AddGestureRecognizer(this.tapGesture); /* Readd LFHeatMap project first * Found at https://github.com/TreeWatch/LFHeatMaps * Code: * mapView.RegionChanged += ChangeRegion; */ this.myMap = e.NewElement as FieldMap; this.mapView.OverlayRenderer = this.GetOverlayRender; this.AddFields(); } }