Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt

Use this file to discover all available pages before exploring further.

Create a context object to control a map component.

Parameters

PropertyTypeRequiredDescription
mapIdStringYesMap component ID

Return Value

Returns a MapContext object with control methods.

MapContext Methods

MethodDescription
getCenterLocation()Get map center coordinates
moveToLocation()Move to current location
includePoints()Adjust view to include points
getRegion()Get visible region
getScale()Get current zoom level

Code Example

const mapCtx = my.createMapContext('myMap');

mapCtx.getCenterLocation({
  success: (res) => {
    console.log('Center:', res.latitude, res.longitude);
  }
});
<map id="myMap" latitude="{{lat}}" longitude="{{lng}}" />