Switching Basemap Styles
The Sovereign Maps SDK includes built-in vector and raster basemap themes tailored for various operational contexts - from high-contrast navigation to dark-mode telemetry.
Predefined Premium Styles
The SDK integrates directly with Sovereign Solutions' premium vector tile server. apiKey is
required whenever style is one of the following predefined identifiers, or an SS tile
server URL:
| Style Constant | Visual Tone | Recommended Use Cases |
|---|---|---|
'3D' | 3D Buildings & Extrusions | Urban planning, detailed navigation |
'BASIC' | Clean, Minimalist | General purpose mapping |
'BRIGHT' | High Saturation | Day navigation, consumer apps |
'DARK' | Cyberpunk / Dark Mode | Night dashboards, fleet tracking |
'FIORD' | Cool Slate / Blue | Maritime, cold-palette dashboards |
'LIBERTY' | Full Detail Topo | Rich topographical exploration |
'POSITRON' | Ultra Light Grey | Data visualization, heatmaps |
'TERRAIN' | Shaded Relief & Contours | Elevation, outdoor & rural mapping |
'TONER' | High Contrast Black & White | Print-ready, high visibility |
style also accepts a full style specification object, or any other style URL - apiKey is not
required in those cases.
Using a Premium Style
import { MapEngine } from '@sovereignsolutions/ss-map-gl';
// Premium sovereign style using a predefined style name and API key
const premiumMap = new MapEngine({
container: 'map',
style: 'DARK', // Choose one of the predefined styles
apiKey: 'your_sovereign_api_key', // Required for premium styles
center: [78.9629, 20.5937],
zoom: 5,
});
Dynamic Style Switching
Switch the basemap style at runtime with mapEngine.setStyle(style, apiKey?). It resolves SS
style names/URLs the same way the constructor does. Active cluster layers and drawing canvases
automatically reload themselves without losing visual data or throwing console warnings:
// Switch style dynamically
mapEngine.setStyle('BASIC', 'your_sovereign_api_key');
See also: Basic Map Initialization.