🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

react-native-tpl-maps

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

react-native-tpl-maps

TPL Maps React Native Package

0.0.6
unpublished
latest
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

React Native TPL Maps

React Native TPL Maps Android, iOS pacakge for React Native. It will to add maps to your application. The API automatically handles access to our TPL Maps servers, data downloading, map display, and response to map gestures. You can do add markers, shapes, POIs show/hide point of interests, custom map styles and much more.

Maintainers

TPL Maps

Disclaimer

Maintaining Mapping SDK is very complex, because it is often used for many different usecases (rendering tiles, icons, pois, and much more). we will prioritize updating and feature enhancement in future.

Platform compatibility

This project is compatible with iOS, Android This project is compatible with Android Minimum SDK 21.

Getting Started

Please follow the below steps:

1- npm install react-native-tpl-maps-view 2- Use the latest version of Package v0.0.5 in Package.json file 3- Add your TPL Maps Key in Android Manifest File like below

 <meta-data android:name="com.tplmaps.android.sdk.API_KEY"
            android:value="YOUR_API_KEY" />

4- Add MyPacakge() in your Android MainApplication Class ArrayList inside getPackages method

Usage

Import the MyViewManager2 component from react-native-tpl-maps-view and use it like so to load Base Map:

import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { MyViewManager2 } from 'react-native-tpl-maps-view';

const createFragment = (viewId: any) =>
  UIManager.dispatchViewManagerCommand(
    viewId,
    "1", [viewId],
  );

const App = () => {
  const ref = useRef(null);

  useEffect(() => {
    const viewId = findNodeHandle(ref.current);
    createFragment(viewId);
  }, []);


  return (

      <MyViewManager2 ref={ref} />

  );
};


export default App;

Add Marker on Map with LatLng

import {AddMarker} from 'react-native-tpl-maps-view'


AddMarker("67.125973;24.820649")

Camera Zoom on Map with LatLng and Zoom Level

import {AddMarker} from 'react-native-tpl-maps-view'


SetCameraAnimation("67.125973;24.820649" , "15")

Register Callback to recevice LatLng on Marker Click and Camera Change Listner

import {AddMarker} from 'react-native-tpl-maps-view'


CameraCallback()

**You will receive LatLng updates within TplMapsController.tsx**
export function CameraCallback() {
  MyModule.CameraCallback('Hello from React Native!')
    .then((result: any) => {
      console.warn(result)
      console.log(result); // Log the promise result
    })
    .catch((error: any) => {
      console.warn("Not working....")
      console.error(error); // Handle any errors
    });
}

Common issues

  • If you're getting Invariant Violation: Native component for "RNCWebView does not exist" it likely means you forgot to run react-native link or there was some error with the linking process
  • If you encounter a build error during the task :app:mergeDexRelease, you need to enable multidex support in android/app/build.gradle

Contributing

Please report your issues and bugs on daniyal.khan@tplmaps.com

License

MIT

Keywords

FAQs

Package last updated on 25 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts