Skip to main content

Pointer

Pointer component adding functionality to parent Map component.

This component adds pointer which dynamically changes its location based on current map position relative to pointer target. This component does not require any layer and can be placed directly as a child of Map.

How to use it

import { Map, MapProvider, Pointer } from 'mapy-cz-react';

<MapProvider center={{ lat: 50.096406, lng: 14.463071 }} id="map-example">
<Map>
<Pointer coords={{ lng: 14.4608576, lat: 50.0963478 }} />
</Map>
;
</MapProvider>;

Props

NameTypeDefaultDescriptionRequired
coordsobjectundefinedObject with attributes longitude and latitude defining marker position.✔️
redPointerboolfalseBlue pointer as default, red pointer with value true
showDistanceboolfalseAdds label with distance to pointer target

Example

Live Editor
Result
Loading...