I went through and tested those services, here is what I found:
- British Columbia bedrock geology (WMS) - This seems to be accessible and everything by the image display is working. Looking into this the service is returning an XML file instead of a PNG. This XML has an error message regarding the default style. The issue seems to be that this service doesn't have a
default
style which is unusual as this is the first WMS service I've come across where this is the case (I've scanned over 172K WMS services). As such you need to specifically tell the layer which style to use. Here is an example:
Note that if you are zoomed out such that you see all of British Columbia, you may not see anything on the map. The service requires you to be zoomed in before it returns any images with data on them.var firstLayer = capabilities.sublayers[0]; layer.setOptions({ activeLayers: [firstLayer], styles: [firstLayer.styles.id]})
- Canada Geology Map - This failed initially for me due to a CORs issue (the service doesn't support CORs) and I needed to use a proxy service to connect to this service. This service looked to have the same issue with a missing
default
style, but even after using the previous fix, it still didn't work. I tried one of the image requests directly in the browser and it worked, but when I pass that request through a proxy service, I would get an error returned from the service. It looks like this service is blocking proxy services from accessing it. It might be possible to modify the headers of the request in the proxy to trick that service but you would need to do some experimenting. I noticed that this site also has a WMTS endpoint and that does work. Here is the endpoint:https://canada3d-geo-onegeology.azurewebsites.net/gwc/service/wmts?REQUEST=GetCapabilities
however it seems this server is pretty slow and sometimes returns 503 errors. Overall there is a bunch of issues with this service in general. - British Columbia 1:250k bedrock geology from OneGeology - I tried both the URLs you provided in the browser and they both return errors, thus why the map can't connect to them. Checking the server I found the following two valid WMS and WMTS endpoints: That said, it appears this server does not have HTTPS endpoints, only HTTP (odd in this day and age). So you likely won't be able to directly connect to this server from the map and will need a proxy service. That said, this service ended up having the same issues as #2. I made a bit more progress using the WMTS endpoint, but only enough to find out that this service is locked down and requires a username and password to access.