MMapMarker
The MMapMarker
class is a marker component on the map. It enables you to insert a custom DOM implementation of the marker.
It is an HTML container linked to a point on the map. Use it to display a custom layout on the map.
The default marker implementation is represented in the package https://www.npmjs.com/package/@mappable-world/mappable-default-ui-theme.
Usage example
vanilla
react
vue
const markerElement = document.createElement('div');
markerElement.className = 'marker-class';
markerElement.innerText = "I'm marker!";
const marker = new MMapMarker(
{
source: 'markerSource',
coordinates: [25.229762, 55.289311],
draggable: true,
mapFollowsOnDrag: true
},
markerElement
);
map.addChild(marker);
Constructor
new MMapMarker(props
, element?
)
Constructor parameters
Parameter |
Type |
|
|
|
Redefines
Props
MMapMarkerProps: {
coordinates: <a href="ref/#LngLat">LngLat</a>;
disableRoundCoordinates?: boolean;
hideOutsideViewport?: <a href="ref/#HideOutsideRule">HideOutsideRule</a>;
id?: string;
properties?: <a href="ref/#recordkeys-type ">Record</a><string, unknown>;
source?: string;
zIndex?: number
} & <a href="ref/#interface-draggableprops">DraggableProps</a><<a href="MMapMarkerEventHandler">MMapMarkerEventHandler</a>> & <a href="ref/#interface-blockingprops">BlockingProps</a> & <a href="ref/#interface-featureclickevents">FeatureClickEvents
Methods
_onAttach
_onAttach(): void
Returns
void
Redefines
MMapGroupEntity._onAttach
_onDetach
_onDetach(): void
Returns
void
Redefines
MMapGroupEntity._onDetach
addChild
addChild(child
, index?
): MMapMarker
Parameters
Parameter |
Type |
|
|
|
|
Returns
Inherited from
removeChild
removeChild(child
): MMapMarker
Parameters
Parameter |
Type |
|
|
Returns
Inherited from
update
update(changedProps
): void
Parameters
Parameter |
Type |
Description |
|
New |
Returns
void