geodev-hackerlabs

###Add a feature layer to a map

In this lab you will add a feature layer to an ArcGIS API for JavaScript application.

  1. Click create_starter_map/index.html and copy the contents to a new jsbin.com.

  2. In JSBin > HTML, update the require statement and function definition:

  require([
    "esri/Map",
    "esri/views/MapView",
    /*** ADD ***/
    "esri/layers/FeatureLayer",
    "dojo/domReady!"
  ], function(Map, MapView, FeatureLayer) {
  1. Now add the Styled Rail Lines to the map:
    ...

    /*** ADD ***/

    var featureLayer = new FeatureLayer({
      url: "https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/PDX_Rail_Lines_Styled/FeatureServer/0"
    });

    map.add(featureLayer);
  1. Confirm that the JSBin Output panel shows a map with rail lines.

Your app should look something like this:

###Bonus