@mapgear/geoapps > InformationOverlays
InformationOverlays class
Provides access to the information overlay functionality of GeoApps. Can be accessed through the Map.InformationOverlays-property.
export declare class InformationOverlays
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 InformationOverlays 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 information overlay
// InformationOverlays
map.InformationOverlays.onLoaded.add(function () {
console.log(map.InformationOverlays.Items);
});
// Add information overlay
map.InformationOverlays.Add(<informationOverlay>);
// Remove information overlay
map.InformationOverlays.Remove(<informationOverlay>);
Events
| Property | Modifiers | Type | Description |
|---|---|---|---|
| onAdded | readonly | GAEvent<InformationOverlayAddedEventArgs> | Triggers when an information overlay is added |
| onLoaded | readonly | GAEvent<GAEventArgs> | Triggers when all information overlays are loaded from the server |
| onRemoved | readonly | GAEvent<InformationOverlayRemovedEventArgs> | Triggers when an information overlay is removed |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| Count | readonly | number | Retrieve the amount of overlays available |
| Items | readonly | InformationOverlay[] | Get all information overlays |
Methods
| Method | Modifiers | Description |
|---|---|---|
| Add(informationOverlay) | Add an information overlay to the map | |
| on(event, eventHandler) | Bind to an event (legacy purposes) | |
| Remove(informationOverlay) | Remove the information overlay from the map. If it is not found, nothing happens and the remove-event isn't triggered. |