I have a very basic script show below and get the error:
Any ideas as to what I'm doing wrong??
Error {code: 500, message: "Error performing query operation", details: Array[0], log: undefined, httpCode: 500…}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<!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">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<script src="http://js.arcgis.com/3.10/"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
</head>
<body>
<div id="mapDiv"></div>
<script type="text/javascript">
var map, featureLayer;
var featureURL = "http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/0";
require(["esri/map", "esri/layers/FeatureLayer", "dojo/domReady!"],function(Map,FeatureLayer) {
map = new Map("mapDiv", {
center: [-56.049, 38.485],
zoom: 3,
basemap: "streets"
});
var featureLayer = new FeatureLayer(featureURL);
map.addLayer(featureLayer);
</body>
</html>
Solved! Go to Solution.
Hi Joe,
You will want to keep your script in your <head> tags (see below). Here is a great tutorial on building your first application.
<!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">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding:0;
margin:0;
height:100%;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="http://js.arcgis.com/3.10/"></script>
<script type="text/javascript">
require([
"esri/map", "esri/layers/FeatureLayer", "dojo/domReady!"
],
function(
Map, FeatureLayer
) {
map = new Map("mapDiv", {
center: [-56.049, 38.485],
zoom: 3,
basemap: "streets"
});
var featureURL = "http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/0";
var featureLayer = new FeatureLayer(featureURL,{
mode: FeatureLayer.MODE_ONDEMAND
});
map.addLayer(featureLayer);
})
</script>
</head>
<body>
<div id="mapDiv"></div>
</body>
</html>
Hi Joe,
You will want to keep your script in your <head> tags (see below). Here is a great tutorial on building your first application.
<!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">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding:0;
margin:0;
height:100%;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="http://js.arcgis.com/3.10/"></script>
<script type="text/javascript">
require([
"esri/map", "esri/layers/FeatureLayer", "dojo/domReady!"
],
function(
Map, FeatureLayer
) {
map = new Map("mapDiv", {
center: [-56.049, 38.485],
zoom: 3,
basemap: "streets"
});
var featureURL = "http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/webmap_catalog/FeatureServer/0";
var featureLayer = new FeatureLayer(featureURL,{
mode: FeatureLayer.MODE_ONDEMAND
});
map.addLayer(featureLayer);
})
</script>
</head>
<body>
<div id="mapDiv"></div>
</body>
</html>
Jake,
I did as you suggested but still the error
Chris
Jake,
I think there is problem with the server hosting the esri software
Thanks
Joe