|
2 | 2 |
|
3 | 3 | using PlatformPolygonAnnotationOptions = Com.Mapbox.Maps.Plugin.Annotation.Generated.PolygonAnnotationOptions;
|
4 | 4 | using PlatformCircleAnnotationOptions = Com.Mapbox.Maps.Plugin.Annotation.Generated.CircleAnnotationOptions;
|
| 5 | +using PlatformPointAnnotationOptions = Com.Mapbox.Maps.Plugin.Annotation.Generated.PointAnnotationOptions; |
5 | 6 |
|
6 | 7 | public static class AnnotationExtensions
|
7 | 8 | {
|
| 9 | + internal static PlatformPointAnnotationOptions ToPlatformValue(this PointAnnotation annotation) |
| 10 | + { |
| 11 | + var result = new PlatformPointAnnotationOptions |
| 12 | + { |
| 13 | + IconAnchor = annotation.IconAnchor?.ToPlatform(), |
| 14 | + IconImage = annotation.IconImage, |
| 15 | + IconOffset = annotation.IconOffset?.ToPlatform(), |
| 16 | + IconRotate = annotation.IconRotate?.AsDouble(), |
| 17 | + IconSize = annotation.IconSize?.AsDouble(), |
| 18 | + SymbolSortKey = annotation.SymbolSortKey?.AsDouble(), |
| 19 | + TextAnchor = annotation.TextAnchor?.ToPlatform(), |
| 20 | + TextField = annotation.TextField, |
| 21 | + TextJustify = annotation.TextJustify?.ToPlatform(), |
| 22 | + TextLetterSpacing = annotation.TextLetterSpacing?.AsDouble(), |
| 23 | + TextLineHeight = annotation.TextLineHeight?.AsDouble(), |
| 24 | + TextMaxWidth = annotation.TextMaxWidth?.AsDouble(), |
| 25 | + TextOffset = annotation.TextOffset?.ToPlatform(), |
| 26 | + TextRadialOffset = annotation.TextRadialOffset?.AsDouble(), |
| 27 | + TextRotate = annotation.TextRotate?.AsDouble(), |
| 28 | + TextSize = annotation.TextSize?.AsDouble(), |
| 29 | + TextTransform = annotation.TextTransform?.ToPlatform(), |
| 30 | + IconColor = annotation.IconColor?.ToRgbaString(), |
| 31 | + IconHaloBlur = annotation.IconHaloBlur?.AsDouble(), |
| 32 | + IconHaloColor = annotation.IconHaloColor?.ToRgbaString(), |
| 33 | + IconHaloWidth = annotation.IconHaloWidth?.AsDouble(), |
| 34 | + IconOpacity = annotation.IconOpacity?.AsDouble(), |
| 35 | + TextColor = annotation.TextColor?.ToRgbaString(), |
| 36 | + TextHaloBlur = annotation.TextHaloBlur?.AsDouble(), |
| 37 | + TextHaloColor = annotation.TextHaloColor?.ToRgbaString(), |
| 38 | + TextHaloWidth = annotation.TextHaloWidth?.AsDouble(), |
| 39 | + TextOpacity = annotation.TextOpacity?.AsDouble(), |
| 40 | + } |
| 41 | + .WithDraggable(annotation.IsDraggable) |
| 42 | + .WithPoint((Com.Mapbox.Geojson.Point)annotation.GeometryValue.ToNative()); |
| 43 | + |
| 44 | + return result; |
| 45 | + } |
| 46 | + |
8 | 47 | internal static PlatformCircleAnnotationOptions ToPlatformValue(this CircleAnnotation annotation)
|
9 | 48 | {
|
10 | 49 | var result = new PlatformCircleAnnotationOptions
|
11 |
| - { |
12 |
| - CircleBlur = annotation.CircleBlur?.AsDouble(), |
13 |
| - CircleColor = annotation.CircleColor?.ToRgbaString(), |
14 |
| - CircleOpacity = annotation.CircleOpacity?.AsDouble(), |
15 |
| - CircleRadius = annotation.CircleRadius?.AsDouble(), |
16 |
| - CircleSortKey = annotation.CircleSortKey?.AsDouble(), |
17 |
| - CircleStrokeColor = annotation.CircleStrokeColor?.ToRgbaString(), |
18 |
| - CircleStrokeOpacity = annotation.CircleStrokeOpacity?.AsDouble(), |
19 |
| - CircleStrokeWidth = annotation.CircleStrokeWidth?.AsDouble(), |
20 |
| - } |
| 50 | + { |
| 51 | + CircleBlur = annotation.CircleBlur?.AsDouble(), |
| 52 | + CircleColor = annotation.CircleColor?.ToRgbaString(), |
| 53 | + CircleOpacity = annotation.CircleOpacity?.AsDouble(), |
| 54 | + CircleRadius = annotation.CircleRadius?.AsDouble(), |
| 55 | + CircleSortKey = annotation.CircleSortKey?.AsDouble(), |
| 56 | + CircleStrokeColor = annotation.CircleStrokeColor?.ToRgbaString(), |
| 57 | + CircleStrokeOpacity = annotation.CircleStrokeOpacity?.AsDouble(), |
| 58 | + CircleStrokeWidth = annotation.CircleStrokeWidth?.AsDouble(), |
| 59 | + } |
21 | 60 | .WithDraggable(annotation.IsDraggable)
|
22 | 61 | .WithPoint((Com.Mapbox.Geojson.Point)annotation.GeometryValue.ToNative());
|
23 | 62 |
|
|
0 commit comments