0

Where do I type in the username and password.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Map with WMS</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.20/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">
<style>
    html,
    body,
    #map {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    }

    body {
    background-color: #FFF;
    overflow: hidden;
    font-family: "Trebuchet MS";
    }
</style>
<script src="https://js.arcgis.com/3.20/"></script>

<script>
    var map;
    require(["esri/map", "esri/layers/WMSLayer", "esri/config",
        "dojo/domReady!"
    ],
    function(Map, WMSLayer, esriConfig) {
        esriConfig.defaults.io.proxyUrl = "/proxy/";

        map = new Map("map", {
        basemap: "streets",
        center: [-98, 37],
        zoom: 5
        });
        var wmsLayer = new WMSLayer(
        "http://103.203.139.72/erdas-apollo/coverage/District_Jai?REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.3.0", {
            format: "png",
            visibleLayers: [2]
        });

        map.addLayer(wmsLayer);
    });
</script>
</head>

<body>
<div id="map">
</div>
</body>
</html>
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
user9961
  • 89
  • 1
  • 4
  • Not sure you should be calling the GetCapabilities, in your wmsLayer, just stop at the question mark. – nmtoken May 22 '17 at 22:34
  • What sort of authentication is used for that service? The WMS specification itself doesn't specify this... see e.g. https://gis.stackexchange.com/a/5690/2478 – Bjorn Svensson May 23 '17 at 05:06
  • Hi thank you for your response, I did follow the steps and created a proxy page, but now I get the following error{"error": {"code": 403,"message":"Proxy has not been set up for this URL. Make sure there is a serverUrl in the configuration file that matches: http://106.207.134.26/erdas-apollo/coverage/District_Newark_FCC?amp;SERVICE=WMS&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetCapabilities http://106.207.134.26/erdas-apollo/coverage/District_Newark_FCC?amp;SERVICE=WMS&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetCapabilities"}} what am I missing?? – user9961 May 24 '17 at 08:10

0 Answers0