AnsweredAssumed Answered

I want to consume a erdas apolla WMS service using ArcGIS Javascript API on my GIS application, but the WMS service is not rendering on my map, how should I authenticate the username and password?

Question asked by santoshf2 on May 22, 2017
Latest reply on May 24, 2017 by fcbassongis

I am using the following code

 

<!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>

 

Where do I type in the username and password.

Outcomes