I am trying to add FEMA map service
FEMA: Mapping Information Platform: NOPAGETAB_NFHLWMS
Index number 28 from above link.
I am doing this:
I know there is an scale of 50,000 but no matter my zoom it does not render in my map. I dont see any errors associated with this in the console
Thoughts?
var FloodZonelayer = new FeatureLayer("https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/28", {
mode: FeatureLayer.MODE_SNAPSHOT,
visible: true
});
legendLayers.push({ layer: FloodZonelayer, title: 'Flood Zones' });
map.addLayers([FloodZonelayer]);
Solved! Go to Solution.
Jay,
No I am not. Which leads me to say it is a service issue still.
hmmmm...wondering why their's is so responsive and I am grabbing the same Service and mine is slow and not rendering everything....chalk it up to who knows I guess?
Jay,
They are rendering as an ArcGISDynamicMapServiceLayer and you are using a FeatureLayer which is receiving all the geometry and rendering on the client where the ArcGISDynamicMapServiceLayer is rendered on the server and just an image is returned to the client.
I do this and get this error about the GET request
var imageParameters = new ImageParameters();
ImageParameters.format = "jpeg"; //set the image type to PNG24, note default is PNG8.
var FloodZonelayer = new ArcGISDynamicMapServiceLayer("https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/28", {
"opacity" : 0.5,
"imageParameters" : imageParameters
});
legendLayers.push({ layer: FloodZonelayer, title: 'Flood Zones' });
Jay,
Well you had a couple of issues in your code:
<!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.23/esri/css/esri.css">
<script src="https://js.arcgis.com/3.23/"></script>
<style>
html, body, #map {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ImageParameters",
"dojo/domReady!"
],
function(
Map,
ArcGISDynamicMapServiceLayer,
ImageParameters
) {
var map = new Map("map", {
basemap: "gray",
center: [-82.44109, 35.6122],
zoom: 17
});
var imageParameters = new ImageParameters();
imageParameters.format = "PNG32"; //set the image type to PNG24, note default is PNG8.
imageParameters.layerIds = [28];
imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;
var FloodZonelayer = new ArcGISDynamicMapServiceLayer("https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer", {
"opacity" : 0.5,
"imageParameters" : imageParameters
});
map.addLayer(FloodZonelayer)
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
First off hate how this site kicks you out every couple minutes....anoying...
Great....I was missing some parameters....this works great....got all the speed i was missing and all the layers.
I was referencing these example and did see the other parameters
ArcGIS API for JavaScript Sandbox
var imageParameters = new ImageParameters();
imageParameters.format = "PNG32"; //set the image type to PNG24, note default is PNG8.
imageParameters.layerIds = [28];
imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW;