tomkow

Problem with WMS OGC layer

Discussion created by tomkow on Feb 2, 2014
Latest reply on Feb 3, 2014 by tomkow
Hi,
I need to display WMS OGC layer with ArcGIS API for javascript. I'm new to ArcGis API, but I have been working before witg GoogleMaps api.
I have used this demo:
https://developers.arcgis.com/javascript/jssamples/layers_wms.html
and just changed wms url to mine. Below is my HTML:

[HTML]<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <!--The viewport meta tag is used to improve the presentation and behavior of the samples
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Map with WMS</title>

    <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
    <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
    <style>
      html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
    </style>

    <script>var dojoConfig = {parseOnLoad: true};</script>
    <script src="http://js.arcgis.com/3.8/"></script>
   
    <script>
      dojo.require("dijit.layout.BorderContainer");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("esri.map");
      dojo.require("esri.layers.wms");
     
      var map;

      function init() {
        esri.config.defaults.io.proxyUrl = "/proxy";
        map = new esri.Map("map", {
          basemap: "topo",
          center: [16.982288360595703, 51.131215361909334],
          zoom: 12
        });
      
        var wmsLayer = new esri.layers.WMSLayer("http://gis.um.wroc.pl/services/OGC_MPODST/MapServer/WMSServer?request=getcapabilities&service=wms&version=1.1.1&SRS=EPSG:2177");
        //set visible layers - in this case, US Cities
        wmsLayer.setVisibleLayers([0]); 
        wmsLayer.setVisibleLayers([1]); 
        wmsLayer.setVisibleLayers([2]); 
        wmsLayer.setImageFormat("png");
        map.addLayer(wmsLayer);
      }

      dojo.ready(init);
    </script>
  </head>
 
  <body class="claro">
    <div id="content"
         data-dojo-type="dijit.layout.BorderContainer"
         data-dojo-props="design:'headline', gutters:true"
         style="width: 100%; height: 100%; margin: 0;">
     
      <div id="map"
           data-dojo-type="dijit.layout.ContentPane"
           data-dojo-props="region:'center'"
           style="overflow:hidden;">
      </div>

    </div>
  </body>
</html>
[/HTML]

But in result I can see only basemap.

What am I doing wrong?

Second question is, if I can show only my WMS layer without basemap?

Kind regards
Thomas

Outcomes