Practice time
In this exercise, you will use FeatureLayer
to set a definition expression on a layer, draw the features that match the definition expression as graphics, and respond to a hover event over the features.
Follow the given steps to complete the exercise:
- Open the JavaScript sandbox at https://developers.arcgis.com/javascript/3/sandbox/sandbox.html.
- Remove the JavaScript content from the
<script>
tag that I have highlighted, leaving an empty<script></script>
block in which to write the required code:
<script>
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("map", {
basemap: "topo", //For full list of pre-defined basemaps,
navigate to http://arcg.is/1JVo6Wd
center: [-122.45, 37.75], // longitude, latitude
zoom: 13
});
});
</script>
- Create the variable that you will use to refer to the map in the
<script>
tag:
<script>
var map;
</script>
- Create the
require...