gribnoysup / react-yandex-maps

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

How to set parameters for the route panel? #112

Open egor-a-trubnikov-panov opened 5 years ago

egor-a-trubnikov-panov commented 5 years ago

it doesn't work <RoutePanel state={{ fromEnabled: false, from: 'moscow', to: 'saint petersburg', type: 'auto', }} />

"react-yandex-maps": "3.0.2",

gribnoysup commented 5 years ago

Seems like routePanel control is an exception in YMaps API where the state needs to be set on an instance of routePanel attached to the control and not the control itself. I need to think about how to fix this without messing with YMaps API too much.

In the meantime, you can work around it by accessing the instance of the control directly, here is an example of how to do that

Edit kx805k12o3