AnsweredAssumed Answered

https service getting error while loading in map

Question asked by mallareddy2271 on Dec 18, 2018
Latest reply on Dec 19, 2018 by rscheitlin

below example works without error, but if i change the service to https from http then the error is appeared as some certification error(image below)

 

added proxy.ashx, proxy.config but still getting same certification error.

 

can we handle this in code or is it something related to server?

 

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>FeatureLayer</title>

    <link rel="stylesheet" href="https://js.arcgis.com/3.27/esri/css/esri.css">
    <script src="https://js.arcgis.com/3.27/"></script>

    <style>
        html, body, #map {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>

    <script>
require([
    "esri/map",
    "esri/layers/FeatureLayer",
    "dojo/domReady!"
  ],
  function(
    Map,
    FeatureLayer
  ) {

    var map = new Map("map", {
      basemap: "hybrid",
      center: [122.3321, 47.6062],
      zoom: 12
    });

    var featureLayer = new FeatureLayer("http://aaaaa.bbbbb.com/arcgis/rest/services/Maps/CityMap/MapServer/1");

    map.addLayer(featureLayer);

  });
    </script>
</head>

<body>
    <div id="map"></div>
</body>

</html>

Outcomes