gribnoysup / react-yandex-maps

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

Pass coords to point B on RoutePanel #323

Closed ukulya closed 2 years ago

ukulya commented 2 years ago

Hey guys! Does anyone know how to pass coords to point B on RoutePanel Right now I have the following code and I need to pass coords from server to point B on RoutePanel

<Map
          defaultState={{ center: mapGeopmetry, zoom: 13 }}
          width="100%"
          height="100%"
          modules={["geolocation", "geocode"]}
        >
          <GeolocationControl
            data={{
              image: locationImg,
              title: "Укажите ваше точное местоположение",
            }}
          />

          <RoutePanel
            state={{
              from:'',
              to:''
            }}
            onOptionsChange={(e) => {
              setCoords(e.originalEvent.target.routePanel.state._data);
              // here I should pass coords array something like 
              // setCoords({...state,to:coords})
            }}
            options={{
              autofocus: false,
              float: "none",
              maxWidth: "100%",
              showHeader: "true",
              title:
                "Бишкек,Ош,Нарын                                 Москва,Санкт-Петербург",
              position: {
                left: "0",
                right: "0",
              },
            }}
          />
        </Map>
mmarkelov commented 2 years ago

@ukulya hello, could you please provide a small representation with codesandbox?

ukulya commented 2 years ago

Hello Thank you I figured it out already

пн, 14 мар. 2022 г., 13:53 Maksim Markelov @.***>:

@ukulya https://github.com/ukulya hello, could you please provide a small representation with codesandbox https://codesandbox.io/?

— Reply to this email directly, view it on GitHub https://github.com/gribnoysup/react-yandex-maps/issues/323#issuecomment-1066476952, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALQNMSDFGKJZT2IBQXTDNG3U73WANANCNFSM5PG3CJNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>