@maplibre/maplibre-react-native
Advanced tools
Comparing version 10.0.0-alpha.22 to 10.0.0-alpha.23
@@ -5,6 +5,7 @@ # Android Installation | ||
Note that the Android SDK is slightly peculiar in that it | ||
> [!NOTE] | ||
> MapLibre Native for Android is slightly peculiar in that it | ||
_requires_ setting an access token, even though it will be `null` for | ||
most users (only Mapbox authenticates this way). Even if it feels odd, | ||
you have to have a line like this in your code before using the SDK. | ||
you have to have a line like this in your code before using the library. | ||
You can put this near the top of your `App.js` for convenience. | ||
@@ -11,0 +12,0 @@ |
module.exports = { | ||
presets: ["module:metro-react-native-babel-preset"], | ||
presets: ["module:@react-native/babel-preset"], | ||
plugins: [ | ||
@@ -4,0 +4,0 @@ ["@babel/plugin-proposal-class-properties", { loose: true }], |
@@ -9,2 +9,10 @@ ## UNRELEASED | ||
## 10.0.0-alpha.23 | ||
fix: keep @ts-ignore for headingIcon in library ([#477](https://github.com/maplibre/maplibre-react-native/pull/477)) | ||
feat: upgrade @turf to v7 and remove geo utils ([#478](https://github.com/maplibre/maplibre-react-native/pull/478)) | ||
docs: improve guides and branding ([#475](https://github.com/maplibre/maplibre-react-native/pull/475)) | ||
chore: improve examples monorepo setup with reusable App ([#474](https://github.com/maplibre/maplibre-react-native/pull/474)) | ||
chore: remove react native elements from examples ([#472](https://github.com/maplibre/maplibre-react-native/pull/472)) | ||
## 10.0.0-alpha.22 | ||
@@ -11,0 +19,0 @@ |
@@ -11,6 +11,9 @@ # Contributing | ||
This project uses `yarn` as a package manager. DO NOT install `yarn` using `npm` as that will install | ||
the outdated 1.x branch. Full instructions are in the [yarn docs](https://yarnpkg.com/getting-started/install), | ||
but here's the quick checklist at the time of this writing. | ||
This project uses `yarn` as a package manager. | ||
> [!CAUTION] | ||
> DO NOT install `yarn` using `npm` as that will install the outdated 1.x branch. Full instructions are in | ||
> the [yarn docs](https://yarnpkg.com/getting-started/install), but here's the quick checklist at the time of this | ||
> writing. | ||
Make sure to correctly configure your Editor following [this docs](https://yarnpkg.com/getting-started/editor-sdks). | ||
@@ -20,3 +23,4 @@ | ||
2. `corepack prepare yarn@stable --activate` | ||
3. On first install, the above may change your yarn config away from `pnp`; check your git working copy for changes and revert if necessary. | ||
3. On first install, the above may change your yarn config away from `pnp`; check your git working copy for changes and | ||
revert if necessary. | ||
4. `yarn install` | ||
@@ -26,4 +30,6 @@ | ||
The metro bundler under `/example` is set up to use the libraries files under root. | ||
Which means, when you change something within `javascript/components/UserLocation.js` | ||
The metro bundlers under [`/packages/react-native-app`](/packages/react-native-app) and [ | ||
`/packages/expo-app`](/packages/expo-app) is set up to use the libraries files under root. | ||
Which means, when you change something within [ | ||
`/javascript/components/UserLocation.tsx`](/javascript/components/UserLocation.tsx) | ||
it will be reflected in any scene in example that uses that component. | ||
@@ -33,3 +39,3 @@ | ||
## Optional: Local development with yalc | ||
## Optional: Local development with `yalc` | ||
@@ -49,12 +55,12 @@ It is often desirable to test in the context of an external project (for example, | ||
- Make sure to update/ add new tests for your changes | ||
- If you add a new feature, make sure to add a scene in `/example` for others to see/ test it | ||
- If you add a new feature, make sure to add a scene in [`/packages/examples`](/packages/examples) for others to | ||
see/test it | ||
## Documentation | ||
Documentation is generated from code blocks and comments. | ||
It will be auto-generated when you commit changes. | ||
If any changes are generated from your edits, the changed files will need to be added using `git add` before attempting the commit again. | ||
To manually generate the changes, run `yarn generate`. | ||
Documentation is generated from code blocks and comments. It will be auto-generated when you commit changes. If any | ||
changes are generated from your edits, the changed files will need to be added using `git add` before attempting the | ||
commit again. To manually generate the changes, run `yarn generate`. | ||
Notice, that changing the documentation in the individual <COMPONENT>.md within `/docs` will not suffice. | ||
The correct way is the above described | ||
Notice, that changing the documentation in the individual <COMPONENT>.md within `/docs` will not suffice. The correct | ||
way is the above described |
@@ -22,3 +22,3 @@ <!-- This file was autogenerated from Camera.js do not modify --> | ||
| followUserLocation | `boolean` | `none` | `false` | Should the map orientation follow the user's. | | ||
| followUserMode | `UserTrackingMode` | `none` | `false` | The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the `MapLibreGL.UserTrackingModes` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](../example/src/examples/Camera/SetUserTrackingModes.js) | | ||
| followUserMode | `UserTrackingMode` | `none` | `false` | The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the `MapLibreGL.UserTrackingModes` object. `Follow` (normal), `FollowWithHeading` (compass), `FollowWithCourse` (course). NOTE: `followUserLocation` must be set to `true` for any of the modes to take effect. [Example](/packages/examples/src/examples/Camera/SetUserTrackingModes.js) | | ||
| followZoomLevel | `number` | `none` | `false` | The zoomLevel on map while followUserLocation is set to `true` | | ||
@@ -25,0 +25,0 @@ | followPitch | `number` | `none` | `false` | The pitch on map while followUserLocation is set to `true` | |
# Getting Started | ||
Congratulations, you successfully installed maplibre-react-native! 🎉 | ||
This quickstart guide provides a zero-to-map intro, and from there you can check out the | ||
[examples](/example) folder if you want to jump in the deep end. | ||
This quickstart guide provides a zero-to-map intro using React Native. From there you can check out the | ||
[examples](/packages/examples) folder if you want to jump in the deep end. | ||
@@ -44,3 +43,3 @@ ## Prerequisites | ||
### Review platform specific info | ||
### Review platform specific Details | ||
@@ -47,0 +46,0 @@ Check out the installation guide(s) for additional information about platform-specific setup, quirks, |
<!-- This file was autogenerated from MapView.js do not modify --> | ||
## <MapLibreGL.MapView /> | ||
### MapView backed by MapLibre GL Native | ||
### MapView backed by MapLibre Native | ||
@@ -5,0 +5,0 @@ ### props |
@@ -53,3 +53,3 @@ <!-- This file was autogenerated from ShapeSource.js do not modify --> | ||
| ---- | :--: | :------: | :----------: | | ||
| `feature` | `Feature` | `Yes` | The feature cluster to expand. | | ||
| `feature` | `GeoJSON.Feature` | `Yes` | The feature cluster to expand. | | ||
@@ -70,3 +70,3 @@ | ||
| ---- | :--: | :------: | :----------: | | ||
| `feature` | `Feature` | `Yes` | The feature cluster to expand. | | ||
| `feature` | `GeoJSON.Feature` | `Yes` | The feature cluster to expand. | | ||
| `limit` | `number` | `Yes` | The number of points to return. | | ||
@@ -89,3 +89,3 @@ | `offset` | `number` | `Yes` | The amount of points to skip (for pagination). | | ||
| ---- | :--: | :------: | :----------: | | ||
| `feature` | `Feature` | `Yes` | The feature cluster to expand. | | ||
| `feature` | `GeoJSON.Feature` | `Yes` | The feature cluster to expand. | | ||
@@ -92,0 +92,0 @@ |
@@ -29,3 +29,3 @@ # iOS Installation | ||
MapLibre GL Native has some issues on iOS Simulators in many | ||
MapLibre Native has some issues on iOS Simulators in many | ||
environments. The map either does not render at all or appears garbled when panning and zooming. | ||
@@ -32,0 +32,0 @@ It is best to test on a real device if at all possible at this time |
@@ -1,3 +0,2 @@ | ||
import { toJSONString } from "../../utils"; | ||
import { makeLatLngBounds } from "../../utils/geoUtils"; | ||
import { makeNativeBounds } from "../../utils/makeNativeBounds"; | ||
@@ -26,3 +25,3 @@ export interface OfflineCreatePackInputOptions { | ||
this.styleURL = options.styleURL; | ||
this.bounds = this._makeLatLngBounds(options.bounds); | ||
this.bounds = makeNativeBounds(...options.bounds); | ||
this.minZoom = options.minZoom; | ||
@@ -49,8 +48,2 @@ this.maxZoom = options.maxZoom; | ||
_makeLatLngBounds(bounds: [GeoJSON.Position, GeoJSON.Position]): string { | ||
const ne = bounds[0]; | ||
const sw = bounds[1]; | ||
return toJSONString(makeLatLngBounds(ne, sw)); | ||
} | ||
_makeMetadata(metadata?: Record<string, any>): string { | ||
@@ -57,0 +50,0 @@ return JSON.stringify({ |
@@ -0,5 +1,5 @@ | ||
import { featureCollection, point } from "@turf/helpers"; | ||
import { NativeModules } from "react-native"; | ||
import { toJSONString } from "../../utils"; | ||
import { makePoint, makeFeatureCollection } from "../../utils/geoUtils"; | ||
@@ -89,4 +89,3 @@ const MapLibreGL = NativeModules.MLNModule; | ||
_createCenterCoordPoint(centerCoordinate: GeoJSON.Position): string { | ||
const point = makePoint(centerCoordinate); | ||
return toJSONString(point); | ||
return toJSONString(point(centerCoordinate)); | ||
} | ||
@@ -98,6 +97,6 @@ | ||
for (const bound of bounds) { | ||
features.push(makePoint(bound)); | ||
features.push(point(bound)); | ||
} | ||
return toJSONString(makeFeatureCollection(features)); | ||
return toJSONString(featureCollection(features)); | ||
} | ||
@@ -104,0 +103,0 @@ } |
@@ -31,3 +31,5 @@ import { Image, processColor } from "react-native"; | ||
if (color === null || color === undefined || typeof color === "symbol") { | ||
console.error(`RNMaplibre: Invalid color value: ${rawStyle} using red`); | ||
console.error( | ||
`@maplibre/maplibre-react-native: Invalid color value ${rawStyle}, using #ff0000 (red) instead`, | ||
); | ||
rawStyle = "ff0000"; | ||
@@ -34,0 +36,0 @@ } else { |
{ | ||
"name": "@maplibre/maplibre-react-native", | ||
"description": "A MapLibre GL Native plugin for creating maps in React Native", | ||
"version": "10.0.0-alpha.22", | ||
"description": "React Native library for creating maps with MapLibre Native for Android & iOS", | ||
"version": "10.0.0-alpha.23", | ||
"publishConfig": { | ||
@@ -49,14 +49,11 @@ "access": "public" | ||
"dependencies": { | ||
"@mapbox/geo-viewport": ">=0.4.0", | ||
"@turf/along": "6.5.0", | ||
"@turf/distance": "6.5.0", | ||
"@turf/helpers": "6.5.0", | ||
"@turf/length": "6.5.0", | ||
"@turf/nearest-point-on-line": "6.5.0", | ||
"@turf/distance": "^7.1.0", | ||
"@turf/helpers": "^7.1.0", | ||
"@turf/length": "^7.1.0", | ||
"@turf/nearest-point-on-line": "^7.1.0", | ||
"@types/debounce": "^1.2.1", | ||
"@types/geojson": "^7946.0.10", | ||
"@types/geojson": "^7946.0.14", | ||
"@types/jest": "^29.5.12", | ||
"@types/mapbox__geo-viewport": "^0.4.1", | ||
"@types/node": "^18.11.18", | ||
"@types/react": "^18.2.15", | ||
"@types/react": "^18.2.79", | ||
"@types/react-native": "0.67.8", | ||
@@ -71,3 +68,4 @@ "debounce": "^2.0.0" | ||
"@expo/config-plugins": "^7.2.5", | ||
"@react-native/metro-config": "^0.72.7", | ||
"@react-native/babel-preset": "^0.74.88", | ||
"@react-native/metro-config": "^0.74.88", | ||
"@sinonjs/fake-timers": "^11.2.2", | ||
@@ -89,3 +87,2 @@ "@testing-library/react-native": "^12.4.3", | ||
"lint-staged": "^15.2.2", | ||
"metro-react-native-babel-preset": "^0.76.7", | ||
"node-dir": "0.1.17", | ||
@@ -96,3 +93,3 @@ "pinst": "^3.0.0", | ||
"react-docgen": "rnmapbox/react-docgen#rnmapbox-dist", | ||
"react-native": "0.74.6", | ||
"react-native": "^0.74.6", | ||
"react-test-renderer": "18.2.0", | ||
@@ -99,0 +96,0 @@ "typescript": "^5.3.3" |
@@ -123,2 +123,17 @@ "use strict"; | ||
}; | ||
/** | ||
* Set the Debug Information Format to DWARF with dSYM File during EAS Build for Managed App | ||
* https://github.com/expo/eas-cli/issues/968 | ||
* // Set artifactPath in eas.json | ||
* "ios": { | ||
* "artifactPath": "ios/build/*" | ||
* } | ||
*/ | ||
const withDwarfDsym = (config) => { | ||
return (0, config_plugins_1.withXcodeProject)(config, async (config) => { | ||
const xcodeProject = config.modResults; | ||
xcodeProject.debugInformationFormat = "dwarf-with-dsym"; | ||
return config; | ||
}); | ||
}; | ||
const withExcludedSimulatorArchitectures = (c) => { | ||
@@ -131,5 +146,5 @@ return (0, config_plugins_1.withXcodeProject)(c, (config) => { | ||
const withMapLibre = (config) => { | ||
config = withoutSignatures(withExcludedSimulatorArchitectures(config)); | ||
config = withoutSignatures(withDwarfDsym(withExcludedSimulatorArchitectures(config))); | ||
return withCocoaPodsInstallerBlocks(config); | ||
}; | ||
exports.default = (0, config_plugins_1.createRunOncePlugin)(withMapLibre, pkg.name, pkg.version); |
@@ -1,2 +0,2 @@ | ||
# Expo installation | ||
# Expo Installation | ||
@@ -26,8 +26,1 @@ NOTE: This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/). | ||
This plugin doesn't currently provide any additional properties for customization. The plugin simply generates the pre-install block in the `ios/Podfile` (the post-install block is not required for Expo support). No additional changes are done on Android. | ||
## Manual Setup | ||
For bare workflow projects, you can follow the manual setup guides: | ||
- [iOS](/ios/install.md) | ||
- [Android](/android/install.md) |
@@ -1,13 +0,9 @@ | ||
--- | ||
[![MapLibre Logo](https://maplibre.org/img/maplibre-logo-big.svg)](https://maplibre.org) | ||
# MapLibre React Native | ||
# MapLibre GL SDK for React Native | ||
_React Native library for creating maps with [MapLibre Native for Android & iOS](https://github.com/maplibre/maplibre-gl-native)_. | ||
_A React Native library for building maps with | ||
the [MapLibre GL Native SDK for iOS & Android](https://github.com/maplibre/maplibre-gl-native)_. | ||
This project originated as a fork of [rnmapbox](https://github.com/rnmapbox/maps), a community-maintained | ||
React Native Library for building maps with the Mapbox iOS and Android mobile SDKs. The original product | ||
React Native library for building maps with the Mapbox iOS and Android mobile SDKs. The original product | ||
supported both Mapbox and MapLibre for some time, but as the MapLibre and Mapbox SDKs have | ||
@@ -18,5 +14,3 @@ diverged, it has become necessary to separate the projects into specific wrappers by underlying renderer. | ||
[![npm version](https://badge.fury.io/js/%40maplibre%2Fmaplibre-react-native.svg)](https://badge.fury.io/js/%40maplibre%2Fmaplibre-react-native) | ||
[![Android Build](https://github.com/maplibre/maplibre-react-native/actions/workflows/android-actions.yml/badge.svg)](https://github.com/maplibre/maplibre-react-native/actions/workflows/android-actions.yml) | ||
[![iOS Build](https://github.com/maplibre/maplibre-react-native/actions/workflows/ios-actions.yml/badge.svg)](https://github.com/maplibre/maplibre-react-native/actions/workflows/ios-actions.yml) | ||
[![npm version](https://badge.fury.io/js/%40maplibre%2Fmaplibre-react-native.svg)](https://badge.fury.io/js/%40maplibre%2Fmaplibre-react-native) [![Android Build](https://github.com/maplibre/maplibre-react-native/actions/workflows/android-actions.yml/badge.svg)](https://github.com/maplibre/maplibre-react-native/actions/workflows/android-actions.yml) [![iOS Build](https://github.com/maplibre/maplibre-react-native/actions/workflows/ios-actions.yml/badge.svg)](https://github.com/maplibre/maplibre-react-native/actions/workflows/ios-actions.yml) | ||
@@ -38,3 +32,8 @@ --- | ||
[Getting Started (start here)](/docs/GettingStarted.md) | ||
- [Getting Started](/docs/GettingStarted.md) | ||
- Installation | ||
- React Native | ||
- [Android](/android/install.md) | ||
- [iOS](/ios/install.md) | ||
- [Expo](/plugin/install.md) | ||
@@ -84,6 +83,6 @@ ### Components | ||
Read the [CONTRIBUTING.md](CONTRIBUTING.md) guide in order to get familiar with how we do things around here and | ||
set up your local dev environment. | ||
set up your local development environment. | ||
## Community | ||
Join the #maplibre-react-native or #maplibre Slack channels at OSMUS: get an invite at https://slack.openstreetmap.us/ | ||
Join the `#maplibre-react-native` or `#maplibre` [Slack channels at OSMUS](https://slack.openstreetmap.us/). |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14
2494852
397
22545
86
+ Added@turf/bearing@7.1.0(transitive)
+ Added@turf/destination@7.1.0(transitive)
+ Added@turf/distance@7.1.0(transitive)
+ Added@turf/invariant@7.1.0(transitive)
+ Added@turf/length@7.1.0(transitive)
+ Added@turf/line-intersect@7.1.0(transitive)
+ Added@turf/nearest-point-on-line@7.1.0(transitive)
+ Addedsweepline-intersections@1.5.0(transitive)
+ Addedtinyqueue@2.0.3(transitive)
- Removed@mapbox/geo-viewport@>=0.4.0
- Removed@turf/along@6.5.0
- Removed@types/mapbox__geo-viewport@^0.4.1
- Removed@mapbox/geo-viewport@0.5.0(transitive)
- Removed@mapbox/sphericalmercator@1.2.0(transitive)
- Removed@turf/along@6.5.0(transitive)
- Removed@turf/bbox@7.1.0(transitive)
- Removed@turf/bearing@6.5.0(transitive)
- Removed@turf/destination@6.5.0(transitive)
- Removed@turf/distance@6.5.0(transitive)
- Removed@turf/helpers@6.5.0(transitive)
- Removed@turf/invariant@6.5.0(transitive)
- Removed@turf/length@6.5.0(transitive)
- Removed@turf/line-intersect@6.5.0(transitive)
- Removed@turf/line-segment@6.5.0(transitive)
- Removed@turf/meta@6.5.0(transitive)
- Removed@turf/nearest-point-on-line@6.5.0(transitive)
- Removed@types/geojson@7946.0.8(transitive)
- Removed@types/mapbox__geo-viewport@0.4.1(transitive)
- Removedgeojson-rbush@3.2.0(transitive)
- Removedquickselect@2.0.0(transitive)
- Removedrbush@3.0.1(transitive)
Updated@turf/distance@^7.1.0
Updated@turf/helpers@^7.1.0
Updated@turf/length@^7.1.0
Updated@types/geojson@^7946.0.14
Updated@types/react@^18.2.79