GithubHelp home page GithubHelp logo

yuoppp / react-native-yandex-map-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from escaton/react-native-yandex-map-kit

0.0 1.0 0.0 113 KB

Java 32.24% JavaScript 12.00% Objective-C 35.65% Ruby 8.77% Python 11.35%

react-native-yandex-map-kit's Introduction

react-native-yandex-map-kit

Getting started

$ npm install react-native-yandex-map-kit --save

Installation

iOS

  1. Create or add the following content to ios/Podfile
  # You Podfile should look similar to this file. React Native currently does not support use_frameworks!
  source 'https://github.com/CocoaPods/Specs.git'

  platform :ios, '9.0'

  target '_YOUR_PROJECT_TARGET_' do
    rn_path = '../node_modules/react-native'
    rn_yandex_mapkit_path = '../node_modules/react-native-yandex-map-kit'

    pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
    pod 'React', path: rn_path, subspecs: [
      'DevSupport',
      'Core',
      'RCTActionSheet',
      'RCTAnimation',
      'RCTGeolocation',
      'RCTImage',
      'RCTLinkingIOS',
      'RCTNetwork',
      'RCTSettings',
      'RCTText',
      'RCTVibration',
      'RCTWebSocket',
      # 'BatchedBridge', # REMOVE COMMENT if you use RN <0.54
    ]

    pod 'react-native-yandex-map-kit', path: rn_yandex_mapkit_path
  end
  1. Edit ios/%project%/AppDelegate.m add #import <YandexMapKit/YMKMapKitFactory.h> and [YMKMapKit setApiKey:@"844d5468-fb6f-437c-92cf-2fb6c6a780d1"];
  2. Make sure your target is 9.0+

Android

  1. Run $ react-native link react-native-yandex-map-kit and continue from step 4. Or:

  2. Open up android/app/src/main/java/[...]/MainApplication.java

  • Add import com.yandex.RNYandexMapKit.RNYandexMapKitPackage; to the imports at the top of the file
  • Add new RNYandexMapKitPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:

    include ':react-native-yandex-map-kit'
    project(':react-native-yandex-map-kit').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-yandex-map-kit/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:

      compile project(':react-native-yandex-map-kit')
    
  3. Insert the following lines inside android block in android/app/build.gradle:

    android {
      ...
      packagingOptions {
          pickFirst 'lib/armeabi-v7a/libgnustl_shared.so'
          pickFirst 'lib/arm64-v8a/libgnustl_shared.so'
          pickFirst 'lib/x86_64/libgnustl_shared.so'
          pickFirst 'lib/x86/libgnustl_shared.so'
      }
    }
    
  4. Update sdk and dependencies: compileSdkVersion 27 and com.android.support:appcompat-v7:27.0.0 Feel free to come up in issues to discuss it.

  5. Add maven google repo in android/build.gradle

  allprojects {
    repositories {
      ...
      maven {
        url 'https://maven.google.com'
      }
    }
  }

Usage

import MapKit from 'react-native-yandex-map-kit';

render() {
  return (<MapKit/>)
}

react-native-yandex-map-kit's People

Contributors

escaton avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.