Closed nguyenngocanh94 closed 4 years ago
Take a look at the MapProjections library that comes with the source code. It has a GeoApiProjection class where you can pass the WKT of any projections supported by ProjNET4GeoAPI. There is also a derived UtmProjection class where you can directly pass the UTM zone string, but it only supports WGS84.
Good morning. I want to have some follow-up question. When I tried the above solution. Using map tile server like this link does not work: https://www.wmts.nrw.de/webatlas/tiles/webatlas/EPSG_25832_15/{z}/{x}/{y}.png
The map shows up when I use WebMercatorProjection but it does not show the right conversion from long, lat to x, y
XAML MapControl does not support WMTS. To show a map in EPSG:25832 projection, you have to use a WmsImageLayer and set its ServiceUrl property to a WMS that supports the projection.
Thanks! Let me clarify: So it only supports tile-servers like Open Street Map and Google Map?
I have now added (a minimal) support for WMTS.
Assuming there is a Map element named map
and a text file containing the WKT of the EPSG:25832 projection, you may use it like shown below. Note that you have to pass the WMTS Capabilities document instead of the tile URL template.
map.MapProjection = new GeoApiProjection
{
WKT = File.ReadAllText("epsg25832.wkt")
};
map.MapLayer = new WmtsTileLayer
{
CapabilitiesUri = new Uri("https://www.wmts.nrw.de/webatlas/1.0.0/WMTSCapabilities.xml"),
LayerIdentifier = "webatlas",
SourceName = "NRW webatlas" // for caching
};
i found your project missing this standard and only EPSG:4326 is hard code on MapProjection. in future how about add the ETRS89 / UTM zone 32N option?