Rev 2289 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2289 | Rev 2294 | ||
---|---|---|---|
1 | |
1 | |
2 | namespace GMap.NET.MapProviders |
2 | namespace GMap.NET.MapProviders |
3 | { |
3 | { |
4 | using System; |
4 | using System; |
5 | 5 | ||
6 | /// <summary> |
6 | /// <summary> |
7 | /// GoogleSatelliteMap provider |
7 | /// GoogleSatelliteMap provider |
8 | /// </summary> |
8 | /// </summary> |
9 | public class GoogleSatelliteMapProvider : GoogleMapProviderBase |
9 | public class GoogleSatelliteMapProvider : GoogleMapProviderBase |
10 | { |
10 | { |
11 | public static readonly GoogleSatelliteMapProvider Instance; |
11 | public static readonly GoogleSatelliteMapProvider Instance; |
12 | 12 | ||
13 | GoogleSatelliteMapProvider() |
13 | GoogleSatelliteMapProvider() |
14 | { |
14 | { |
15 | } |
15 | } |
16 | 16 | ||
17 | static GoogleSatelliteMapProvider() |
17 | static GoogleSatelliteMapProvider() |
18 | { |
18 | { |
19 | Instance = new GoogleSatelliteMapProvider(); |
19 | Instance = new GoogleSatelliteMapProvider(); |
20 | } |
20 | } |
21 | 21 | ||
22 | public string Version = "701";//"192"; |
22 | public string Version = "702";//"192"; |
23 | 23 | ||
24 | #region GMapProvider Members |
24 | #region GMapProvider Members |
25 | 25 | ||
26 | readonly Guid id = new Guid("9CB89D76-67E9-47CF-8137-B9EE9FC46388"); |
26 | readonly Guid id = new Guid("9CB89D76-67E9-47CF-8137-B9EE9FC46388"); |
27 | public override Guid Id |
27 | public override Guid Id |
28 | { |
28 | { |
29 | get |
29 | get |
30 | { |
30 | { |
31 | return id; |
31 | return id; |
32 | } |
32 | } |
33 | } |
33 | } |
34 | 34 | ||
35 | readonly string name = "GoogleSatelliteMap"; |
35 | readonly string name = "GoogleSatelliteMap"; |
36 | public override string Name |
36 | public override string Name |
37 | { |
37 | { |
38 | get |
38 | get |
39 | { |
39 | { |
40 | return name; |
40 | return name; |
41 | } |
41 | } |
42 | } |
42 | } |
43 | 43 | ||
44 | public override PureImage GetTileImage(GPoint pos, int zoom) |
44 | public override PureImage GetTileImage(GPoint pos, int zoom) |
45 | { |
45 | { |
46 | string url = MakeTileImageUrl(pos, zoom, LanguageStr); |
46 | string url = MakeTileImageUrl(pos, zoom, LanguageStr); |
47 | 47 | ||
48 | return GetTileImageUsingHttp(url); |
48 | return GetTileImageUsingHttp(url); |
49 | } |
49 | } |
50 | 50 | ||
51 | #endregion |
51 | #endregion |
52 | 52 | ||
53 | string MakeTileImageUrl(GPoint pos, int zoom, string language) |
53 | string MakeTileImageUrl(GPoint pos, int zoom, string language) |
54 | { |
54 | { |
55 | string sec1 = string.Empty; // after &x=... |
55 | string sec1 = string.Empty; // after &x=... |
56 | string sec2 = string.Empty; // after &zoom=... |
56 | string sec2 = string.Empty; // after &zoom=... |
57 | GetSecureWords(pos, out sec1, out sec2); |
57 | GetSecureWords(pos, out sec1, out sec2); |
58 | 58 | ||
59 | return string.Format(UrlFormat, UrlFormatServer, GetServerNum(pos, 4), UrlFormatRequest, Version, language, pos.X, sec1, pos.Y, zoom, sec2, Server); |
59 | return string.Format(UrlFormat, UrlFormatServer, GetServerNum(pos, 4), UrlFormatRequest, Version, language, pos.X, sec1, pos.Y, zoom, sec2, Server); |
60 | } |
60 | } |
61 | 61 | ||
62 | static readonly string UrlFormatServer = "khm"; |
62 | static readonly string UrlFormatServer = "khm"; |
63 | static readonly string UrlFormatRequest = "kh"; |
63 | static readonly string UrlFormatRequest = "kh"; |
64 | static readonly string UrlFormat = "http://{0}{1}.{10}/{2}/v={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}"; |
64 | static readonly string UrlFormat = "http://{0}{1}.{10}/{2}/v={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}"; |
65 | } |
65 | } |
66 | } |
66 | } |