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 | /// ArcGIS_Topo_US_2D_Map provider, http://server.arcgisonline.com |
||
8 | /// </summary> |
||
9 | public class ArcGIS_Topo_US_2D_MapProvider : ArcGISMapPlateCarreeProviderBase |
||
10 | { |
||
11 | public static readonly ArcGIS_Topo_US_2D_MapProvider Instance; |
||
12 | |||
13 | ArcGIS_Topo_US_2D_MapProvider() |
||
14 | { |
||
15 | } |
||
16 | |||
17 | static ArcGIS_Topo_US_2D_MapProvider() |
||
18 | { |
||
19 | Instance = new ArcGIS_Topo_US_2D_MapProvider(); |
||
20 | } |
||
21 | |||
22 | #region GMapProvider Members |
||
23 | |||
24 | readonly Guid id = new Guid("7652CC72-5C92-40F5-B572-B8FEAA728F6D"); |
||
25 | public override Guid Id |
||
26 | { |
||
27 | get |
||
28 | { |
||
29 | return id; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | readonly string name = "ArcGIS_Topo_US_2D_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://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer/tile/4/3/15 |
||
54 | |||
55 | return string.Format(UrlFormat, zoom, pos.Y, pos.X); |
||
56 | } |
||
57 | |||
58 | static readonly string UrlFormat = "http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer/tile/{0}/{1}/{2}"; |
||
59 | } |
||
60 | } |