var featureLayer = new FeatureLayer('http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/ufn/MapServer/5', { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); map.addLayer(featureLayer); //Error: Target must be an event emitter on(featureLayer, "onMouseOver", function(evt) { console.log('inside onMouseOver'); });
var featureLayer = new esri.layers.FeatureLayer('http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/ufn/MapServer/5', { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); map.addLayer(featureLayer); dojo.connect(featureLayer, "onMouseOver", function(evt) { console.log('inside onMouseOver'); });
var featureLayer = new FeatureLayer('http://maps..... vs var featureLayer = new esri.layers.FeatureLayer('http://maps......
require( [ "esri/map", "esri/layers/FeatureLayer", "dojo/on", "dojo/ready", "dojo/domReady!" ], function(Map, FeatureLayer, on, ready) { ready(function() { var map = new Map("map",{ basemap:"oceans", center:[-102,40], //long, lat zoom:5 }); var featureLayer = new FeatureLayer('http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/ufn/MapServer/5', { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); map.addLayer(featureLayer); //Error: Target must be an event emitter on(featureLayer, "onMouseOver", function(evt) { console.log('inside onMouseOver'); }); }); } );
require([ "esri/layers/FeatureLayer", ... ], function(FeatureLayer, ... ) { var censusBlock = new FeatureLayer(layerUrl, { showAttribution :false }); ... });
featureLayer.on("mouseOver", function(evt) { ... });
require( [ "esri/map", "esri/layers/FeatureLayer", "dojo/on", "dojo/ready", "dojo/_base/connect", "dojo/domReady!" ], function(Map, FeatureLayer, on, ready, Connect) { ready(function() { var map = new Map("map",{ basemap:"oceans", center:[-102,40], //long, lat zoom:5 }); var featureLayer = new FeatureLayer('http://maps.ngdc.noaa.gov/arcgis/rest/services/web_mercator/ufn/MapServer/5', { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); map.addLayer(featureLayer); Connect.connect(featureLayer, "onMouseOver", function(evt) { console.log('inside onMouseOver'); }); }); } );