map-ir / mapir-mapbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mapir SDK for React Native

npm version A React Native library for building maps with the Mapbox Maps SDK for iOS and Mapbox Maps SDK for Android

Map.ir React Native wrapper for mapbox-gl-js. Expose a bunch of component meant to be simple to use for React Native.

Get API Key

๐Ÿ”‘ You should first get api key from Map.ir

Installation

Dependencies

npm install mapir-react-native-sdk

Platform Specific Installation Guides

Quick start

Import module

import React, {Component} from 'react';
import { SafeAreaView, StyleSheet, View} from 'react-native';
import Mapir from 'mapir-react-native-sdk'

Generate Component

export default function App() {
  onRegionDidChange = (e) => {
    console.log('onRegionDidChange', e.geometry.coordinates);
  };
  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.container}>
        <Mapir
          apiKey={'YOUR_MAPIR_API_KEY'}
          onRegionDidChange={(e) => onRegionDidChange(e)}
          style={styles.container}
        >
          <Mapir.Camera
            zoomLevel={13}
            centerCoordinate={[51.422548, 35.732573]}
          />
        </Mapir>
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

๐Ÿ“– English Documentation

๐Ÿ“– Persian Documentation

About

License:MIT License


Languages

Language:Java 42.3%Language:Objective-C 34.5%Language:JavaScript 21.5%Language:HTML 1.5%Language:Shell 0.2%Language:Ruby 0.1%