N
N
Newbie Ivanovich2019-06-03 10:01:53
Yandex maps
Newbie Ivanovich, 2019-06-03 10:01:53

How to connect Yandex maps in react-native?

I can't connect Yandex maps to react-native application.
I do it like this

import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
import styles from '../styles';
import { YandexMapView, YandexMapKit } from 'react-native-yandexmapkit';
YandexMapKit.setApiKey('АПИ КЛЮЧ');

class MapScreen extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            region: { lat: 55.834464, lng: 97.584574 }
        }
    }
  render() {
    return (
         <YandexMapView
            ref="yandexMap"
            onInteraction={this.onInteraction}
            region={this.state.region}
            showMyLocation={true}
            geocodingEnabled={true}
            onGeocoding={this.onGeocoding}
            showMyLocationButton={true}
         />
    );
  }
}

export default MapScreen;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2019-06-03
@NovichokIvanovich

did you integrate according to this documentation?
https://github.com/doomsower/react-native-yandexmapkit
they have an example have you looked at it?
https://github.com/doomsower/react-native-yandexma...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question