0.1.11 • Published 3 years ago

@alamoweb/react-native-web-mapview v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-web-mapview

React Native for Web implementation of react-native-maps (using Leaflet)

About

Based on react-native-web-maps but using Leaflet (default).

Installation

yarn add @alamoweb/react-native-web-mapview

Add the Leaflet CSS:

<html>
  <head>
    ...
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css" integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ==" crossorigin="" />
  </head>
  ...
</html>

Additional

If you're using react-google-maps lib for iOS/Android and wanting to support Web without needing to add a condition to switch between the libs, add this alias to your webpack.config.js:

const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function (env, argv) {
  const config = await createExpoWebpackConfigAsync(env, argv);
  // Customize the config before returning it.

  config.resolve.alias['react-native-maps'] = '@alamoweb/react-native-web-mapview';

  return config;
};

Usage

import MapView, { Marker } from '@alamoweb/react-native-web-mapview'; // or 'react-native-maps'

See the original documentation.

The supported components are:

  • MapView
  • Marker

MapView:

The officially supported props are:

  • region
  • initialRegion
  • maxZoomLevel
  • minZoomLevel

The officially supported events are:

  • onMapReady
  • onPanDrag
  • onRegionChange
  • onRegionChangeComplete

The officially supported methods are:

  • getMapBoundaries
  • getCamera
  • setCamera
  • animateCamera

Additional methods:

  • getMap: returns the Leaflet map instance

Marker:

The officially supported props are:

  • icon
  • image
  • title
  • description
  • coordinate
  • identifier
  • opacity

The officially supported events are:

  • onPress

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago