@@ -9,58 +9,58 @@ public class OfflineManagerExample : ContentPage, IExamplePage, IQueryAttributab
9
9
float tokyoZoom = 12 ;
10
10
IOfflineManager offlineManager ;
11
11
12
- public OfflineManagerExample ( )
12
+ public OfflineManagerExample ( )
13
13
{
14
- iOSPage . SetUseSafeArea ( this , false ) ;
14
+ iOSPage . SetUseSafeArea ( this , false ) ;
15
15
Content = map = new MapboxView ( ) ;
16
16
tokyoCoord = new Point ( 35.682027 , 139.769305 ) ;
17
17
18
- map . MapReady += Map_MapReady ;
18
+ map . MapReady += Map_MapReady ;
19
19
}
20
20
21
21
private void Map_MapReady ( object sender , EventArgs e )
22
22
{
23
- var cameraOptions = new CameraOptions
23
+ var cameraOptions = new CameraOptions
24
24
{
25
- Center = tokyoCoord ,
26
- Zoom = tokyoZoom ,
25
+ Center = tokyoCoord ,
26
+ Zoom = tokyoZoom ,
27
27
} ;
28
28
map . CameraOptions = cameraOptions ;
29
29
map . MapboxStyle = MapboxStyle . OUTDOORS ;
30
30
31
31
offlineManager = new OfflineManager (
32
- MauiProgram . ACCESS_TOKEN ,
32
+ MauiProgram . AccessToken ,
33
33
cameraOptions ) ;
34
34
35
35
offlineManager . IsMapboxStackConnected = true ;
36
36
37
37
offlineManager . DownloadStyle (
38
38
MapboxStyle . OUTDOORS . Value ,
39
- new StylePackLoadOptions
39
+ new StylePackLoadOptions
40
40
{
41
- Mode = GlyphsRasterizationMode . IdeographsRasterizedLocally ,
42
- Metadata = new Dictionary < string , object >
43
- {
44
- { @"tag" , @"my-outdoors-style-pack" }
45
- }
41
+ Mode = GlyphsRasterizationMode . IdeographsRasterizedLocally ,
42
+ Metadata = new Dictionary < string , object >
43
+ {
44
+ { @"tag" , @"my-outdoors-style-pack" }
45
+ }
46
46
} ,
47
- ( progress ) =>
47
+ ( progress ) =>
48
48
{
49
- System . Diagnostics . Debug . WriteLine ( $ "PROGRESS:DownloadStyle {
50
- progress . CompletedResourceCount } /{
51
- progress . RequiredResourceCount } " ) ;
49
+ System . Diagnostics . Debug . WriteLine ( $ "PROGRESS:DownloadStyle {
50
+ progress . CompletedResourceCount } /{
51
+ progress . RequiredResourceCount } " ) ;
52
52
} ,
53
- ( stylePack , exception ) =>
53
+ ( stylePack , exception ) =>
54
54
{
55
- if ( exception != null )
56
- {
57
- System . Diagnostics . Debug . WriteLine ( $ "ERR:DownloadStyle { exception . Message } ") ;
58
- return ;
55
+ if ( exception != null )
56
+ {
57
+ System . Diagnostics . Debug . WriteLine ( $ "ERR:DownloadStyle { exception . Message } ") ;
58
+ return ;
59
59
}
60
-
61
- System . Diagnostics . Debug . WriteLine ( $ "DONE:DownloadStyle {
62
- stylePack . CompletedResourceCount } /{
63
- stylePack . RequiredResourceCount } " ) ;
60
+
61
+ System . Diagnostics . Debug . WriteLine ( $ "DONE:DownloadStyle {
62
+ stylePack . CompletedResourceCount } /{
63
+ stylePack . RequiredResourceCount } " ) ;
64
64
} ) ;
65
65
66
66
var tilesetDescriptorOptions = new TilesetDescriptorOptions (
@@ -76,31 +76,31 @@ private void Map_MapReady(object sender, EventArgs e)
76
76
TilesetDescriptors : new [ ] { tilesetDescriptorOptions } ,
77
77
AcceptsExpired : true ,
78
78
NetworkRestriction : NetworkRestriction . None ,
79
- Metadata : new Dictionary < string , object >
80
- {
81
- { @"tag" , @"my-outdoors-tile-region" }
79
+ Metadata : new Dictionary < string , object >
80
+ {
81
+ { @"tag" , @"my-outdoors-tile-region" }
82
82
} ) ;
83
83
84
84
offlineManager . DownloadTile (
85
85
tileRegionId ,
86
86
tileRegionLoadOptions ,
87
- progress =>
87
+ progress =>
88
88
{
89
- System . Diagnostics . Debug . WriteLine ( $ "PROGRESS:DownloadTile {
90
- progress . CompletedResourceCount } /{
91
- progress . RequiredResourceCount } " ) ;
89
+ System . Diagnostics . Debug . WriteLine ( $ "PROGRESS:DownloadTile {
90
+ progress . CompletedResourceCount } /{
91
+ progress . RequiredResourceCount } " ) ;
92
92
} ,
93
- ( tileRegion , exception ) =>
93
+ ( tileRegion , exception ) =>
94
94
{
95
- if ( exception != null )
96
- {
97
- System . Diagnostics . Debug . WriteLine ( $ "ERR:DownloadTile { exception . Message } ") ;
98
- return ;
95
+ if ( exception != null )
96
+ {
97
+ System . Diagnostics . Debug . WriteLine ( $ "ERR:DownloadTile { exception . Message } ") ;
98
+ return ;
99
99
}
100
100
101
- System . Diagnostics . Debug . WriteLine ( $ "DONE:DownloadTile {
102
- tileRegion . CompletedResourceCount } /{
103
- tileRegion . RequiredResourceCount } " ) ;
101
+ System . Diagnostics . Debug . WriteLine ( $ "DONE:DownloadTile {
102
+ tileRegion . CompletedResourceCount } /{
103
+ tileRegion . RequiredResourceCount } " ) ;
104
104
} ) ;
105
105
}
106
106
0 commit comments