L.esri.Vector.vectorBasemapLayer
Extends L.Layer
L.esri.Vector.vectorBasemapLayer
uses the esri-leaflet-vector
plugin to display Esri hosted vector basemaps—using the Esri Basemap Layer Service API—and attribute data providers appropriately.
Constructor
Note: There are two ways to construct this layer with the required key
parameter, either with a basemap style enum or an item ID of a custom basemap style.
Constructor | Description |
---|---|
L.esri.Vector.vectorBasemapLayer(<String> |
key refers to either with a basemap style enum or an item ID of a custom basemap style that you'd like to add. Defaults to 'ArcGIS:Streets' .
|
Vector Basemaps
Basemap style enums are formatted with two or three parts and can be used for the
key
constructor parameter:{Provider}:{Style name}
{Provider}:{Style name}:{Component}
Please refer to the complete list of default basemap styles.
Some examples include:
ArcGIS:DarkGray
ArcGIS:Imagery:Standard
OSM:Standard
Otherwise, if displaying a custom basemap style, the item ID of that custom basemap style is used for the
key
constructor parameter.
Options
L.esri.Vector.vectorBasemapLayer
also accepts all L.Layer
options.
Option | Type | Description |
---|---|---|
apikey |
String |
If you pass an apikey in your options it will be included in all requests to the service. |
token |
String |
If you pass a token in your options it will be included in all requests to the service. |
Methods
L.esri.Vector.vectorBasemapLayer
inherits all methods from L.Layer
.
Example
Live sample here.
<script src="./esri-leaflet-vector.js"></script>
var map = L.map("map").setView([40.706, -73.926], 14);
L.esri.Vector.vectorBasemapLayer("ArcGIS:Streets", {
// provide either apikey or token
apikey: "YOUR-API-KEY"
}).addTo(map);