From 8b8fd1ccbb940e9e59eea7fe09559ce65920c0ea Mon Sep 17 00:00:00 2001 From: alamoWEB Date: Tue, 7 Jun 2022 01:02:57 -0400 Subject: [PATCH 1/3] updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61bd1fa..f714c3e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ React Native for Web implementation of react-native-maps (using Leaflet) ## Installation ```sh -yarn add react-native-web-mapview +yarn add @alamoweb/react-native-web-mapview ``` ### Add Leaflet CSS (TBD) From 846dbb038d2035c1efc44d3babe500791fa37f2c Mon Sep 17 00:00:00 2001 From: alamoWEB Date: Tue, 7 Jun 2022 01:24:33 -0400 Subject: [PATCH 2/3] updated readme and contributing --- CONTRIBUTING.md | 25 +---------------- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 70 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d237a94..c6f77cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,18 +20,6 @@ To start the packager: yarn example start ``` -To run the example app on Android: - -```sh -yarn example android -``` - -To run the example app on iOS: - -```sh -yarn example ios -``` - To run the example app on Web: ```sh @@ -78,16 +66,6 @@ We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint] Our pre-commit hooks verify that the linter and tests pass when committing. -### Publishing to npm - -We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. - -To publish new versions, run the following: - -```sh -yarn release -``` - ### Scripts The `package.json` file contains various scripts for common tasks: @@ -97,8 +75,7 @@ The `package.json` file contains various scripts for common tasks: - `yarn lint`: lint files with ESLint. - `yarn test`: run unit tests with Jest. - `yarn example start`: start the Metro server for the example app. -- `yarn example android`: run the example app on Android. -- `yarn example ios`: run the example app on iOS. +- `yarn example web`: run the example app on Web. ### Sending a pull request diff --git a/README.md b/README.md index f714c3e..8e64f28 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,84 @@ React Native for Web implementation of react-native-maps (using Leaflet) +# About + +Based on react-native-web-maps but using Leaflet, avoinding expensive Google Maps costs. + ## Installation ```sh yarn add @alamoweb/react-native-web-mapview ``` -### Add Leaflet CSS (TBD) +Add the the Leaflet CSS: + +- In case you're using Expo, add it to your web/index.html +[How to expose expo's index.html?](https://github.com/expo/expo/issues/11401#issuecomment-747745228) + + +### Additional +If you're using `react-google-maps` lib for iOS/Android an want to support Web without needing to add a condition to switch between the libs, add this alias to your `webpack.config.js`: + +```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 -TBD +```ts +import MapView, { Marker } from '@alamoweb/react-native-web-mapview'; // or 'react-native-maps' +``` + +See the original [documentation](https://github.com/react-native-maps/react-native-maps). + +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` +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 From bdad77b520d33683dfdf29e5bab764181bdd10aa Mon Sep 17 00:00:00 2001 From: alamoWEB Date: Tue, 7 Jun 2022 01:27:53 -0400 Subject: [PATCH 3/3] chore: release 0.1.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e4b856..baedcc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@alamoweb/react-native-web-mapview", - "version": "0.1.4", + "version": "0.1.5", "description": "React Native for WEB implementation of react-native-maps using Leaflet", "main": "lib/commonjs/index", "module": "lib/module/index",