Skip to main content

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 ConstantVisual ToneRecommended Use Cases
'3D'3D Buildings & ExtrusionsUrban planning, detailed navigation
'BASIC'Clean, MinimalistGeneral purpose mapping
'BRIGHT'High SaturationDay navigation, consumer apps
'DARK'Cyberpunk / Dark ModeNight dashboards, fleet tracking
'FIORD'Cool Slate / BlueMaritime, cold-palette dashboards
'LIBERTY'Full Detail TopoRich topographical exploration
'POSITRON'Ultra Light GreyData visualization, heatmaps
'TERRAIN'Shaded Relief & ContoursElevation, outdoor & rural mapping
'TONER'High Contrast Black & WhitePrint-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.