Skip to content

Leaflet Basemaps

Andy Rothwell edited this page Aug 4, 2020 · 1 revision

Leaflet Basemaps

If you are using a leaflet basemap, you need a basemaps object includes objects for each map that you want to include.

Basemaps must be ArcGIS MapServers, hosted in ArcGIS Online (AGO) or a local instance of ArcGIS Server.

Name

The name of a layer object (other than for featuremaps) comes from the parameters, which are described below. The name HAS to be the type (ALL IN LOWERCASE) and then the label, with no space between them. For instance 'imagery2017', or 'historic1860'.

Parameters

  • url: the URL for the MapServer
  • type: there is a division between 2 ways basemaps are used, and there are as many "imagery types" ("types") as you want
    • 1:
      • featuremap - a typical drawn basemap
    • 2:
      • imagery - an image
      • historic - a historic map
      • anything else you want, BUT USE LOWERCASE ONLY IN THE NAME Whatever you add here, you have to add to Imagery Types.

featuremaps correspond to different topics, and come on as their corresponding topics are activated imagery, historic maps, and any other type you create, are incorporated automatically into the BasemapSelectControl

  • tiledLayers: list the other layers you want to turn on with this layer
  • label:
  • year:
  • attribution:

Example:

  basemaps: {
    pwd: {
      url: '//tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityBasemap/MapServer',
      tiledLayers: [
        'cityBasemapLabels'
      ],
      type: 'featuremap'
    },
    imagery2017: {
      url: '//tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2017_3in/MapServer',
      label: '2017',
      tiledLayers: [
        'imageryBasemapLabels',
        'parcels'
      ],
      type: 'imagery',
      year: 2017,
      attribution: 'Imagery 2017'
    } ...
Clone this wiki locally