Map Styles
Map styles provide the visual styling for the map. See the chart below for the enumeration names and examples of each style. The default style for maps is TrimbleMaps.Common.Style.TRANSPORTATION
.
The map style can be set when the map is initialized and it can be changed using the setStyle
function on a map object.
Enumeration | Example |
---|---|
TrimbleMaps.Common.Style.TRANSPORTATION |
![]() |
TrimbleMaps.Common.Style.DATALIGHT |
![]() |
TrimbleMaps.Common.Style.DATADARK |
![]() |
TrimbleMaps.Common.Style.TERRAIN |
![]() |
TrimbleMaps.Common.Style.SATELLITE |
![]() |
Map Initialization
The style can be set when a map is created by using the style
property.
const myMap = new TrimbleMaps.Map({
container: "YOUR_DIV_HERE",
center: new TrimbleMaps.LngLat(-74.1, 40.71),
zoom: 14,
style: TrimbleMaps.Common.Style.DATADARK
});
setStyle Function
The style of a map can be changed using setStyle.
myMap.setStyle(TrimbleMaps.Common.Style.SATELLITE);
Regions
See the chart below for the enumeration names and descriptions of each region. The default region for maps is TrimbleMaps.Common.Region.NA
.
Enumeration | Description |
---|---|
TrimbleMaps.Common.Region.NA |
North America |
TrimbleMaps.Common.Region.EU |
Europe |
TrimbleMaps.Common.Region.OC |
Oceania |
TrimbleMaps.Common.Region.SA |
South America |
TrimbleMaps.Common.Region.AS |
Asia |
TrimbleMaps.Common.Region.AF |
Africa |
TrimbleMaps.Common.Region.ME |
Middle East |
TrimbleMaps.Common.Region.WW |
Worldwide |
Map Initialization
The region can be set when a map is created by using the region
property.
const myMap = new TrimbleMaps.Map({
container: "YOUR_DIV_HERE",
center: new TrimbleMaps.LngLat(-0.12, 51.5),
zoom: 15,
region: TrimbleMaps.Common.Region.EU
});
setRegion Function
The region can be changed using setRegion.
myMap.setRegion(TrimbleMaps.Common.Region.EU);