Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2498 - 1

2
namespace GMap.NET.MapProviders
3
{
4
   using System;
5
 
6
   /// <summary>
7
   /// GoogleSatelliteMap provider
8
   /// </summary>
9
   public class GoogleSatelliteMapProvider : GoogleMapProviderBase
10
   {
11
      public static readonly GoogleSatelliteMapProvider Instance;
12
 
13
      GoogleSatelliteMapProvider()
14
      {
15
      }
16
 
17
      static GoogleSatelliteMapProvider()
18
      {
19
         Instance = new GoogleSatelliteMapProvider();
20
      }
21
 
22
        public string Version = "702";//"192";
23
 
24
      #region GMapProvider Members
25
 
26
      readonly Guid id = new Guid("9CB89D76-67E9-47CF-8137-B9EE9FC46388");
27
      public override Guid Id
28
      {
29
         get
30
         {
31
            return id;
32
         }
33
      }
34
 
35
      readonly string name = "GoogleSatelliteMap";
36
      public override string Name
37
      {
38
         get
39
         {
40
            return name;
41
         }
42
      }
43
 
44
      public override PureImage GetTileImage(GPoint pos, int zoom)
45
      {
46
         string url = MakeTileImageUrl(pos, zoom, LanguageStr);
47
 
48
         return GetTileImageUsingHttp(url);
49
      }
50
 
51
      #endregion
52
 
53
      string MakeTileImageUrl(GPoint pos, int zoom, string language)
54
      {
55
         string sec1 = string.Empty; // after &x=...
56
         string sec2 = string.Empty; // after &zoom=...
57
         GetSecureWords(pos, out sec1, out sec2);
58
 
59
         return string.Format(UrlFormat, UrlFormatServer, GetServerNum(pos, 4), UrlFormatRequest, Version, language, pos.X, sec1, pos.Y, zoom, sec2, Server);
60
      }
61
 
62
      static readonly string UrlFormatServer = "khm";
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}";
65
   }
66
}