Hey Folks,
having trouble adding a WMS from BC open data, into my application that is not using a proxy.
An example layer is here on the BC government website.
Correctional Facilities - WMS getCapabilities request - Data Catalogue
this example works fine with the following code. however since their sandbox uses a proxy, it works fine and no 'ResourceInfo' object is needed.
<script>
var map;
require(["esri/map", "esri/layers/WMSLayer", "esri/config", "dojo/domReady!"],
function(Map, WMSLayer, esriConfig) {
esriConfig.defaults.io.proxyUrl = "/proxy/";
esriConfig.defaults.io.corsEnabledServers.push("openmaps.gov.bc.ca");
map = new Map("map", {
basemap: "streets",
center: [-98, 37],
zoom: 5
});
var wmsLayer = new WMSLayer("https://openmaps.gov.bc.ca/geo/pub/WHSE_IMAGERY_AND_BASE_MAPS.GSR_CORRECTNL_FACILITIES_SV/ows", {
format: "png",
visibleLayers: [0]
});
map.addLayer(wmsLayer);
});
</script>
however in my application this simply won't work, as I don't have a proxy. I am a bit clueless what I should add for resource info and have tried many other combinations.
Anyone have any luck with this?