Skip to main content

Base Layer

Contents

The BaseMap layer provides you with a map that allows you to choose both a map style and what features you would like to display on the map.

var baseMapLayer = new ALKMaps.Layer.BaseMap(
  "ALK Maps",
  {region: "EU"},
  {displayInLayerSwitcher: false}
);

You can customize the visual display of the BaseMap layer by changing the style to alter the color palette of the layer.

Starting from version 1.1, a BaseMap layer will be added automatically when an instance of ALKMaps.Map is created. This default BaseMap layer will have ALKMaps.STYLE.TRANSPORTATION style, all feature drawers, and North America region, without showing in the layer switcher control. There are a couple of ways that user can overwrite this default layer. For example, user can create an instance of ALKMaps.Layer.BaseMap and add this instance to the map by calling ALKMaps.Map addLayer(s) methods. In the layer adding process, the default BaseMap layer will be removed if a new BaseMap is provided. The default BaseMap layer has the name of the map id plus “_ALKMaps.Layer.BaseMap”. Name like this in a custom BaseMap layer should be discouraged since layer name and class name are used to identify the default BaseMap layer.

Starting from version 1.2, the default projection for any BaseMap layer instance is Spherical Mercator.

Map Styles

Map styles are there to provide the visual styling for the map. See the chart below for examples of each style.

Enumeration Example
ALKMaps.STYLE.TRANSPORTATION Transportation Map Style
ALKMaps.STYLE.DATALIGHT Data Light Map Style
ALKMaps.STYLE.DATADARK Data Dark Map Style
ALKMaps.STYLE.BASIC Basic Map Style
ALKMaps.STYLE.SATELLITE Satellite Map Style
ALKMaps.STYLE.TERRAIN Terrain Map Style
ALKMaps.STYLE.DEFAULT
Deprecated This style redirects to ALKMaps.STYLE.TRANSPORTATION.
ALKMaps.STYLE.CLASSIC
Deprecated This style redirects to ALKMaps.STYLE.TRANSPORTATION.
ALKMaps.STYLE.MONOCHROME
Deprecated This style redirects to ALKMaps.STYLE.DATALIGHT.
ALKMaps.STYLE.ROADATLAS
Deprecated This style redirects to ALKMaps.STYLE.TRANSPORTATION.
ALKMaps.STYLE.CONTEMPORARY
Deprecated This style redirects to ALKMaps.STYLE.DATADARK.
ALKMaps.STYLE.SMOOTH
Deprecated This style redirects to ALKMaps.STYLE.DATALIGHT.
ALKMaps.STYLE.LIGHTNESS
Deprecated This style redirects to ALKMaps.STYLE.DATALIGHT.
ALKMaps.STYLE.NIGHT
Deprecated This style redirects to ALKMaps.STYLE.DATADARK.

For most styles, when a base map is requested, there is only one layer. Satellite style map is slightly different. The JavaScript API adds a transparent layer on top of the satellite image but only the satellite image layer will be shown on the layer switcher if the control is added to the map. When user lists all layers that are added to the map, user sees the transparent layer in the list as well. The transparent layer has the name of the satellite layer id plus “_overlay”. If user wants to change map style, calling the base layer changeStyle method by passing a map style is desired.

Please note that the Satellite style will only work in the Spherical Mercator projection, otherwise an error will be returned.

Map Regions

Parameter Type/Values Description
region [NA / EU/ OC / SA / AS / AF / ME]
NA: North America
EU: Europe
OC: Australia
SA: South America
AF: Africa
ME: Middle East
AS: Asia
This parameter is optional. If region is not set, it will default to the appropriate region based on your map data licensing.

If you are a global highway customer who would like to view map data in other regions, you can set the dataset parameter to "Current" to use global highway data.

Last updated November 23, 2021.
Contents