Skip to main content

@mapgear/geoapps > ThemeMaps

ThemeMaps class

Provides access to the thememap functionality of GeoApps. Can be accessed through the Map.ThemeMaps-property.

Signature:
export declare class ThemeMaps 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ThemeMaps class.

Example

An example of the usage:

// Connect as anonymous user to a geoapps environment
geoapps.Initialize("<specified tenant>");

// Add the map to a div with element id `map`
var map = geoapps.AddMap("map", "<mapId>");

// Wait till the map loaded, before starting the baselayers
map.onLoaded.add(() => {
// ThemeMaps
map.ThemeMaps.onLoaded.add(function () {
console.log(map.ThemeMaps.Items);
});

// Activate thememap
map.ThemeMaps.ActivateThememap(<thememapId>);

// Get thememap
map.ThemeMaps.GetThemeMap(themeMapId);
});

Events

PropertyModifiersTypeDescription
onActivatedreadonlyGAEvent<ThemeMapActivatedEventArgs>Triggers when a thememap is activated
onLoadedreadonlyGAEvent<GAEventArgs>Triggers when the thememaps list is loaded

Properties

PropertyModifiersTypeDescription
ActiveThememapIdreadonlystringReturn the id of the current active thememap
ItemsreadonlyThemeMap[]List of available thememaps

Methods

MethodModifiersDescription
ActivateThememap(thememapId)Activate another thememap by id
GetThemeMap(themeMapId)Retrieve a thememap
on(event, eventHandler)Bind to an event (legacy purposes)