Select to view content in your preferred language

Mapserver not found

4478
13
12-11-2018 06:57 AM
EbunoluwaAkingbaso
New Contributor

After installing JavaScript API and SDK , i tried to test my  installation but it throws the error - MapServer not found. Actually arcgis/rest/services/Folder/Custom_Base_Map/MapServer was not found. I don't know if i have done something wrong. Please what could be the solution to this error. Thanks

0 Kudos
13 Replies
RobertScheitlin__GISP
MVP Emeritus

Please share the code you are attempting to use.

0 Kudos
EbunoluwaAkingbaso
New Contributor

<!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>Test Map</title>
<link rel="stylesheet" href="https://eif-gis-serv.eifer.kit.edu/arcgis_js_api/library/4.9/dijit/themes/claro/claro.css" />
<link rel="stylesheet" href="https://eif-gis-serv.eifer.kit.edu/arcgis_js_api/library/4.9/esri/css/main.css" />
<style>
html,
body,
#viewDiv {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
</style>
<script src="https://eif-gis-serv.eifer.kit.edu/arcgis_js_api/library/4.9/dojo/dojo.js"></script>
<script>
var myMap, view;
require([
"esri/Basemap",
"esri/layers/TileLayer",
"esri/Map",
"esri/views/MapView",
"dojo/domReady!"
], function (Basemap, TileLayer, Map, MapView){
// --------------------------------------------------------------------
// If you do not have public Internet access then use the Basemap class
// and point this URL to your own locally accessible cached service.
//
// Otherwise you can just use one of the named hosted ArcGIS services.
// https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
// --------------------------------------------------------------------
var layer = new TileLayer({
url: "https://eif-gis-serv.eifer.kit.edu/arcgis/rest/services/Folder/Custom_Base_Map/MapServer"
});
var customBasemap = new Basemap({
baseLayers: [layer],
title: "Custom Basemap",
id: "myBasemap"
});
myMap = new Map({
basemap: customBasemap
});
view = new MapView({
center: [-111.87, 40.57], // long, lat
container: "viewDiv",
map: myMap,
zoom: 6
});
});
</script>
</head>
<body class="claro">
<div id="viewDiv"></div>
</body>
</html>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ebunoluwa,

  So this code:

var layer = new TileLayer({
  url: "https://eif-gis-serv.eifer.kit.edu/arcgis/rest/services/Folder/Custom_Base_Map/MapServer"
});‍‍‍

assumes that you have an ArcGIS Server instance setup on the eif-gis-serv.eifer.kit.edu server. Is that the case?

EbunoluwaAkingbaso
New Contributor

Yep that is the case

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

So when you enter

https://eif-gis-serv.eifer.kit.edu/arcgis/rest/services/Folder/Custom_Base_Map/MapServer 

in your browsers address bar do you get the rest service end point page?

0 Kudos
EbunoluwaAkingbaso
New Contributor

No, I get this:

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

So that means you do not have your web adaptor setup completely/correctly.

Does it work if you bypass the web adaptor

https://eif-gis-serv.eifer.kit.edu:6443/arcgis/rest/services/Folder/Custom_Base_Map/MapServer 

0 Kudos
EbunoluwaAkingbaso
New Contributor

No it does not work if i bypass the web adaptor

https://eif-gis-serv.eifer.kit.edu:6443/arcgis/rest/services/Folder/Custom_Base_Map/MapServer 

It responded connection insecure.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Try changing :6443 to :6080 in the url above and try again.

0 Kudos