baseMapLayer

A basemap layer is a layer that provides geographic context to the map. The web map contains an array of baseMapLayer objects. The isReference property determines whether the layer is drawn on top of all operational layers (true) or below them (false). Basemap layers cannot be drawn between operational layers.

All basemap layers used in a web map need to have the same spatial reference and tiling scheme. All operational layers in the map are drawn or requested in the spatial reference of the basemap layers.

Properties

Property

Details

id

A unique identifying string for the layer.

isReference

Boolean property determining whether the basemap layer appears on top of all operational layers (true) or beneath all operational layers (false). Typically, this value is set to true on reference layers such as road networks, labels, or boundaries. The default value is false.

opacity

The degree of transparency applied to the layer, where 0 is full transparency and 1 is no transparency.

type

A special string identifier used when the basemap is from Bing Maps or OpenStreetMap. When this property is included, the url property is not required. Acceptable values include: OpenStreetMap | BingMapsAerial | BingMapsRoad | BingMapsHybrid

url

The URL to the layer.

visibility

Boolean property determining whether the layer is initially visible in the web map.

Examples

Single basemap layer from ArcGIS Online

In this example, the web map has a single basemap layer: the National Geographic basemap from ArcGIS Online. This map is referenced through its URL.

"baseMap": {
    "baseMapLayers": [{
      "id": "NatGeo_World_Map_3458",
      "opacity": 1,
      "visibility": true,
      "url": "http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer"
    }],
    "title": "National Geographic"
  }

Imagery basemap layer and reference basemap layer

In this example, two basemaps are included: a general imagery layer and a boundaries and places layer whose isReference property is set to true. The boundaries and places network is drawn on top of all other layers, whereas the imagery is drawn on the bottom.

"baseMapLayers": [
      {
        "id": "World_Imagery_5014",
        "opacity": 1,
        "visibility": true,
        "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
      },
      {
        "id": "World_Boundaries_and_Places_9730",
        "isReference": true,
        "opacity": 1,
        "visibility": true,
        "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer"
      }
    ]

OpenStreetMap as a basemap layer

In this example, OpenStreetMap is used as a basemap layer. The type property is set to OpenStreetMap, eliminating the need for the url property.

"baseMap": {
    "baseMapLayers": [{
      "id": "OpenStreetMap",
      "opacity": 1,
      "visibility": true,
      "type": "OpenStreetMap"
    }],
    "title": "OpenStreetMap"
  }
9/13/2017