-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated tile addressing for all Czech map providers (mapy.cz).
Added 2 map providers (CzechTuristWinterMapProvider, CzechGeographicMapProvider).
- Loading branch information
aconcagua21
committed
Jun 6, 2016
1 parent
8a6e6d1
commit 21857fa
Showing
9 changed files
with
143 additions
and
33 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
59 changes: 59 additions & 0 deletions
59
GMap.NET.Core/GMap.NET.MapProviders/Czech/CzechGeographicMapProvider.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,59 @@ | ||
namespace GMap.NET.MapProviders | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// CzechTuristMap provider, http://www.mapy.cz/ | ||
/// </summary> | ||
public class CzechGeographicMapProvider : CzechMapProviderBase | ||
{ | ||
public static readonly CzechGeographicMapProvider Instance; | ||
|
||
CzechGeographicMapProvider() | ||
{ | ||
} | ||
|
||
static CzechGeographicMapProvider() | ||
{ | ||
Instance = new CzechGeographicMapProvider(); | ||
} | ||
|
||
#region GMapProvider Members | ||
|
||
readonly Guid id = new Guid("{44E5E6D5-DC75-4909-A5CB-6BAFB0CAC54F}"); | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
return id; | ||
} | ||
} | ||
|
||
readonly string name = "CzechGeographicMap"; | ||
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.czzemepis-m/14-8802-5528 | ||
|
||
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y); | ||
} | ||
|
||
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/zemepis-m/{1}-{2}-{3}"; | ||
} | ||
} |
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
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
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
60 changes: 60 additions & 0 deletions
60
GMap.NET.Core/GMap.NET.MapProviders/Czech/CzechTuristWinterMapProvider.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,60 @@ | ||
| ||
namespace GMap.NET.MapProviders | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// CzechTuristMap provider, http://www.mapy.cz/ | ||
/// </summary> | ||
public class CzechTuristWinterMapProvider : CzechMapProviderBase | ||
{ | ||
public static readonly CzechTuristWinterMapProvider Instance; | ||
|
||
CzechTuristWinterMapProvider() | ||
{ | ||
} | ||
|
||
static CzechTuristWinterMapProvider() | ||
{ | ||
Instance = new CzechTuristWinterMapProvider(); | ||
} | ||
|
||
#region GMapProvider Members | ||
|
||
readonly Guid id = new Guid("1A2C354A-BF73-42AC-92E5-90DECE204F11"); | ||
public override Guid Id | ||
{ | ||
get | ||
{ | ||
return id; | ||
} | ||
} | ||
|
||
readonly string name = "CzechTuristWinterMap"; | ||
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/wturist_winter-m/14-8802-5528 | ||
|
||
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y); | ||
} | ||
|
||
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/wturist_winter-m/{1}-{2}-{3}"; | ||
} | ||
} |
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