I released a map in August. At that time, I was using MapImageLayer to pull in my trails layer. All was working as expected. I noticed yesterday that the trails are no longer pulling in and displaying on my map. I've republished the service and have checked that it is working. My code hasn't changed, so I assume there has been a change elsewhere that is affecting the layer. I haven't been able to narrow down the issue yet. Any ideas?
Here's the code:
//Add SP trails feature layer
var spTrailsLayer = new MapImageLayer({
url: "https://conservationgis.alabama.gov/adcnrweb/rest/services/DCNRTrails/MapServer",
sublayers:
[{id:0,
popupTemplate: {
title: "{TrailName}",
content: "Trail Type: {TrailType}<br><br>Located On: {Tract}<br><br>Length (mi.): {Mileage}"},
definitionExpression: "SPorFW = 'SP'",
}],
title: "State Park Trails",
});
spTrailsLayer.minScale = 250000;
// watch handler: the callback fires each time the scale of the view changes
var handle = view.watch('scale', function(newScale) {
console.log("Scale: ", newScale);
if (newScale > 250000) {
spTrailsLayer.listMode = 'hide';
} else {
spTrailsLayer.listMode = 'show';
}
});
Solved! Go to Solution.
Ashley,
When I go to this url that is the basic viewer for a map service I see nothing...
ArcGIS API for JavaScript: DCNRTrails
This tells me there is an issue with the service or data.
Ashley,
When I go to this url that is the basic viewer for a map service I see nothing...
ArcGIS API for JavaScript: DCNRTrails
This tells me there is an issue with the service or data.
Robert,
I figured it out about the time you posted. Though everything looked normal in the .mxd and on the service itself, it was empty. The .mxd seems to have corrupted, though it gave me no errors. I rebuilt it and republished.
Ashley