I can't figure out why this FeatureLayer doesn't show up on top of my base map. I'm using ArcGIS Server 10.0 and the ArcGIS JS API 2.6.
Here's the information from the service's REST parameters page:
Feature Layer: Inspection Locations (ID: 5)
Display Field: NAME
Type: Feature Layer
Geometry Type: esriGeometryPoint
Min. Scale: 250000
Max. Scale: 0
Extent:
XMin: -8879044.1973
YMin: 4938432.3627
XMax: -7999181.0204
YMax: 5622923.0498
Spatial Reference: 102100 (3857)
.
.
.
Supported Interfaces: REST
Supported Operations: Query Add Features Update Features Delete Features Apply
Edits
...and here's the code:
<script type="text/javascript"> var djConfig = { parseOnLoad: true }; </script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6"></script>
<script type="text/javascript">djConfig = { parseOnLoad:true };</script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.layers.FeatureLayer");
var map;
function init() {
var initExtent = new esri.geometry.Extent({
"xmin": -8879044.1973,
"ymin": 4938432.3627,
"xmax": -7999181.0204,
"ymax": 5622923.0498,
"spatialReference": {
"wkid": 102100
}
});
map = new esri.Map("map", {extent: initExtent });
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
var featureLayer = new esri.layers.FeatureLayer("http://gis4/ArcGIS/rest/services/NY/NYeFind/FeatureServer/5",{
mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
outFields: ["*"]
});
map.addLayers([basemap, featureLayer]);
var resizeTimer;
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
map.resize();
map.reposition();
}, 500);
});
});
} // end init
dojo.addOnLoad(init);
Oddly enough, if I hit the "View in ArcGIS.com Map" link, it works perfectly.