maplibre-react-native
maplibre-react-native copied to clipboard
Fix: Improved examples and added other features/fixes
My first PR
Description
- Fixes "Map > Style JSON (currently relies on a Mapbox-hosted population tile set)" 12
- Fixes errors when running npm install in the examples folder by using latest versions.
- Fixes errors when running app by using local examples folder.
- Adds usage of openstreetmap instead of vector tiles
- Adds image overlay of NYC (copyright free don't worry - https://commons.wikimedia.org/wiki/File:New_York_City_Greater_NY_US_street_map.svg)
- Added README.md file in expo-app folder and examples folder
- Added note that OpenStreetMap data CAN be used (because I came to this library for that reason)
- Fixed broken examples folder link in the GETTINGSTARTED.md file
Notes
One issue I encountered is that in the original code, it does:
import { sheet, colors } from '@maplibre-react-native/examples';
import { default as Home } from '@maplibre-react-native/examples/src/scenes/Examples';
import { IS_ANDROID } from '@maplibre-react-native/examples/src/utils';
I changed it to
import { sheet, colors } from '../examples';
import { default as Home } from '../examples/src/scenes/Examples';
import { IS_ANDROID } from '../examples/src/utils';
The problem is, I don't know if it actually will work because when I cloned the repo, I just moved the examples folder into the expo-app folder so it would all be built together. So:
- When I did it with the examples folder in the expo-app folder, everything worked fine. This code should work, but I can't guarantee the code works because I'm too lazy to run npx eas build again but I will try to test it later this week (busy 🫤)
- I did not test for other platforms.
Checklist
- [ ] I have tested this on a device/simulator for each compatible OS
- [ ] I formatted JS and TS files with running
yarn lint:fixin the root folder Got error ESLint couldn't find an eslint.config.(js|mjs|cjs) file. - [ ] I have run tests via
yarn testin the root folder Got error ESLint couldn't find an eslint.config.(js|mjs|cjs) file. - [ ] I updated the documentation with running
yarn generatein the root folder Error: YAMLException: duplicated mapping key at line 5, column 1: enableGlobalCache: true - [X] I mentioned this change in
CHANGELOG.md - [ ] I updated the typings files (
index.d.ts) Should be no need? - [X] I added/updated a sample (
/example)