I'm pretty new to this, and I've been trying to follow the guides here. We have a simple service serving out a feature layer for parcels. When I load it up in in the ArcGIS.com map (the layer takes a minute to load), it displays fine. When I try to place it on a map in my own webpage, only a small number of the parcels display. Any help would be greatly appreciated. Below is my code:
<html> <head> <meta charset=utf-8 /> <title>Galveston GIS Testing</title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <link rel="stylesheet" href="https://js.arcgis.com/4.1/esri/css/main.css"> <script src="https://js.arcgis.com/4.1/"></script> <script> var parcelLayer; require([ "esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "dojo/dom", "dojo/on", "dojo/domReady!" ], function(Map, MapView, FeatureLayer, dom, on) { parcelLayer = new FeatureLayer({ url: "http://gis.cityofgalveston.org/arcgis/rest/services/KML_test/TEST_api/MapServer/0", id: "parcels", visible: true }); var map = new Map({ basemap: "streets", layers: [parcelLayer] }); var view = new MapView({ container: "viewDiv", // Reference to the DOM node that will contain the view map: map, center: [29.25, -94.84] // References the map object created in step 3 }); parcelLayer.then(function() { view.goTo(parcelLayer.fullExtent); }); }); </script> <style> html, body, #viewDiv { padding: 0; margin: 0; height: 100%; width: 100%; } </style> </head> <body> <div id="viewDiv"></div> </body> </html> Here's a screenshot of the map I get:
Solved! Go to Solution.
David,
Your map service has a max number of features that it returns this is likely the issue. the default for a map service is 1000 features. this can be adjusted in ArcGIS Server Manager when editing the map service properties.
David,
Your map service has a max number of features that it returns this is likely the issue. the default for a map service is 1000 features. this can be adjusted in ArcGIS Server Manager when editing the map service properties.
Thank you. We just noticed this bit on the page for FeatureLayer:
For layers created from services published to ArcGIS for Server prior to version 10.3, the number of features returned and displayed in the view is limited to the number in MaxRecordCount
as defined in the Services Directory of the Map Service or Feature Service.
Our GIS Specialist will look into this later today.
OK, we changed the MaxRecordCount to the number of parcels in our layer, and restricted it to a smaller area (just the island). However, we are still only seeing a small number of them:
David,
I would look at your ArcGIS Server logs then as I tried your map service using the JS API 3.18 and got the same issue:
<!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.18/esri/css/esri.css">
<script src="https://js.arcgis.com/3.18/"></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: "streets",
center: [-94.84, 29.25],
zoom: 12
});
var featureLayer = new FeatureLayer("http://gis.cityofgalveston.org/arcgis/rest/services/KML_test/TEST_api/MapServer/0");
map.addLayer(featureLayer);
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
Oddly, the JS API v2.0 doesn't seem to have any problem with it. It seems to load the layer into an ArcGISDynamicMapServiceLayer, but I'm not sure how to translate that into the v4 API
Is there a way for me to get the number of polygons that are drawn on the map? I've been using the console to walk through the map and view objects, but can't seem to find anything.
Edit: Nevermind. Found it. Seems we're still being limited to 1000 features, even though we turned the setting up and restarted the map service. Is this a hard-set limit? Should I be following this guide?
David,
I likely has something to do with your very old version of ArcGIS Server 10.01. I am not sure what to tell you tough besides give tech support a call.