Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.42 KB

File metadata and controls

39 lines (27 loc) · 1.42 KB

Add feature layers with Esri Leaflet

In this lab, you will add featurelayers to an Esri Leaflet application.

  1. Open the starter map HTML and copy the contents to a new jsbin.com.

  2. In JSBin > HTML, add the following plugin to draw the layer styles:

    <!-- Load Esri Leaflet Renderers -->
    <script src="https://unpkg.com/[email protected]"></script>
  3. Add the following layers to the map:

    <script type='text/javascript'>
    	var map = L.map('map').setView([45.533, -122.657], 12);
    	L.esri.basemapLayer('DarkGray').addTo(map);
    
    	 // ADD the rail lines here
    	L.esri.featureLayer({
    		url: 'https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/PDX_Rail_Lines_Styled/FeatureServer/0'
    	}).addTo(map);
    
    </script>
  4. Run and test the app.

Your app should look something like this:

Bonus