@@ -35,45 +35,6 @@ public void ApplyQueryAttributes(IDictionary<string, object> query)
35
35
36
36
private async void Map_MapReady ( object sender , EventArgs e )
37
37
{
38
- //var centerLocation = new MapPosition(37.3230, -122.0322); // Cupertino
39
- //var cameraOptions = new CameraOptions
40
- //{
41
- // Center = centerLocation,
42
- // Zoom = 14,
43
- //};
44
-
45
- //map.CameraOptions = cameraOptions;
46
- followPuckViewportState = map . Viewport . MakeFollowPuckViewportState ( new FollowPuckViewportStateOptions
47
- {
48
- Bearing = 0 ,
49
- Padding = new Thickness ( 200 , 0 , 0 , 0 ) ,
50
- } ) ;
51
-
52
- routePoints = await LoadGeojson ( ) ;
53
- overviewViewportState = map . Viewport . MakeOverviewViewportState ( new OverviewViewportStateOptions
54
- {
55
- Geometry = routePoints ,
56
- Padding = 100 ,
57
- } ) ;
58
-
59
- var geojsonSource = new GeoJSONSource ( GEOJSON_SOURCE_ID )
60
- {
61
- Data = routePoints
62
- } ;
63
- var lineLayer = new LineLayer ( ROUTE_LINE_LAYER_ID )
64
- {
65
- Source = GEOJSON_SOURCE_ID ,
66
- LineColor = MAPBOX_BLUE ,
67
- LineWidth = 10.0 ,
68
- LineCap = MapboxMaui . LineCap . Round ,
69
- LineJoin = MapboxMaui . LineJoin . Round ,
70
- } ;
71
- map . Sources = [ geojsonSource ] ;
72
- map . Layers = [ lineLayer ] ;
73
-
74
- map . StyleLoaded += Map_StyleLoaded ;
75
- map . MapboxStyle = MapboxStyle . TRAFFIC_DAY ;
76
-
77
38
}
78
39
79
40
private void Map_MapTapped ( object sender , MapTappedEventArgs e )
@@ -156,9 +117,48 @@ private void ClearAdvancedGesturesForFollowPuckViewportState()
156
117
//map.GestureShoved -= HandleGestureShoved;
157
118
}
158
119
159
- private void Map_MapLoaded ( object sender , EventArgs e )
120
+ private async void Map_MapLoaded ( object sender , EventArgs e )
160
121
{
161
122
// Setup Styles, Annotations, etc here
123
+
124
+ //var centerLocation = new MapPosition(37.3230, -122.0322); // Cupertino
125
+ //var cameraOptions = new CameraOptions
126
+ //{
127
+ // Center = centerLocation,
128
+ // Zoom = 14,
129
+ //};
130
+
131
+ //map.CameraOptions = cameraOptions;
132
+ followPuckViewportState = map . Viewport . MakeFollowPuckViewportState ( new FollowPuckViewportStateOptions
133
+ {
134
+ Bearing = 0 ,
135
+ Padding = new Thickness ( 200 , 0 , 0 , 0 ) ,
136
+ } ) ;
137
+
138
+ routePoints = await LoadGeojson ( ) ;
139
+ overviewViewportState = map . Viewport . MakeOverviewViewportState ( new OverviewViewportStateOptions
140
+ {
141
+ Geometry = routePoints ,
142
+ Padding = 100 ,
143
+ } ) ;
144
+
145
+ var geojsonSource = new GeoJSONSource ( GEOJSON_SOURCE_ID )
146
+ {
147
+ Data = routePoints
148
+ } ;
149
+ var lineLayer = new LineLayer ( ROUTE_LINE_LAYER_ID )
150
+ {
151
+ Source = GEOJSON_SOURCE_ID ,
152
+ LineColor = MAPBOX_BLUE ,
153
+ LineWidth = 10.0 ,
154
+ LineCap = MapboxMaui . LineCap . Round ,
155
+ LineJoin = MapboxMaui . LineJoin . Round ,
156
+ } ;
157
+ map . Sources = [ geojsonSource ] ;
158
+ map . Layers = [ lineLayer ] ;
159
+
160
+ map . StyleLoaded += Map_StyleLoaded ;
161
+ map . MapboxStyle = MapboxStyle . TRAFFIC_DAY ;
162
162
}
163
163
164
164
async static Task < LineString > LoadGeojson ( )
0 commit comments