In this lab, you will add featurelayers to an Esri Leaflet application.
Open the starter map HTML and copy the contents to a new jsbin.com.
In JSBin
> HTML
, add the following plugin to draw the layer styles:
<!-- Load Esri Leaflet Renderers -->
<script src="https://unpkg.com/esri-leaflet-renderers@2.0.2"></script>
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>
Run and test the app.
Your app should look something like this:
Map Panes
to get control over display order