Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2287 - 1

2
namespace GMap.NET.MapProviders
3
{
4
   using System;
5
 
6
   /// <summary>
7
   /// Lithuania3dMap (2.5d) provider
8
   /// </summary>
9
   public class Lithuania3dMapProvider : LithuaniaMapProviderBase
10
   {
11
      public static readonly Lithuania3dMapProvider Instance;
12
 
13
      Lithuania3dMapProvider()
14
      {
15
      }
16
 
17
      static Lithuania3dMapProvider()
18
      {
19
         Instance = new Lithuania3dMapProvider();
20
      }
21
 
22
      #region GMapProvider Members
23
 
24
      readonly Guid id = new Guid("CCC5B65F-C8BC-47CE-B39D-5E262E6BF083");
25
      public override Guid Id
26
      {
27
         get
28
         {
29
            return id;
30
         }
31
      }
32
 
33
      readonly string name = "Lithuania 2.5d Map";
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://dc1.maps.lt/cache/mapslt_25d_vkkp/map/_alllayers/L01/R00007194/C0000a481.png
54
         int z = zoom;
55
         if(zoom >= 10)
56
         {
57
            z -= 10;
58
         }
59
 
60
         return string.Format(UrlFormat, z, pos.Y, pos.X);
61
      }
62
 
63
      static readonly string UrlFormat = "http://dc1.maps.lt/cache/mapslt_25d_vkkp/map/_alllayers/L{0:00}/R{1:x8}/C{2:x8}.png";
64
   }
65
}