L
L
lazuren2020-02-02 15:09:25
Yandex maps
lazuren, 2020-02-02 15:09:25

How to call the component method from yandex maps?

Tell me how to call the method checkedPointfrom Balloon`a Yandex maps (react-yandex-maps).
The code looks like this:

export class TestMaps extends React.Component {

    checkedPoint = (data) => {
        console.log(data);
    };

    render() {
        return (
            <YMaps>
                <Map state={{
                    center: [55.76, 37.64],
                    zoom: 11,
                }}
                     width='100%' height='350px'>

                    <Placemark modules={['geoObject.addon.balloon']}
                               geometry={[55.76, 37.64]}
                               properties={{
                                   iconContent: 1,
                                   balloonContentHeader: 'Balloon content header',
                                   balloonContentBody: 'Balloon content body',
                                   balloonContentFooter: '<div class="btn-primary">Выбрать</div>',

                               }}
                    />
                </Map>
            </YMaps>
        )
    }
}


If it's simple, then I want to call the checkedPoint method when the "Select" button is pressed.
I am currently getting TypeError: checkedPoint is not a function

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question