A
A
AlexFo902019-03-15 21:08:02
Yandex maps
AlexFo90, 2019-03-15 21:08:02

How to work with yandex map React?

Good evening! Tell me, can anyone know where to read in Russian or watch a video on connecting yandex map react (creating tags, etc.) but not in the documentation (it's good there, but difficult to understand)?
Thanks in advance) can someone throw some article)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kn1ght_t, 2019-03-15
@AlexFo90

take this (bindings of yandex-maps to react): https://github.com/gribnoysup/react-yandex-maps
and do something like this (I think it’s clear what is happening):

import { YMaps, Map, Placemark } from "react-yandex-maps";

const mapData = {
  center: [55.751574, 37.573856],
  zoom: 5,
};

const coordinates = [
  [55.684758, 37.738521],
  [57.684758, 39.738521]
];

const App = () => (
  <YMaps>
    <Map defaultState={mapData}>
      {coordinates.map(coordinate => <Placemark geometry={coordinate} />)}
    </Map>
  </YMaps>
);

you can pass various props: https://react-yandex-maps.now.sh/geo-objects/map
in general, everything is in the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question