-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GMap.NET.Core: CzechMapProviderBaseOld
- Loading branch information
Showing
11 changed files
with
418 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0"?> | ||
<configuration> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
GMap.NET.Core/GMap.NET.MapProviders/CzechOld/CzechHistoryMapProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
| ||
namespace GMap.NET.MapProviders | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// CzechHistoryMap provider, http://www.mapy.cz/ | ||
/// </summary> | ||
public class CzechHistoryMapProviderOld : CzechMapProviderBaseOld | ||
{ | ||
public static readonly CzechHistoryMapProviderOld Instance; | ||
|
||
CzechHistoryMapProviderOld() | ||
{ | ||
} | ||
|
||
static CzechHistoryMapProviderOld() | ||
{ | ||
Instance = new CzechHistoryMapProviderOld(); | ||
} | ||
|
||
#region GMapProvider Members | ||
|
||
readonly Guid id = new Guid("C666AAF4-9D27-418F-97CB-7F0D8CC44544"); | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
return id; | ||
} | ||
} | ||
|
||
readonly string name = "CzechHistoryMap"; | ||
public override string Name | ||
{ | ||
get | ||
{ | ||
return name; | ||
} | ||
} | ||
|
||
GMapProvider[] overlays; | ||
public override GMapProvider[] Overlays | ||
{ | ||
get | ||
{ | ||
if(overlays == null) | ||
{ | ||
overlays = new GMapProvider[] { this, CzechHybridMapProviderOld.Instance }; | ||
} | ||
return overlays; | ||
} | ||
} | ||
|
||
public override PureImage GetTileImage(GPoint pos, int zoom) | ||
{ | ||
string url = MakeTileImageUrl(pos, zoom, LanguageStr); | ||
|
||
return GetTileImageUsingHttp(url); | ||
} | ||
|
||
#endregion | ||
|
||
string MakeTileImageUrl(GPoint pos, int zoom, string language) | ||
{ | ||
// http://m4.mapserver.mapy.cz/army2/9_7d00000_8080000 | ||
|
||
long xx = pos.X << (28 - zoom); | ||
long yy = ((((long)Math.Pow(2.0, (double)zoom)) - 1) - pos.Y) << (28 - zoom); | ||
|
||
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, xx, yy); | ||
} | ||
|
||
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/army2/{1}_{2:x7}_{3:x7}"; | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
GMap.NET.Core/GMap.NET.MapProviders/CzechOld/CzechHybridMapProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
| ||
namespace GMap.NET.MapProviders | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// CzechHybridMap provider, http://www.mapy.cz/ | ||
/// </summary> | ||
public class CzechHybridMapProviderOld : CzechMapProviderBaseOld | ||
{ | ||
public static readonly CzechHybridMapProviderOld Instance; | ||
|
||
CzechHybridMapProviderOld() | ||
{ | ||
} | ||
|
||
static CzechHybridMapProviderOld() | ||
{ | ||
Instance = new CzechHybridMapProviderOld(); | ||
} | ||
|
||
#region GMapProvider Members | ||
|
||
readonly Guid id = new Guid("F785D98E-DD1D-46FD-8BC1-1AAB69604980"); | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
return id; | ||
} | ||
} | ||
|
||
readonly string name = "CzechHybridMap"; | ||
public override string Name | ||
{ | ||
get | ||
{ | ||
return name; | ||
} | ||
} | ||
|
||
GMapProvider[] overlays; | ||
public override GMapProvider[] Overlays | ||
{ | ||
get | ||
{ | ||
if(overlays == null) | ||
{ | ||
overlays = new GMapProvider[] { CzechSatelliteMapProviderOld.Instance, this }; | ||
} | ||
return overlays; | ||
} | ||
} | ||
|
||
public override PureImage GetTileImage(GPoint pos, int zoom) | ||
{ | ||
string url = MakeTileImageUrl(pos, zoom, LanguageStr); | ||
|
||
return GetTileImageUsingHttp(url); | ||
} | ||
|
||
#endregion | ||
|
||
string MakeTileImageUrl(GPoint pos, int zoom, string language) | ||
{ | ||
// http://m2.mapserver.mapy.cz/hybrid/9_7d00000_7b80000 | ||
|
||
long xx = pos.X << (28 - zoom); | ||
long yy = ((((long)Math.Pow(2.0, (double)zoom)) - 1) - pos.Y) << (28 - zoom); | ||
|
||
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, xx, yy); | ||
} | ||
|
||
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/hybrid/{1}_{2:x7}_{3:x7}"; | ||
} | ||
} |
118 changes: 118 additions & 0 deletions
118
GMap.NET.Core/GMap.NET.MapProviders/CzechOld/CzechMapProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
| ||
namespace GMap.NET.MapProviders | ||
{ | ||
using System; | ||
using GMap.NET.Projections; | ||
|
||
public abstract class CzechMapProviderBaseOld : GMapProvider | ||
{ | ||
public CzechMapProviderBaseOld() | ||
{ | ||
RefererUrl = "http://www.mapy.cz/"; | ||
Area = new RectLatLng(51.2024819920053, 11.8401353319027, 7.22833716731277, 2.78312271922872); | ||
} | ||
|
||
#region GMapProvider Members | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
public override string Name | ||
{ | ||
get | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
public override PureProjection Projection | ||
{ | ||
get | ||
{ | ||
return MapyCZProjection.Instance; | ||
} | ||
} | ||
|
||
GMapProvider[] overlays; | ||
public override GMapProvider[] Overlays | ||
{ | ||
get | ||
{ | ||
if(overlays == null) | ||
{ | ||
overlays = new GMapProvider[] { this }; | ||
} | ||
return overlays; | ||
} | ||
} | ||
|
||
public override PureImage GetTileImage(GPoint pos, int zoom) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
#endregion | ||
} | ||
|
||
/// <summary> | ||
/// CzechMap provider, http://www.mapy.cz/ | ||
/// </summary> | ||
public class CzechMapProviderOld : CzechMapProviderBaseOld | ||
{ | ||
public static readonly CzechMapProviderOld Instance; | ||
|
||
CzechMapProviderOld() | ||
{ | ||
} | ||
|
||
static CzechMapProviderOld() | ||
{ | ||
Instance = new CzechMapProviderOld(); | ||
} | ||
|
||
#region GMapProvider Members | ||
|
||
readonly Guid id = new Guid("6A1AF99A-84C6-4EF6-91A5-77B9D03257C2"); | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
return id; | ||
} | ||
} | ||
|
||
readonly string name = "CzechMap"; | ||
public override string Name | ||
{ | ||
get | ||
{ | ||
return name; | ||
} | ||
} | ||
|
||
public override PureImage GetTileImage(GPoint pos, int zoom) | ||
{ | ||
string url = MakeTileImageUrl(pos, zoom, LanguageStr); | ||
|
||
return GetTileImageUsingHttp(url); | ||
} | ||
|
||
#endregion | ||
|
||
string MakeTileImageUrl(GPoint pos, int zoom, string language) | ||
{ | ||
// ['base','ophoto','turist','army2'] | ||
// http://m1.mapserver.mapy.cz/base-n/3_8000000_8000000 | ||
|
||
long xx = pos.X << (28 - zoom); | ||
long yy = ((((long)Math.Pow(2.0, (double)zoom)) - 1) - pos.Y) << (28 - zoom); | ||
|
||
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, xx, yy); | ||
} | ||
|
||
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/base-n/{1}_{2:x7}_{3:x7}"; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
GMap.NET.Core/GMap.NET.MapProviders/CzechOld/CzechSatelliteMapProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
| ||
namespace GMap.NET.MapProviders | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// CzechSatelliteMap provider, http://www.mapy.cz/ | ||
/// </summary> | ||
public class CzechSatelliteMapProviderOld : CzechMapProviderBaseOld | ||
{ | ||
public static readonly CzechSatelliteMapProviderOld Instance; | ||
|
||
CzechSatelliteMapProviderOld() | ||
{ | ||
} | ||
|
||
static CzechSatelliteMapProviderOld() | ||
{ | ||
Instance = new CzechSatelliteMapProviderOld(); | ||
} | ||
|
||
#region GMapProvider Members | ||
|
||
readonly Guid id = new Guid("7846D655-5F9C-4042-8652-60B6BF629C3C"); | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
return id; | ||
} | ||
} | ||
|
||
readonly string name = "CzechSatelliteMap"; | ||
public override string Name | ||
{ | ||
get | ||
{ | ||
return name; | ||
} | ||
} | ||
|
||
public override PureImage GetTileImage(GPoint pos, int zoom) | ||
{ | ||
string url = MakeTileImageUrl(pos, zoom, LanguageStr); | ||
|
||
return GetTileImageUsingHttp(url); | ||
} | ||
|
||
#endregion | ||
|
||
string MakeTileImageUrl(GPoint pos, int zoom, string language) | ||
{ | ||
//http://m3.mapserver.mapy.cz/ophoto/9_7a80000_7a80000 | ||
|
||
long xx = pos.X << (28 - zoom); | ||
long yy = ((((long)Math.Pow(2.0, (double)zoom)) - 1) - pos.Y) << (28 - zoom); | ||
|
||
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, xx, yy); | ||
} | ||
|
||
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/ophoto/{1}_{2:x7}_{3:x7}"; | ||
} | ||
} |
Oops, something went wrong.