volga-volga / react-native-yamap

React Native Yandex Maps | Яндекс Карты | Yandex.MapKit implementation for react native | YandexMaps
148 stars 81 forks source link

Is this design and functionalities realisable with the library #181

Closed anis-18 closed 1 year ago

anis-18 commented 1 year ago

IMG_20220912_124810

My question is , is that design (zoom buttons , and other buttons) with the possibility of seeing buses Moving in the card (data from our backend ) with this look or design with this library ? And which difficulties or issues should i take in considération when implementing such module ?

ownikss commented 1 year ago
  1. You can use YamapView methods to zoom map. setZoom
  2. You can set map center with any coordinates. For example you can get current user location. setCenter
  3. You can zoom map to fit all given points. Use this method to fit polyline route. fitMarkers
  4. I don't understand bus icon. Probably it's mean hide transit layer. To hide map layer you can use prop mapStyle https://github.com/volga-volga/react-native-yamap/issues/185
anis-18 commented 1 year ago
  1. You can use YamapView methods to zoom map. setZoom
  2. You can set map center with any coordinates. For example you can get current user location. setCenter
  3. You can zoom map to fit all given points. Use this method to fit polyline route. fitMarkers
  4. I don't understand bus icon. Probably it's mean hide transit layer. To hide map layer you can use prop mapStyle Скрыть оригинальные остановки #185

Should i get a ref of a the YaMap to access methods ? and what's the ref type in typescript ?

E-Viskhan commented 8 months ago
  1. You can use YamapView methods to zoom map. setZoom
  2. You can set map center with any coordinates. For example you can get current user location. setCenter
  3. You can zoom map to fit all given points. Use this method to fit polyline route. fitMarkers
  4. I don't understand bus icon. Probably it's mean hide transit layer. To hide map layer you can use prop mapStyle Скрыть оригинальные остановки #185

Should i get a ref of a the YaMap to access methods ? and what's the ref type in typescript ?

This answer is for future users:

Yes, you should get a ref of a the YaMap to access methods and typescript type for useRef is YaMap.

import YaMap from 'react-native-yamap';

const mapRef = useRef<YaMap>(null);

<YaMap ref={mapRef}>
...
</YaMap>