Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: BasemapLayer

require(["esri/dijit/BasemapLayer"], function(BasemapLayer) { /* code goes here */ });

Description

(Added at v2.1)
Defines a layer that will be added to a basemap and displayed in the BasemapGallery dijit.

Samples

Search for samples that use this class.

Constructors

NameSummary
new BasemapLayer(params)Creates a new BasemapLayer object.

CSS

esri/dijit/BasemapLayer | Download source

Properties

NameTypeSummary
copyrightStringThe attribution information for the layer.
fullExtentExtentThe full extent of the layer.
initialExtentExtentThe initial extent of the layer.
styleUrlStringA url to a JSON file containing the stylesheet information to render the VectorTileLayer.
subDomainsString[]The subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain).
tileInfoTileInfoThe tile info for the layer including lods, rows, cols, origin and spatial reference.
tileServersString[]Additional tile server domains for the layer.
typeStringThe type of layer.
Constructor Details

new BasemapLayer(params)

Creates a new BasemapLayer object.
Parameters:
<Object> params Required Set of parameters used to create a basemap layer. See the list below for details.
params properties:
<Number[]> bandIds Optional If the url points to an image service, you can specify which band ids will display. If not set, the first three available band ids will display.
<String> copyright Optional The attribution information for the layer. NOTE: This property is only applicable to layers of type WebTiledLayer.
<Number[]> displayLevels Optional If the url points to a cached map service you can specify the levels to draw. If not set, all display levels the service supports are drawn.
<Extent> fullExtent Optional Specify the full extent of the layer. If no value is specified the default value, world extent in Web Mercator, is used. NOTE: This property is only applicable to layers of type WebTiledLayer.
<Extent> initialExtent Optional Specify the initial extent of the layer. If no value is specified the default value, world extent in Web Mercator, is used. NOTE: This property is only applicable to layers of type WebTiledLayer.
<Boolean> isReference Optional Set to true if the layer is a reference layer and should be drawn on top of all other layers in the map.
<Number> opacity Optional Initial opacity or transparency of the basemap layer. Values range from 0.0 to 1.0 where 0.0 is 100% transparent and 1.0 has no transparency. The default value is 1.0.
<String> styleUrl Optional A url to a JSON file containing the stylesheet information to render the VectorTileLayer.
<String[]> subDomains Optional Specify subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). If subDomains are specified, the urlTemplate should include a ${subDomain} place holder. NOTE: This property is only applicable to layers of type WebTiledLayer.
<String> templateUrl Optional The URL template used to retrieve the tiles. The templateUrl follows a pattern of http://some.domain.com/${Z}/${X}/${Y}/ where Z corresponds to a zoom level, and X and Y represent tile column and row, respectively. Required if the BasemapLayer is a WebTiledLayer.
<TileInfo> tileInfo Optional Define the tile info for the layer including lods, rows, cols, origin and spatial reference. NOTE: This property is only applicable to layers of type WebTiledLayer.
<String[]> tileServers Optional Define additional tile server domains for the layer. NOTE: This property is only applicable to layers of type WebTiledLayer.
<String> type Optional The type of layer. Valid values are "BingMapsAerial", "BingMapsHybrid", "BingMapsRoad", "OpenStreetMap", "VectorTileLayer" or "WebTiledLayer". For Bing and OpenStreetMap basemaps specify type property. For WebTiledLayer basemap both url and type are required. For VectorTileLayer both styleUrl and type are required.
<String> url Optional URL to the ArcGIS Server REST resource that represents a map or image service. Must specify either the url or type parameter.
<Number[]> visibleLayers Optional If the url points to a dynamic map service you can specify a subset of layers to display. If not set, all visible layers are displayed.
Sample:
require([
  "esri/dijit/BasemapLayer", ... 
], function(BasemapLayer, ... ) {
  var publicSafetyLayer = new BasemapLayer({
    url: "https://www.example.com/argis/rest/services/PublicSafety/PublicSafetyBasemap/MapServer"
  });
 
  // add vector tile layer as a basemap layer
  var vtlayer = new BasemapLayer({
    styleUrl: "https://www.arcgis.com/sharing/rest/content/items/5ad3948260a147a993ef4865e3fad476/resources/styles/root.json",
    type: "VectorTileLayer"
  });
});
Property Details

<String> copyright

The attribution information for the layer. NOTE: This property is only applicable to layers of type WebTiledLayer. (Added at v3.7)

<Extent> fullExtent

The full extent of the layer. If no value is specified the default value, world extent in Web Mercator, is used. NOTE: This property is only applicable to layers of type WebTiledLayer. (Added at v3.7)

<Extent> initialExtent

The initial extent of the layer. If no value is specified the default value, world extent in Web Mercator, is used. NOTE: This property is only applicable to layers of type WebTiledLayer. (Added at v3.7)

<String> styleUrl

A url to a JSON file containing the stylesheet information to render the VectorTileLayer. (Added at v3.15)
Sample:
var vtlayer = new BasemapLayer({
  styleUrl: "https://www.arcgis.com/sharing/rest/content/items/5ad3948260a147a993ef4865e3fad476/resources/styles/root.json",
  type: "VectorTileLayer"
});

<String[]> subDomains

The subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). NOTE: This property is only applicable to layers of type WebTiledLayer. (Added at v3.7)

<TileInfo> tileInfo

The tile info for the layer including lods, rows, cols, origin and spatial reference. NOTE: This property is only applicable to layers of type WebTiledLayer. (Added at v3.7)

<String[]> tileServers

Additional tile server domains for the layer. NOTE: This property is only applicable to layers of type WebTiledLayer. (Added at v3.7)

<String> type

The type of layer. For Bing and OpenStreetMap basemaps specify type property. For WebTiledLayer basemap both url and type are required. For VectorTileLayer both styleUrl and type are required. (Added at v3.7)
Known values: "BingMapsAerial" | "BingMapsHybrid" | "BingMapsRoad" | "OpenStreetMap" | "WebTiledLayer" | "VectorTileLayer"
Show Modal