sbcrmweb / react-ymaps3

React Yandex Maps API 3 wrapper
MIT License
3 stars 0 forks source link

react-ymaps3

React Yandex Maps Javascript API wrapper https://yandex.ru/dev/jsapi30/doc/en/dg/concepts/general#react

Installation

yarn add react-ymaps3

Usage with typescript

yarn add -D @yandex/ymaps3-types@latest

Requirements

To work you need to get Yandex Maps Javascript API Key with hosts configured.

Minimal working example

export const MyComponent = () => {
  return (
    <div style={{height: 600}}>
      <YMapProvider apikey="{YMAPS3_API_KEY}">
        <YMap location={{center: [37.95, 55.65], zoom: 10}} mode="vector" theme="dark">
          <YMapDefaultSchemeLayer />
          <YMapDefaultFeaturesLayer />
        </YMap>
      </YMapProvider>
    </div>
  )
}

Features

Packages