gribnoysup / react-yandex-maps

Yandex Maps API bindings for React
MIT License
327 stars 114 forks source link

Using of RemoteObjectManager #302

Closed ch3rn1k closed 3 years ago

ch3rn1k commented 3 years ago

Hello, is there any simple way to use RemoteObjectManager from YMaps API? Thanks for reply!

mmarkelov commented 3 years ago

@ch3rn1k hello! Unfortunately there is no quick way to use RemoteObjectManager

import "./styles.css";
import { YMaps, Map } from "react-yandex-maps";

export default function App() {
  const mapState = {
    center: [55.739625, 37.5412],
    zoom: 12
  };

  const rOM = (ymaps) => {
    // you can use it in this way
    console.log(ymaps.RemoteObjectManager);
  };

  return (
    <div className="App">
      <YMaps>
        <Map
          modules={["RemoteObjectManager"]}
          state={mapState}
          onLoad={addRoute}
        ></Map>
      </YMaps>
    </div>
  );
}
ch3rn1k commented 3 years ago

Ah, okay, thanks!