Comments (5)
Some suggestions:
- Try to get it to work in QGIS so you can see if it actually works and with which settings.
- Use a tool like Fiddler so see what kind of requests are done and what the result is.
- Attach the Mapsui logger: https://mapsui.com/documentation/logging.html
from mapsui.
Had a look with QGis at the Stadtplan Layer, what I discovered is that it works but that it is very slow and had a lot of TimeOuts in Qgis, Maybe you have to increase the Timeout and have pacience and eventually use caching for the fetched tiles.
from mapsui.
public async Task<Map> CreateMapAsync()
{
var map = new Map
{
CRS = "EPSG:2056"
};
map.Layers.Add(await CreateLayerAsync());
map.Navigator.CenterOnAndZoomTo(new MPoint(2672155, 1251624), 500);
return map;
}
public static async Task<ILayer> CreateLayerAsync()
{
var url = " https://www.ogd.stadt-zuerich.ch/mapproxy/wmts/1.0.0/WMTSCapabilities.xml";
using var response = await (DefaultCache as IUrlPersistentCache).UrlCachedStreamAsync(url);
var tileSources = WmtsParser.Parse(response);
var stadtplanSource = tileSources.FirstOrDefault(t => t.Name == "Stadtplan") ?? tileSources.First();
if (DefaultCache != null)
{
stadtplanSource.PersistentCache = DefaultCache;
}
return new TileLayer(stadtplanSource) { Name = stadtplanSource.Name };
}
This works made a pull request with this as a sample
#2691
from mapsui.
public async Task<Map> CreateMapAsync() { var map = new Map { CRS = "EPSG:2056" }; map.Layers.Add(await CreateLayerAsync()); map.Navigator.CenterOnAndZoomTo(new MPoint(2672155, 1251624), 500); return map; } public static async Task<ILayer> CreateLayerAsync() { var url = " https://www.ogd.stadt-zuerich.ch/mapproxy/wmts/1.0.0/WMTSCapabilities.xml"; using var response = await (DefaultCache as IUrlPersistentCache).UrlCachedStreamAsync(url); var tileSources = WmtsParser.Parse(response); var stadtplanSource = tileSources.FirstOrDefault(t => t.Name == "Stadtplan") ?? tileSources.First(); if (DefaultCache != null) { stadtplanSource.PersistentCache = DefaultCache; } return new TileLayer(stadtplanSource) { Name = stadtplanSource.Name }; }
This works made a pull request with this as a sample #2691
Thank you very much for the code sample and the explanation.
My problem is that the Stadtplan layer works, while the Basiskarte_Zuerich_Raster_Grau layer doesn't.
I tried the Basiskarte_Zuerich_Raster_Grau with your code and it didn't work.
from mapsui.
Some suggestions:
- Try to get it to work in QGIS so you can see if it actually works and with which settings.
- Use a tool like Fiddler so see what kind of requests are done and what the result is.
- Attach the Mapsui logger: https://mapsui.com/documentation/logging.html
That's a good hint. I'll have a look at what it throws back at me. Thanks.
from mapsui.
Related Issues (20)
- Map.Info eventargs return null for args.MapInfo.Feature when clicking on feature. HOT 3
- Removing items in ObservableCollection doesn't affect _shadowCollection HOT 1
- Dont cache BaseOnSourceLayers which use WritableLayers as their SourceLayer HOT 5
- Map Binding in WPF HOT 1
- Shapefiles and mbtiles in .NET MAUI (Android) HOT 3
- Mapsui Maui not working in ios 17.5 HOT 7
- Upgrade 3-> 4 / Help / Question / Viewport HOT 6
- MAUI: Double click on map HOT 3
- Memory Leak HOT 10
- [Question/Feature Request] Is there a way to distinguish ViewportChanged events between "manual" and "programmatical" ? HOT 3
- Pinch zoom causes map to pan even with PanLock on HOT 4
- PanLock prevents programmatic moving of the map HOT 2
- WPF: Zoom is laggy after MapControl is re-created HOT 4
- RasterizingLayer performance and display HOT 18
- Let Map be Disposable but not the MapControl
- WPF: Shape layer performance issue HOT 2
- Blazor map control crashes when AOT compiled HOT 8
- System.Text.Json has a vulnerability in version 8.0.3 HOT 3
- Country reappears after it gets back into the viewport
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapsui.