Skip to main content

BaseMap Layer

The L.ALKMaps.Layer.BaseMap layer is used to display the ALK Maps tiles in your map container. The four parameters of the BaseMap layer are region, dataset, style, and attribution. These parameters will be explained in further detail later in this page.

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
You can choose a satellite image provider by setting the imgsrc parameter. Values other than Default require a premium add-on license. Sat1(DigitalGlobal) is a premium satellite option that provides Trimble Maps curated satellite images and tiles, when available.

Other premium options include Sat2 (DigitalGlobeConsumer), Sat3 (DigitalGlobeTrueCurrency), Sat4 (DigitalGlobeColorConsumer), Sat5 (DigitalGlobeAPIVivid), and Sat6 (DigitalGlobeAPIRecent).

Sample Code
var baseLayer = L.ALKMaps.Layer.baseMap({
style: ALKMaps.STYLE.SATELLITE,
imgsrc: "sat1"
});
Satellite Map Style
ALKMaps.STYLE.TERRAIN Terrain Map Style
ALKMaps.STYLE.DEFAULT
Deprecated This style redirects to ALKMaps.STYLE.TRANSPORTATION.
Default Map Style
ALKMaps.STYLE.CLASSIC
Deprecated This style redirects to ALKMaps.STYLE.TRANSPORTATION.
Classic Map Style
ALKMaps.STYLE.MONOCHROME
Deprecated This style redirects to ALKMaps.STYLE.DATALIGHT.
Monochrome Map Style
ALKMaps.STYLE.ROADATLAS
Deprecated This style redirects to ALKMaps.STYLE.TRANSPORTATION.
Road Atlas Map Style
ALKMaps.STYLE.CONTEMPORARY
Deprecated This style redirects to ALKMaps.STYLE.DATADARK.
Contemporary Map Style
ALKMaps.STYLE.SMOOTH
Deprecated This style redirects to ALKMaps.STYLE.DATALIGHT.
Smooth Map Style
ALKMaps.STYLE.LIGHTNESS
Deprecated This style redirects to ALKMaps.STYLE.DATALIGHT.
Lightness Map Style
ALKMaps.STYLE.NIGHT
Deprecated This style redirects to ALKMaps.STYLE.DATADARK.
Night Map Style

You may change the style using the BaseMap layer’s setStyle function.

baseLayer.setStyle("basic");

You may change map overlay styles using the BaseMap layer’s drawergroups option.

// Add drawer groups in the constructor.
var baseLayer = L.ALKMaps.Layer.baseMap({
  drawergroups: ALKMaps.CONTENT.COMMERCIAL
});

// Other ways to modify drawer groups
// Add drawer groups.
baseLayer.addContent(ALKMaps.CONTENT.BORDERS);

// Remove drawer groups.
baseLayer.removeContent(ALKMaps.CONTENT.COMMERCIAL);

// Replace existing drawers with default drawers.
baseLayer.setContent(ALKMaps.CONTENT.DEFAULT);

// Available drawer groups:
// ALKMaps.CONTENT.CITIES
// ALKMaps.CONTENT.LABELS
// ALKMaps.CONTENT.ROADS
// ALKMaps.CONTENT.COMMERCIAL
// ALKMaps.CONTENT.BORDERS
// ALKMaps.CONTENT.AREAS
// ALKMaps.CONTENT.DEFAULT

Regions

For those who have access, you may view tiles from different data regions and datasets all around the world. The different options for both region and dataset are shown in the table below.

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.
dataset [Current | PCM_EU | PCM_OC | PCM_SA |
PCM_AF | PCM_ME | PCM_IN | PCM_SE]


Default: Current
Current: NA/Current
PCM_EU: Europe
PCM_OC: Australia
PCM_SA: South America
PCM_AF: Africa
PCM_ME: Middle East
PCM_IN: India
PCM_SE: South East Asia

You can also change both the region and dataset by using the BaseMap layer’s setRegion and setDataset functions respectively.

baseLayer.setRegion("EU");
baseLayer.setDataset("PCM_EU");
Last updated September 5, 2022.