Documentation / @gebeta/js
@gebeta/js
References
addProtocol
Re-exports addProtocol
removeProtocol
Re-exports removeProtocol
Classes
AttributionControl
Constructors
new AttributionControl()
new AttributionControl(options?): AttributionControlParameters
| Parameter | Type |
|---|---|
options? | unknown |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:99
BrowserLocationProvider
Implements
ILocationProvider
Methods
start()
start(onLocation): voidParameters
| Parameter | Type |
|---|---|
onLocation | (location) => void |
Returns
void
Implementation of
ILocationProvider.start
Defined in
client/js/src/adapters/LocationProvider.ts:36
stop()
stop(): voidReturns
void
Implementation of
ILocationProvider.stop
Defined in
client/js/src/adapters/LocationProvider.ts:70
getInstance()
static getInstance(options?): BrowserLocationProviderParameters
| Parameter | Type |
|---|---|
options? | LocationProviderOptions |
Returns
Defined in
client/js/src/adapters/LocationProvider.ts:23
ClusteringManager
Manages marker clustering on a MapLibre map.
Groups nearby markers into clusters at lower zoom levels and renders individual markers when zoomed in. Cluster markers automatically expand on click unless a custom clusterOnClick handler is provided.
Enable via the constructor: new GebetaMaps({ clustering: { enabled: true } }), then access via sdk.clustering.
Constructors
new ClusteringManager()
new ClusteringManager(
mapAdapter,
markerFactory,
popupFactory,
options): ClusteringManagerParameters
| Parameter | Type |
|---|---|
mapAdapter | IMapAdapter |
markerFactory | IMarkerFactory |
popupFactory | IPopupFactory |
options | ClusteringOptions |
Returns
Defined in
client/js/src/Clustering/ClusteringManager.ts:30
Methods
addMarker()
addMarker(marker): voidAdd a marker to clustering.
Parameters
| Parameter | Type | Description |
|---|---|---|
marker | MarkerData | Marker data to add |
Returns
void
Defined in
client/js/src/Clustering/ClusteringManager.ts:59
clearMarkers()
clearMarkers(): voidClear all markers.
Returns
void
Defined in
client/js/src/Clustering/ClusteringManager.ts:85
getMarker()
getMarker(markerId): undefined | MarkerDataGet marker by ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
markerId | string | ID of marker to find |
Returns
undefined | MarkerData
Marker data or undefined if not found
Defined in
client/js/src/Clustering/ClusteringManager.ts:103
getMarkers()
getMarkers(): MarkerData[]Get all markers.
Returns
MarkerData[]
Array of all markers
Defined in
client/js/src/Clustering/ClusteringManager.ts:94
getOptions()
getOptions(): NormalizedClusteringOptionsGet clustering options.
Returns
NormalizedClusteringOptions
Current clustering options
Defined in
client/js/src/Clustering/ClusteringManager.ts:124
removeMarker()
removeMarker(markerId): booleanRemove a marker by ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
markerId | string | ID of marker to remove |
Returns
boolean
True if marker was removed, false if not found
Defined in
client/js/src/Clustering/ClusteringManager.ts:69
updateOptions()
updateOptions(options): voidUpdate clustering options.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | Partial<ClusteringOptions> | Partial options to update |
Returns
void
Defined in
client/js/src/Clustering/ClusteringManager.ts:111
DirectionsManager
Manages route display on the map.
Wraps the core DirectionsManager and adds MapLibre GL rendering: draws the route line and places origin/destination/waypoint markers.
Use via sdk.getDirections() and sdk.displayRoute(), or access directly for advanced use cases.
Constructors
new DirectionsManager()
new DirectionsManager(
mapAdapter,
markerFactory,
auth,
clientId?): DirectionsManagerParameters
| Parameter | Type |
|---|---|
mapAdapter | IMapAdapter |
markerFactory | IMarkerFactory |
auth | AuthInput |
clientId? | string |
Returns
Defined in
client/js/src/Directions/DirectionsManager.ts:39
Methods
clearRoute()
clearRoute(): voidReturns
void
Defined in
client/js/src/Directions/DirectionsManager.ts:111
displayRoute()
displayRoute(routeData, options): voidParameters
| Parameter | Type |
|---|---|
routeData | RouteData |
options | DisplayRouteOptions & object |
Returns
void
Defined in
client/js/src/Directions/DirectionsManager.ts:70
getCurrentRoute()
getCurrentRoute(): null | RouteDataReturns
null | RouteData
Defined in
client/js/src/Directions/DirectionsManager.ts:118
getDirections()
getDirections(
origin,
destination,
options): Promise<RouteData>Parameters
| Parameter | Type |
|---|---|
origin | LngLat |
destination | LngLat |
options | DirectionsOptions |
Returns
Promise<RouteData>
Defined in
client/js/src/Directions/DirectionsManager.ts:60
getRouteSummary()
getRouteSummary(): null | objectReturns
null | object
Defined in
client/js/src/Directions/DirectionsManager.ts:122
updateRouteStyle()
updateRouteStyle(style): voidParameters
| Parameter | Type |
|---|---|
style | RouteStyleOptions |
Returns
void
Defined in
client/js/src/Directions/DirectionsManager.ts:140
FenceManager
Manages geofences (polygons) on the map.
Supports interactive fence drawing, rendering pre-defined fences, and attaching overlays (HTML labels) at fence centroids.
Access via sdk.fencing after calling sdk.init().
Constructors
new FenceManager()
new FenceManager(
mapAdapter,
markerFactory,
popupFactory,
options): FenceManagerParameters
| Parameter | Type |
|---|---|
mapAdapter | IMapAdapter |
markerFactory | IMarkerFactory |
popupFactory | IPopupFactory |
options | FenceManagerOptions |
Returns
Defined in
client/js/src/Fencing/FenceManager.ts:61
Methods
addPoint()
addPoint(point, options?): voidAdd a point to the current fence.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | LngLatLike | Point to add |
options? | FencePointOptions & object | Optional point options |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:130
canCloseFence()
canCloseFence(): booleanCheck if current fence can be closed (has at least 3 points).
Returns
boolean
True if fence can be closed
Defined in
client/js/src/Fencing/FenceManager.ts:343
clearAllFences()
clearAllFences(): voidClear all stored fences.
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:260
clearCurrentFence()
clearCurrentFence(): voidClear the current fence being drawn.
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:198
closeFence()
closeFence(): null | FenceDefinitionClose the current fence.
Returns
null | FenceDefinition
Fence definition if closed successfully, null otherwise
Defined in
client/js/src/Fencing/FenceManager.ts:182
getCurrentFencePoints()
getCurrentFencePoints(): LngLatLike[]Get the current fence points.
Returns
LngLatLike[]
Array of points or empty array if not drawing
Defined in
client/js/src/Fencing/FenceManager.ts:335
getCurrentStyle()
getCurrentStyle(): FenceStyleOptionsGet current fence style (if drawing).
Returns
FenceStyleOptions
Current fence style or default style
Defined in
client/js/src/Fencing/FenceManager.ts:303
getDefaultStyle()
getDefaultStyle(): FenceStyleOptionsGet current default style.
Returns
FenceStyleOptions
Copy of default style
Defined in
client/js/src/Fencing/FenceManager.ts:295
getFence()
getFence(fenceId): undefined | FenceDefinitionGet a fence by ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
fenceId | string | number | Fence ID |
Returns
undefined | FenceDefinition
Fence definition or undefined if not found
Defined in
client/js/src/Fencing/FenceManager.ts:220
getFenceByName()
getFenceByName(name): undefined | FenceDefinitionGet a fence by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Fence name |
Returns
undefined | FenceDefinition
Fence definition or undefined if not found
Defined in
client/js/src/Fencing/FenceManager.ts:229
getFenceCentroid()
getFenceCentroid(fence): LngLatGet fence centroid.
Parameters
| Parameter | Type | Description |
|---|---|---|
fence | string | number | FenceDefinition | Fence definition or fence ID |
Returns
LngLat
Centroid coordinates
Defined in
client/js/src/Fencing/FenceManager.ts:352
getFences()
getFences(): FenceDefinition[]Get all stored fences.
Returns
FenceDefinition[]
Array of fence definitions
Defined in
client/js/src/Fencing/FenceManager.ts:211
getProximityThreshold()
getProximityThreshold(): numberGet proximity threshold.
Returns
number
Threshold in meters
Defined in
client/js/src/Fencing/FenceManager.ts:319
isDrawingFence()
isDrawingFence(): booleanCheck if currently drawing a fence.
Returns
boolean
True if drawing is active
Defined in
client/js/src/Fencing/FenceManager.ts:327
off()
off(event, callback): voidRemove event listener for fence events.
Parameters
| Parameter | Type | Description |
|---|---|---|
event | "fenceCompleted" | Event name |
callback | (event) => void | Callback function to remove |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:387
on()
on(event, callback): voidAdd event listener for fence events.
Parameters
| Parameter | Type | Description |
|---|---|---|
event | "fenceCompleted" | Event name |
callback | (event) => void | Callback function |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:378
removeFence()
removeFence(fenceId): booleanRemove a fence by ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
fenceId | string | number | Fence ID |
Returns
boolean
True if fence was removed
Defined in
client/js/src/Fencing/FenceManager.ts:238
removeFenceByName()
removeFenceByName(name): booleanRemove a fence by name.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Fence name |
Returns
boolean
True if fence was removed
Defined in
client/js/src/Fencing/FenceManager.ts:251
renderFences()
renderFences(fences, options?): voidRender multiple fences from an array of definitions.
Parameters
| Parameter | Type | Description |
|---|---|---|
fences | FenceDefinition[] | Array of fence definitions |
options? | object | Render options |
options.clearExisting? | boolean | - |
options.persistent? | boolean | - |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:361
setDefaultStyle()
setDefaultStyle(style): voidSet default fence style for future fences.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | FenceStyleOptions | Style options |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:287
setProximityThreshold()
setProximityThreshold(meters): voidSet proximity threshold for auto-closing fences.
Parameters
| Parameter | Type | Description |
|---|---|---|
meters | number | Threshold distance in meters |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:311
startDrawing()
startDrawing(style?): voidStart drawing a new fence.
Parameters
| Parameter | Type | Description |
|---|---|---|
style? | FenceStyleOptions | Optional style options for this fence |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:104
stopDrawing()
stopDrawing(): voidStop drawing the current fence.
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:118
updateCurrentFenceStyle()
updateCurrentFenceStyle(style): voidUpdate the style for the current fence being drawn.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | Partial<FenceStyleOptions> | Style options to update |
Returns
void
Defined in
client/js/src/Fencing/FenceManager.ts:274
FullscreenControl
Constructors
new FullscreenControl()
new FullscreenControl(options?): FullscreenControlParameters
| Parameter | Type |
|---|---|
options? | unknown |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:91
GebetaMaps
Main entry point for the Gebeta Maps JavaScript SDK.
Example
// Service account auth (recommended)
const sdk = new GebetaMaps({
auth: { accessToken: '...', refreshToken: '...' }
});
const map = sdk.init({ container: 'map', center: [38.74, 9.02], zoom: 12 });
// Legacy API key (deprecated)
const sdk = new GebetaMaps({ apiKey: 'your-api-key' });Constructors
new GebetaMaps()
new GebetaMaps(options): GebetaMapsCreates a new GebetaMaps instance.
Provide either apiKey (deprecated) or auth (service account) — not both.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | GebetaMapsConstructorOptions & object | Constructor options |
Returns
Throws
If neither apiKey nor auth is provided, or if both are provided.
Defined in
client/js/src/GebetaMaps.ts:70
Accessors
clustering
Get Signature
get clustering(): null | ClusteringManagerAccess clustering functionality for grouping nearby markers. Returns null if clustering was not enabled in the constructor options.
Returns
null | ClusteringManager
Defined in
client/js/src/GebetaMaps.ts:310
fencing
Get Signature
get fencing(): FenceManagerAccess geofencing functionality for drawing and managing polygon fences.
Throws
If called before init() completes map style loading.
Returns
Defined in
client/js/src/GebetaMaps.ts:318
geocodingManager
Get Signature
get geocodingManager(): GeocodingManagerAccess geocoding functionality (forward and reverse).
Throws
If called before init() completes map style loading.
Returns
Defined in
client/js/src/GebetaMaps.ts:47
navigation
Get Signature
get navigation(): NavigationManagerAccess turn-by-turn navigation with real-time tracking.
Throws
If called before init() completes map style loading.
Returns
Defined in
client/js/src/GebetaMaps.ts:379
Methods
addMarker()
addMarker(options): MarkerAdd a marker to the map. Can be called right after init().
Parameters
| Parameter | Type |
|---|---|
options | GebetaMarkerOptions |
Returns
The marker; call .remove() to delete it.
Example
sdk.addMarker({ lngLat: [38.7578, 9.0301], color: '#e63946', popup: 'Meskel Square' });
sdk.addMarker({ lngLat: origin, element: pinEl, anchor: 'bottom' });
sdk.addMarker({ lngLat, draggable: true, onDragEnd: ({ lng, lat }) => save(lng, lat) });Throws
If called before init().
Defined in
client/js/src/GebetaMaps.ts:341
addNavigationControls()
addNavigationControls(position): voidAdd zoom +/- navigation controls to the map. Alternatively, pass navigationControl: true in init() options.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
position | string | API.Common.Enums.CornerPosition.TOP_RIGHT | Corner position (default: 'top-right') |
Returns
void
Defined in
client/js/src/GebetaMaps.ts:210
addPopup()
addPopup(options): PopupOpen a popup on the map. Can be called right after init().
Parameters
| Parameter | Type |
|---|---|
options | GebetaPopupOptions |
Returns
The popup; call .remove() to close it.
Example
sdk.addPopup({ lngLat: [38.7578, 9.0301], text: 'Meskel Square' });Throws
If called before init().
Defined in
client/js/src/GebetaMaps.ts:355
clearRoute()
clearRoute(): voidRemove the currently displayed route line and markers from the map.
Returns
void
Defined in
client/js/src/GebetaMaps.ts:274
displayRoute()
displayRoute(routeData, options?): voidRender a route on the map as a colored line with optional origin/destination markers.
Parameters
| Parameter | Type | Description |
|---|---|---|
routeData | RouteData | Route returned from getDirections() |
options? | DisplayRouteOptions & object | Display options (showMarkers, originIcon, destinationIcon, routeStyle) |
Returns
void
Defined in
client/js/src/GebetaMaps.ts:263
getCurrentRoute()
getCurrentRoute(): null | RouteDataReturns the currently active route, or null if no route is loaded.
Returns
null | RouteData
Defined in
client/js/src/GebetaMaps.ts:280
getDirections()
getDirections(
origin,
destination,
options?): Promise<RouteData>Calculate a route between two points.
Parameters
| Parameter | Type | Description |
|---|---|---|
origin | LngLat | Starting point { lng, lat } |
destination | LngLat | Ending point { lng, lat } |
options? | DirectionsOptions | Optional waypoints and average speed |
Returns
Promise<RouteData>
RouteData with geometry, instructions, and summary
Throws
If called before init() completes map style loading.
Throws
If origin or destination coordinates are missing.
Throws
If the directions API request fails.
Example
const route = await sdk.getDirections(
{ lng: 38.74, lat: 9.02 },
{ lng: 38.78, lat: 9.05 }
);
sdk.displayRoute(route);Defined in
client/js/src/GebetaMaps.ts:243
getMap()
getMap(): null | MapReturns the underlying MapLibre GL Map instance, or null before init().
Returns
null | Map
Defined in
client/js/src/GebetaMaps.ts:371
getPlatform()
getPlatform(): PlatformContextReturns the platform context (map adapter, marker/popup factories). Useful for advanced use cases that need direct access to the underlying adapters.
Returns
PlatformContext
Throws
If called before init().
Defined in
client/js/src/GebetaMaps.ts:194
getRouteSummary()
getRouteSummary(): null | objectReturns distance, duration, origin, destination, and waypoints for the current route.
Returns
null | object
Defined in
client/js/src/GebetaMaps.ts:286
init()
init(options): MapInitialize the map and mount it to a DOM element.
All SDK managers (geocoding, directions, fencing, clustering, navigation) are created after the map style finishes loading. Do not call manager methods until the map style.load event fires.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | GebetaMapsInitOptions | Initialization options |
Returns
Map
The underlying MapLibre GL Map instance
Defined in
client/js/src/GebetaMaps.ts:139
updateRouteStyle()
updateRouteStyle(style): voidUpdate the visual style of the displayed route line.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | RouteStyleOptions | Style properties (line-color, line-width, line-opacity, line-dasharray) |
Returns
void
Defined in
client/js/src/GebetaMaps.ts:301
GeocodingManager
GeocodingManager handles forward and reverse geocoding operations. Platform-agnostic: uses fetch API which is available in all JS environments.
Constructors
new GeocodingManager()
new GeocodingManager(auth, clientId?): GeocodingManagerParameters
| Parameter | Type |
|---|---|
auth | AuthInput |
clientId? | string |
Returns
Defined in
core/dist/Geocoding/GeocodingManager.d.ts:11
Methods
geocode()
geocode(name): Promise<GeocodeResult[]>Forward geocoding: search by name/address.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Place name or address to search for |
Returns
Promise<GeocodeResult[]>
Promise resolving to array of geocoding results
Defined in
core/dist/Geocoding/GeocodingManager.d.ts:17
reverseGeocode()
reverseGeocode(latlng): Promise<GeocodeResult[]>Reverse geocoding: search by coordinates.
Parameters
| Parameter | Type |
|---|---|
latlng | LngLat |
Returns
Promise<GeocodeResult[]>
Promise resolving to array of geocoding results
Defined in
core/dist/Geocoding/GeocodingManager.d.ts:23
GeolocateControl
Constructors
new GeolocateControl()
new GeolocateControl(options?): GeolocateControlParameters
| Parameter | Type |
|---|---|
options? | unknown |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:87
LngLat
Constructors
new LngLat()
new LngLat(lng, lat): LngLatParameters
| Parameter | Type |
|---|---|
lng | number |
lat | number |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:77
Properties
| Property | Type | Defined in |
|---|---|---|
lat | number | client/js/src/maplibre-gl.d.ts:79 |
lng | number | client/js/src/maplibre-gl.d.ts:78 |
LngLatBounds
Constructors
new LngLatBounds()
new LngLatBounds(): LngLatBoundsReturns
Defined in
client/js/src/maplibre-gl.d.ts:64
Methods
extend()
extend(point): thisParameters
| Parameter | Type |
|---|---|
point | [number, number] |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:65
getEast()
getEast(): numberReturns
number
Defined in
client/js/src/maplibre-gl.d.ts:68
getNorth()
getNorth(): numberReturns
number
Defined in
client/js/src/maplibre-gl.d.ts:69
getSouth()
getSouth(): numberReturns
number
Defined in
client/js/src/maplibre-gl.d.ts:67
getWest()
getWest(): numberReturns
number
Defined in
client/js/src/maplibre-gl.d.ts:66
Marker
Constructors
new Marker()
new Marker(options?): MarkerParameters
| Parameter | Type |
|---|---|
options? | object |
options.anchor? | string |
options.className? | string |
options.color? | string |
options.draggable? | boolean |
options.element? | HTMLElement |
options.offset? | number | [number, number] |
options.rotation? | number |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:28
Methods
addTo()
addTo(map): thisParameters
| Parameter | Type |
|---|---|
map | Map |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:40
getElement()
getElement(): HTMLElementReturns
HTMLElement
Defined in
client/js/src/maplibre-gl.d.ts:39
getLngLat()
getLngLat(): LngLatReturns
Defined in
client/js/src/maplibre-gl.d.ts:38
on()
on(event, fn): thisParameters
| Parameter | Type |
|---|---|
event | string |
fn | (...args) => void |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:43
remove()
remove(): voidReturns
void
Defined in
client/js/src/maplibre-gl.d.ts:41
setLngLat()
setLngLat(lngLat): thisParameters
| Parameter | Type |
|---|---|
lngLat | [number, number] |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:37
setPopup()
setPopup(popup): thisParameters
| Parameter | Type |
|---|---|
popup | null | Popup |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:42
MercatorCoordinate
Constructors
new MercatorCoordinate()
new MercatorCoordinate(
x,
y,
z?): MercatorCoordinateParameters
| Parameter | Type |
|---|---|
x | number |
y | number |
z? | number |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:83
NavigationControl
Constructors
new NavigationControl()
new NavigationControl(options?): NavigationControlParameters
| Parameter | Type |
|---|---|
options? | unknown |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:73
NavigationManager
Browser navigation manager — wraps the core NavigationManager and adds map rendering: a live location marker and a camera that follows the driver.
Access via sdk.navigation after calling sdk.init().
Example
const route = await sdk.getDirections(origin, destination);
sdk.displayRoute(route);
sdk.navigation.on('progress', e => console.log('remaining:', e.remainingDistance));
sdk.navigation.on('arrive', () => console.log('Arrived!'));
sdk.navigation.start(route, { userId: 'user-123' }, BrowserLocationProvider.getInstance());Constructors
new NavigationManager()
new NavigationManager(
auth,
mapAdapter,
markerFactory,
options,
clientId?): NavigationManagerCreates a new NavigationManager instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
auth | AuthInput | API key or service key authentication input |
mapAdapter | IMapAdapter | Map adapter for camera control |
markerFactory | IMarkerFactory | Marker factory for location marker |
options | NavigationManagerOptions | Configuration options for navigation behavior |
clientId? | string | - |
Returns
Throws
If apiKey, mapAdapter, or markerFactory is missing
Defined in
client/js/src/Navigation/NavigationManager.ts:47
Methods
getCurrentRoute()
getCurrentRoute(): null | RouteDataGets the current route being navigated.
Returns
null | RouteData
Current route data or null if not navigating
Defined in
client/js/src/Navigation/NavigationManager.ts:246
getCurrentStepIndex()
getCurrentStepIndex(): numberGets the current step index in the route instructions.
Returns
number
Current step index
Defined in
client/js/src/Navigation/NavigationManager.ts:254
isNavigating()
isNavigating(): booleanChecks if navigation is currently active.
Returns
boolean
True if navigating, false otherwise
Defined in
client/js/src/Navigation/NavigationManager.ts:262
off()
off<K>(event, callback): voidRemove a navigation event listener.
Type Parameters
| Type Parameter |
|---|
K extends keyof NavigationEventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
callback | NavigationEventMap[K] |
Returns
void
Defined in
client/js/src/Navigation/NavigationManager.ts:274
on()
on<K>(event, callback): voidRegister a navigation event listener. Payload type is inferred from the event name.
Type Parameters
| Type Parameter |
|---|
K extends keyof NavigationEventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
callback | NavigationEventMap[K] |
Returns
void
Defined in
client/js/src/Navigation/NavigationManager.ts:269
start()
start(
route,
startOptions,
locationProvider): voidStarts navigation along the provided route.
Parameters
| Parameter | Type | Description |
|---|---|---|
route | RouteData | Route data containing geometry and instructions |
startOptions | NavigationStartOptions | Options for starting navigation (userId, role, precision) |
locationProvider | ILocationProvider | Provider that supplies location data |
Returns
void
Defined in
client/js/src/Navigation/NavigationManager.ts:77
stop()
stop(): voidStops navigation and removes location marker.
Returns
void
Defined in
client/js/src/Navigation/NavigationManager.ts:114
Popup
Constructors
new Popup()
new Popup(options?): PopupParameters
| Parameter | Type |
|---|---|
options? | object |
options.anchor? | string |
options.className? | string |
options.closeButton? | boolean |
options.closeOnClick? | boolean |
options.maxWidth? | string |
options.offset? | number | [number, number] |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:47
Methods
addTo()
addTo(map): thisParameters
| Parameter | Type |
|---|---|
map | Map |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:59
remove()
remove(): voidReturns
void
Defined in
client/js/src/maplibre-gl.d.ts:60
setDOMContent()
setDOMContent(element): thisParameters
| Parameter | Type |
|---|---|
element | HTMLElement |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:57
setHTML()
setHTML(html): thisParameters
| Parameter | Type |
|---|---|
html | string |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:55
setLngLat()
setLngLat(lngLat): thisParameters
| Parameter | Type |
|---|---|
lngLat | [number, number] |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:58
setText()
setText(text): thisParameters
| Parameter | Type |
|---|---|
text | string |
Returns
this
Defined in
client/js/src/maplibre-gl.d.ts:56
ScaleControl
Constructors
new ScaleControl()
new ScaleControl(options?): ScaleControlParameters
| Parameter | Type |
|---|---|
options? | unknown |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:95
TerrainControl
Constructors
new TerrainControl()
new TerrainControl(options?): TerrainControlParameters
| Parameter | Type |
|---|---|
options? | unknown |
Returns
Defined in
client/js/src/maplibre-gl.d.ts:103
Interfaces
GebetaMarkerOptions
Options for sdk.addMarker().
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
anchor? | Anchor | Part of the marker placed at lngLat (default: 'center', or 'bottom' for imageUrl). | client/js/src/Markers/helpers.ts:30 |
className? | string | CSS class added to the marker element. | client/js/src/Markers/helpers.ts:38 |
color? | string | Color of the default pin (ignored with element / imageUrl). | client/js/src/Markers/helpers.ts:28 |
draggable? | boolean | Allow the user to drag the marker. | client/js/src/Markers/helpers.ts:34 |
element? | HTMLElement | Custom HTML element. Takes precedence over imageUrl and color. | client/js/src/Markers/helpers.ts:22 |
imageUrl? | string | Image URL for the marker icon. | client/js/src/Markers/helpers.ts:24 |
lngLat | LngLatLike | Marker position [lng, lat] or { lng, lat }. | client/js/src/Markers/helpers.ts:20 |
offset? | [number, number] | Pixel offset [x, y]. | client/js/src/Markers/helpers.ts:32 |
onClick? | (marker: Marker, event: MouseEvent) => void | Click handler. | client/js/src/Markers/helpers.ts:42 |
onDragEnd? | (lngLat: object, marker: Marker) => void | Called after the user finishes dragging (requires draggable). | client/js/src/Markers/helpers.ts:44 |
popup? | string | HTMLElement | Popup opened when the marker is clicked: plain text, or an HTMLElement. | client/js/src/Markers/helpers.ts:40 |
rotation? | number | Rotation in degrees. | client/js/src/Markers/helpers.ts:36 |
size? | [number, number] | Icon size [width, height] in pixels when using imageUrl (default: [30, 30]). | client/js/src/Markers/helpers.ts:26 |
GebetaPopupOptions
Options for sdk.addPopup().
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
anchor? | Anchor | Popup anchor relative to lngLat. | client/js/src/Markers/helpers.ts:62 |
className? | string | CSS class added to the popup container. | client/js/src/Markers/helpers.ts:68 |
closeButton? | boolean | Show the close button (default: true). | client/js/src/Markers/helpers.ts:58 |
closeOnClick? | boolean | Close when the map is clicked (default: true). | client/js/src/Markers/helpers.ts:60 |
element? | HTMLElement | DOM element content. | client/js/src/Markers/helpers.ts:56 |
html? | string | HTML content. Only use with trusted markup. | client/js/src/Markers/helpers.ts:54 |
lngLat | LngLatLike | Popup position [lng, lat] or { lng, lat }. | client/js/src/Markers/helpers.ts:50 |
maxWidth? | string | CSS max-width (default: '240px'). | client/js/src/Markers/helpers.ts:66 |
offset? | number | [number, number] | Pixel offset. | client/js/src/Markers/helpers.ts:64 |
text? | string | Plain text content (safe for user data). | client/js/src/Markers/helpers.ts:52 |
GeoJSONSource
Properties
| Property | Type | Defined in |
|---|---|---|
type | "geojson" | client/js/src/maplibre-gl.d.ts:110 |
Methods
setData()
setData(data): voidParameters
| Parameter | Type |
|---|---|
data | Feature<Geometry, GeoJsonProperties> |
Returns
void
Defined in
client/js/src/maplibre-gl.d.ts:111
MapMouseEvent
Properties
| Property | Type | Defined in |
|---|---|---|
lngLat | object | client/js/src/maplibre-gl.d.ts:115 |
lngLat.lat | number | client/js/src/maplibre-gl.d.ts:115 |
lngLat.lng | number | client/js/src/maplibre-gl.d.ts:115 |
Type Aliases
GebetaMapInstance
type GebetaMapInstance: MapLibreMap;The map instance returned by sdk.init() / sdk.getMap().
Defined in
Variables
gebeta
const gebeta: object;Namespace object with every Gebeta building block (also window.gebeta on CDN).
Type declaration
| Name | Type | Defined in |
|---|---|---|
addProtocol | (name, handler) => void | client/js/src/gebeta.ts:70 |
AttributionControl | typeof AttributionControl | client/js/src/gebeta.ts:68 |
FullscreenControl | typeof FullscreenControl | client/js/src/gebeta.ts:66 |
GeolocateControl | typeof GeolocateControl | client/js/src/gebeta.ts:65 |
LngLat | typeof LngLat | client/js/src/gebeta.ts:61 |
LngLatBounds | typeof LngLatBounds | client/js/src/gebeta.ts:62 |
Marker | typeof Marker | client/js/src/gebeta.ts:59 |
MercatorCoordinate | typeof MercatorCoordinate | client/js/src/gebeta.ts:63 |
NavigationControl | typeof NavigationControl | client/js/src/gebeta.ts:64 |
Popup | typeof Popup | client/js/src/gebeta.ts:60 |
removeProtocol | (name) => void | client/js/src/gebeta.ts:71 |
ScaleControl | typeof ScaleControl | client/js/src/gebeta.ts:67 |
TerrainControl | typeof TerrainControl | client/js/src/gebeta.ts:69 |