|     Blog    |     Wiki    |     Support

Connect to WMS maps for web app

Is it possible to connect to WMS compliant maps as part of using UI controls.
I would like to use UI controls and wms maps from different location e.g.

  1. Which solution from ThinkGeo is for this?
  2. Where can I configure it?

Thanks for answers

Hi Poul,

it’s possible to access the provided WMS service with ThinkGeo Blazor UI control, with few changes of “Blazor Sample OGC Service Sample”. Here are the demo codes of MapView:

<MapView Id="map" @ref="map"
         Center="@(new PointShape(19.41710,51.57224))"
        <WmsTileOverlay Id="WmsOverlay" Parameters="@parameters"
                        TileHeight="512" TileWidth="512"></WmsTileOverlay>
            <ZoomBarMapTool />

@code {
    MapView map;
    Collection<Uri> serverUris = new Collection<Uri> { new Uri("") };
    Dictionary<string, string> parameters = new Dictionary<string, string>
        { "layers", "Raster"},
        { "STYLE", "default"},
        { "CRS","EPSG:4326"}

Now it should work, but after the map is loaded, it shows the blank map with following error:

Access to image at '' from origin 'http://localhost:64632' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Even enabled “crossOrigin:‘anonymous’” to allow “Crossing Domain Access”, still got the same error, could you please help check if the service supports “Access-Control-Allow-Origin”? If yes, we can check if any issues on my side. Sorry for the inconvenience.

If we paste the request URL of one tile, such as, a satellite image should show up in the browser, it’s proved the codes above is correct, the only problem is “Access-Control-Allow-Origin”. Here is the URL of this WMS service capabilities


Thanks for the answer, I was looking for a solution all Saturday but it doesn’t work.

a) I have implemented CORS in ThinkGeo.UI.Blazor.HowDol but doesn’t work.

  1. Startup class
    readonly string MyAllowSpecificOrigins = “_myAllowSpecificOrigins”;
    public void ConfigureServices(IServiceCollection services)
    services.AddCors(options =>
    builder =>
    .SetIsOriginAllowed(isOriginAllowed: _ => true) or .AllowAnyOrigin()

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)


b) maybe soluction is reverse proxy site?


i found also discussion in this area on

Hi Poul,

It looks your server is changing, I tried to view this link:

It return a tile image, but when I try to visit it again after half an hour, it shows exception: Parameter ‘layers’ contains unacceptable layer names.

And I found the LAYERS=Raster is also not accepted by server but the layers=Raster works at the first, by default our parameter is used like LAYERS, could you please double check that?

I will do more test when the server is stable.