Skip to content

Commit

Permalink
GMap.NET.Core: merge new Czech map, thanks aconcagua21
Browse files Browse the repository at this point in the history
  • Loading branch information
radioman committed Jun 12, 2016
2 parents c839b7c + 21857fa commit 96bcb11
Show file tree
Hide file tree
Showing 14 changed files with 168 additions and 48 deletions.
7 changes: 7 additions & 0 deletions GMap.NET.Core/GMap.NET.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@
<Compile Include="GMap.NET.MapProviders\ArcGIS\ArcGIS_World_Street_MapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\ArcGIS\ArcGIS_World_Terrain_Base_MapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\ArcGIS\ArcGIS_World_Topo_MapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechGeographicMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechHistoryMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechHybridMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechSatelliteMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechTuristMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Czech\CzechTuristWinterMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Etc\CloudMadeMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Etc\SwedenMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Etc\WikiMapiaMapProvider.cs" />
Expand Down
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("50EC9FCC-E4D7-4F53-8700-2D1DB73A1D48");
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}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class CzechHistoryMapProvider : CzechMapProviderBase

CzechHistoryMapProvider()
{
MaxZoom = 15;
}

static CzechHistoryMapProvider()
Expand All @@ -21,7 +22,7 @@ static CzechHistoryMapProvider()

#region GMapProvider Members

readonly Guid id = new Guid("C666AAF4-9D27-418F-97CB-7F0D8CC44544");
readonly Guid id = new Guid("CD44C19D-5EED-4623-B367-FB39FDC55B8F");
public override Guid Id
{
get
Expand Down Expand Up @@ -63,14 +64,11 @@ public override PureImage GetTileImage(GPoint pos, int zoom)

string MakeTileImageUrl(GPoint pos, int zoom, string language)
{
// http://m4.mapserver.mapy.cz/army2/9_7d00000_8080000
// http://m3.mapserver.mapy.cz/army2-m/14-8802-5528

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);
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y);
}

static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/army2/{1}_{2:x7}_{3:x7}";
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/army2-m/{1}-{2}-{3}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static CzechHybridMapProvider()

#region GMapProvider Members

readonly Guid id = new Guid("F785D98E-DD1D-46FD-8BC1-1AAB69604980");
readonly Guid id = new Guid("7540CE5B-F634-41E9-B23E-A6E0A97526FD");
public override Guid Id
{
get
Expand Down Expand Up @@ -63,14 +63,11 @@ public override PureImage GetTileImage(GPoint pos, int zoom)

string MakeTileImageUrl(GPoint pos, int zoom, string language)
{
// http://m2.mapserver.mapy.cz/hybrid/9_7d00000_7b80000
// http://m3.mapserver.mapy.cz/hybrid-m/14-8802-5528

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);
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y);
}

static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/hybrid/{1}_{2:x7}_{3:x7}";
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/hybrid-m/{1}-{2}-{3}";
}
}
15 changes: 6 additions & 9 deletions GMap.NET.Core/GMap.NET.MapProviders/Czech/CzechMapProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override PureProjection Projection
{
get
{
return MapyCZProjection.Instance;
return MercatorProjection.Instance;
}
}

Expand Down Expand Up @@ -75,7 +75,7 @@ static CzechMapProvider()

#region GMapProvider Members

readonly Guid id = new Guid("6A1AF99A-84C6-4EF6-91A5-77B9D03257C2");
readonly Guid id = new Guid("13AB92EF-8C3B-4FAC-B2CD-2594C05F8BFC");
public override Guid Id
{
get
Expand Down Expand Up @@ -104,15 +104,12 @@ public override PureImage GetTileImage(GPoint pos, int zoom)

string MakeTileImageUrl(GPoint pos, int zoom, string language)
{
// ['base','ophoto','turist','army2']
// http://m1.mapserver.mapy.cz/base-n/3_8000000_8000000
// ['base-m','ophoto-m','turist-m','army2-m']
// http://m3.mapserver.mapy.cz/base-m/14-8802-5528

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);
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y);
}

static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/base-n/{1}_{2:x7}_{3:x7}";
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/base-m/{1}-{2}-{3}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static CzechSatelliteMapProvider()

#region GMapProvider Members

readonly Guid id = new Guid("7846D655-5F9C-4042-8652-60B6BF629C3C");
readonly Guid id = new Guid("30F433DB-BBF5-463D-9AB5-76383483B605");
public override Guid Id
{
get
Expand Down Expand Up @@ -50,14 +50,11 @@ public override PureImage GetTileImage(GPoint pos, int zoom)

string MakeTileImageUrl(GPoint pos, int zoom, string language)
{
//http://m3.mapserver.mapy.cz/ophoto/9_7a80000_7a80000
// http://m3.mapserver.mapy.cz/ophoto-m/14-8802-5528

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);
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y);
}

static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/ophoto/{1}_{2:x7}_{3:x7}";
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/ophoto-m/{1}-{2}-{3}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static CzechTuristMapProvider()

#region GMapProvider Members

readonly Guid id = new Guid("B923C81D-880C-42EB-88AB-AF8FE42B564D");
readonly Guid id = new Guid("102A54BE-3894-439B-9C1F-CA6FF2EA1FE9");
public override Guid Id
{
get
Expand Down Expand Up @@ -50,14 +50,11 @@ public override PureImage GetTileImage(GPoint pos, int zoom)

string MakeTileImageUrl(GPoint pos, int zoom, string language)
{
// http://m1.mapserver.mapy.cz/turist/3_8000000_8000000
// http://m3.mapserver.mapy.cz/wtourist-m/14-8802-5528

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);
return string.Format(UrlFormat, GetServerNum(pos, 3) + 1, zoom, pos.X, pos.Y);
}

static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/turist/{1}_{2:x7}_{3:x7}";
static readonly string UrlFormat = "http://m{0}.mapserver.mapy.cz/wturist-m/{1}-{2}-{3}";
}
}
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("F7B7FC9E-BDC2-4A9D-A1D3-A6BEC8FE0EB2");
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}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override Guid Id
}
}

readonly string name = "CzechHistoryMap";
readonly string name = "CzechHistoryOldMap";
public override string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override Guid Id
}
}

readonly string name = "CzechHybridMap";
readonly string name = "CzechHybridOldMap";
public override string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override Guid Id
}
}

readonly string name = "CzechMap";
readonly string name = "CzechOldMap";
public override string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override Guid Id
}
}

readonly string name = "CzechSatelliteMap";
readonly string name = "CzechSatelliteOldMap";
public override string Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override Guid Id
}
}

readonly string name = "CzechTuristMap";
readonly string name = "CzechTuristOldMap";
public override string Name
{
get
Expand Down
20 changes: 14 additions & 6 deletions GMap.NET.Core/GMap.NET.MapProviders/GMapProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,20 @@ static GMapProviders()

public static readonly SpainMapProvider SpainMap = SpainMapProvider.Instance;

public static readonly CzechMapProviderOld CzechMapOld = CzechMapProviderOld.Instance;
public static readonly CzechSatelliteMapProviderOld CzechSatelliteMapOld = CzechSatelliteMapProviderOld.Instance;
public static readonly CzechHybridMapProviderOld CzechHybridMapOld = CzechHybridMapProviderOld.Instance;
public static readonly CzechTuristMapProviderOld CzechTuristMapOld = CzechTuristMapProviderOld.Instance;
public static readonly CzechHistoryMapProviderOld CzechHistoryMapOld = CzechHistoryMapProviderOld.Instance;

public static readonly CzechMapProviderOld CzechOldMap = CzechMapProviderOld.Instance;
public static readonly CzechSatelliteMapProviderOld CzechSatelliteOldMap = CzechSatelliteMapProviderOld.Instance;
public static readonly CzechHybridMapProviderOld CzechHybridOldMap = CzechHybridMapProviderOld.Instance;
public static readonly CzechTuristMapProviderOld CzechTuristOldMap = CzechTuristMapProviderOld.Instance;
public static readonly CzechHistoryMapProviderOld CzechHistoryOldMap = CzechHistoryMapProviderOld.Instance;

public static readonly CzechMapProvider CzechMap = CzechMapProvider.Instance;
public static readonly CzechSatelliteMapProvider CzechSatelliteMap = CzechSatelliteMapProvider.Instance;
public static readonly CzechHybridMapProvider CzechHybridMap = CzechHybridMapProvider.Instance;
public static readonly CzechTuristMapProvider CzechTuristMap = CzechTuristMapProvider.Instance;
public static readonly CzechTuristWinterMapProvider CzechTuristWinterMap = CzechTuristWinterMapProvider.Instance;
public static readonly CzechHistoryMapProvider CzechHistoryMap = CzechHistoryMapProvider.Instance;
public static readonly CzechGeographicMapProvider CzechGeographicMap = CzechGeographicMapProvider.Instance;

public static readonly ArcGIS_Imagery_World_2D_MapProvider ArcGIS_Imagery_World_2D_Map = ArcGIS_Imagery_World_2D_MapProvider.Instance;
public static readonly ArcGIS_ShadedRelief_World_2D_MapProvider ArcGIS_ShadedRelief_World_2D_Map = ArcGIS_ShadedRelief_World_2D_MapProvider.Instance;
public static readonly ArcGIS_StreetMap_World_2D_MapProvider ArcGIS_StreetMap_World_2D_Map = ArcGIS_StreetMap_World_2D_MapProvider.Instance;
Expand Down

0 comments on commit 96bcb11

Please sign in to comment.