protected override BMKCircle CreateNativeItem(Circle item) { BMKCircle circle = BMKCircle.CircleWithCenterCoordinate( item.Coordinate.ToNative(), item.Radius ); item.NativeObject = circle; NativeMap.AddOverlay(circle); return(circle); }
protected override BMKPolyline CreateNativeItem(Polyline item) { CLLocationCoordinate2D[] coords = new CLLocationCoordinate2D[item.Points.Count]; for (int i = 0; i < coords.Length; i++) { coords[i] = item.Points[i].ToNative(); } BMKPolyline polyline = BMKPolyline.PolylineWithCoordinates(ref coords[0], (nuint)coords.Length); item.NativeObject = polyline; NativeMap.AddOverlay(polyline); ((INotifyCollectionChanged)(IList)item.Points).CollectionChanged += (sender, e) => { OnItemPropertyChanged(item, new PropertyChangedEventArgs(Polyline.PointsProperty.PropertyName)); }; return polyline; }