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
   /// NearSatelliteMap provider - http://www.nearmap.com/
8
   /// </summary>
9
   public class NearSatelliteMapProvider : NearMapProviderBase
10
   {
11
      public static readonly NearSatelliteMapProvider Instance;
12
 
13
      NearSatelliteMapProvider()
14
      {
15
      }
16
 
17
      static NearSatelliteMapProvider()
18
      {
19
         Instance = new NearSatelliteMapProvider();
20
      }
21
 
22
      #region GMapProvider Members
23
 
24
      readonly Guid id = new Guid("56D00148-05B7-408D-8F7A-8D7250FF8121");
25
      public override Guid Id
26
      {
27
         get
28
         {
29
            return id;
30
         }
31
      }
32
 
33
      readonly string name = "NearSatelliteMap";
34
      public override string Name
35
      {
36
         get
37
         {
38
            return name;
39
         }
40
      }
41
 
42
      public override PureImage GetTileImage(GPoint pos, int zoom)
43
      {
44
         string url = MakeTileImageUrl(pos, zoom, LanguageStr);
45
 
46
         return GetTileImageUsingHttp(url);
47
      }
48
 
49
      #endregion
50
 
51
      string MakeTileImageUrl(GPoint pos, int zoom, string language)
52
      {
53
         // http://web2.nearmap.com/maps/hl=en&x=14&y=8&z=5&nml=Vert&s=kdj00
54
         // http://web2.nearmap.com/maps/hl=en&x=6&y=4&z=4&nml=Vert
55
         // http://web2.nearmap.com/maps/hl=en&x=3&y=1&z=3&nml=Vert&s=2edd
56
         // http://web0.nearmap.com/maps/hl=en&x=69&y=39&z=7&nml=Vert&s=z80wiTM
57
 
58
         return string.Format(UrlFormat, GetServerNum(pos, 4), pos.X, pos.Y, zoom, GetSafeString(pos));
59
      }
60
 
61
      static readonly string UrlFormat = "http://web{0}.nearmap.com/maps/hl=en&x={1}&y={2}&z={3}&nml=Vert{4}";
62
   }
63
}