How to Install

To install this library, you can use a package manager such as npm or yarn. Use the following command:

npm i @netizen-teknologi/react-native-maps-leaflet

Or using yarn:

yarn add @netizen-teknologi/react-native-maps-leaflet

Required Dependencies

This library requires the following dependencies:

  • react-native-webview: Used for rendering web content inside the React Native app.
  • npm i react-native-webview

Usage

After installation, you can start using the library as follows:

import { MapView } from '@netizen-teknologi/react-native-maps-leaflet';

Here is an example of how to use it in your application:

Example of snack

Props

Below is the list of available props for the MapView component:

  • markers (Array): An array of marker objects used to display locations on the map.
    • latitude (String): The latitude of the marker.
    • longitude (String): The longitude of the marker.
    • iconUrl (String): A URL of the icon to display for the marker.
  • zoom (Number): The zoom level for the map, where a higher number zooms in closer to the location.
  • mapOnClick (Function): A callback function triggered when the map is clicked. Receives the click event, including the latitude and longitude of the clicked point.
  • mapOnMove (Function): A callback function triggered when the map is moving (during dragging or programmatic movements). Receives the updated map position.
  • mapOnMoveEnd (Function): A callback function triggered when the map movement ends. This is typically used to get the final position after dragging or zooming.

FAQ

Here are some frequently asked questions:

  • How do I get the latest version?
    You can update it using the command npm update or yarn upgrade.
  • Does this library support TypeScript?
    Yes, this library supports TypeScript by default.

Support

If you need help, feel free to contact our support team at netizenteknologi@gmail.com.

Issues & Contributions

If you encounter any issues or bugs, please let us know by opening an issue on our GitHub Issues page.

We welcome contributions from the community! Feel free to open pull requests for any features or fixes you would like to add.