Skip to content

Commit

Permalink
refactor!: deprecate Camera#onUserTrackingModeChange, and RNMapboxMap…
Browse files Browse the repository at this point in the history
…sUseV11 (rnmapbox#3224)
  • Loading branch information
mfazekas authored Dec 1, 2023
1 parent 9a2b9ac commit 94fc4eb
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ const styles = StyleSheet.create({
- [Callout](/docs/Callout.md)
- [Camera](docs/Camera.md)
- [UserLocation](docs/UserLocation.md)
- [LocaitonPuck](docs/LocationPuck.md)
- [Images](docs/Images.md)
- [Image](docs/Image.md)
- [Models](docs/Models.md)

### Sources

Expand All @@ -204,6 +206,7 @@ const styles = StyleSheet.create({
- [SymbolLayer](/docs/SymbolLayer.md)
- [HeatmapLayer](/docs/HeatmapLayer.md)
- [SkyLayer](/docs/SkyLayer.md)
- [ModelLayer](/docs/ModelLayer.md)

### Terrain

Expand Down
1 change: 1 addition & 0 deletions docs/Camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ configuration. (Not yet implemented.)
func
```
Executes when user tracking mode changes.
@deprecated use Viewport#onStatusChanged instead.
*signature:*`(event:MapboxGLEvent) => void`
Expand Down
147 changes: 147 additions & 0 deletions docs/LocationPuck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<!-- This file was autogenerated from LocationPuck.tsx do not modify -->



```tsx
import { LocationPuck } from '@rnmapbox/maps';

LocationPuck

```
Renders a puck on the map that shows the device's current location.

## props


### androidRenderMode

```tsx
'normal' | 'compass' | 'gps'
```
Android render mode.

- normal: just a circle
- compass: triangle with heading
- gps: large arrow

@deprecated use `puckBearing` for source and `bearingImage` for image
@platform android



### puckBearing

```tsx
'heading' | 'course'
```
The bearing of the puck.

- heading: Orients the puck to match the direction in which the device is facing.
- course: Orients the puck to match the direction in which the device is moving.



### puckBearingEnabled

```tsx
boolean
```
Whether the puck rotates to track the bearing source.



### iosShowsUserHeadingIndicator

```tsx
boolean
```
iOS only. A Boolean value indicating whether the user location annotation may display a permanent heading indicator.

@platform ios
@deprecated use `puckBearingEnabled={true} puckBrearing="heading"` instead



### topImage

```tsx
string
```
The name of image to use as the top layer for the location indicator. Images component should define this image.

[Custom Native UserLocation](../examples/UserLocation/CustomNativeUserLocation)

### bearingImage

```tsx
string
```
The name of image to use as the middle layer for the location indicator. Images component should define this image.



### shadowImage

```tsx
string
```
The name of image to use as the background for the location indicator. Images component should define this image.



### scale

```tsx
T | Expression
```
The size of the images, as a scale factor applied to the size of the specified image. Supports expressions based on zoom.

@example
["interpolate",["linear"], ["zoom"], 10.0, 1.0, 20.0, 4.0]]
@example
2.0

[Custom Native UserLocation](../examples/UserLocation/CustomNativeUserLocation)

### pulsing

```tsx
| {
/**
* Flag determining whether the pulsing circle animation.
*/
isEnabled?: boolean;

/**
* The color of the pulsing circle.
*/
color?: number | ColorValue;

/**
* Circle radius configuration for the pulsing circle animation.
* - accuracy: Pulsing circle animates with the `horizontalAccuracy` form the latest puck location.
* - number: Pulsing circle should animate with the constant radius.
*/
radius?: 'accuracy' | number;
}
| 'default'
```
The configration parameters for sonar-like pulsing circle animation shown around the 2D puck.



### visible

```tsx
boolean
```
Whether location icon is visible, defaults to true









2 changes: 1 addition & 1 deletion docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@
"funcSignature": "(event:MapboxGLEvent) => void"
},
"default": "none",
"description": "Executes when user tracking mode changes.\n*signature:*`(event:MapboxGLEvent) => void`"
"description": "Executes when user tracking mode changes.\n@deprecated use Viewport#onStatusChanged instead.\n*signature:*`(event:MapboxGLEvent) => void`"
}
],
"fileNameWithExt": "Camera.tsx",
Expand Down
2 changes: 0 additions & 2 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ prepare_react_native_project!

$RNMapboxMapsImpl = 'mapbox'
if ENV['RNMBX11']
$RNMapboxMapsUseV11 = true # use 11 version
$RNMapboxMapsVersion = '= 11.0.0'
end

Expand All @@ -21,7 +20,6 @@ if ENV['CI_MAP_IMPL']
$RNMapboxMapsImpl = 'mapbox'
when 'mapbox11'
$RNMapboxMapsImpl = 'mapbox'
$RNMapboxMapsUseV11 = true # use 11 version
$RNMapboxMapsVersion = '= 11.0.0'
else
fail "Invalid CI_MAP_IMPL value: #{ENV['CI_MAP_IMPL']}"
Expand Down
13 changes: 12 additions & 1 deletion rnmapbox-maps.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ else
fail "$RNMapboxMapsImpl should be one of mapbox"
end

if $RNMapboxMapsUseV11 != nil
warn "WARNING: $RNMapboxMapsUseV11 is deprecated just set $RNMapboxMapsVersion to '= 11.0.0"
end

if $MapboxImplVersion =~ /(~>|>=|=|>)?\S*11\./
$RNMapboxMapsUseV11 = true
end


$RNMapboxMaps = Object.new

def $RNMapboxMaps._check_no_mapbox_spm(project)
Expand Down Expand Up @@ -125,7 +134,9 @@ rescue
end

def $RNMapboxMaps.post_install(installer)
if $RNMapboxMapsUseV11
map_pod = installer.pod_targets.find {|p| p.name == "MapboxMaps" }
use_v11 = $RNMapboxMapsUseV11 || (map_pod && map_pod.version.split('.')[0].to_i >= 11)
if use_v11
installer.pods_project.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-D RNMBX_11']
end
Expand Down
8 changes: 7 additions & 1 deletion src/components/Camera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,19 @@ export interface CameraProps
CameraMinMaxConfig {
/** The configuration that the camera falls back on, if no other values are specified. */
defaultSettings?: CameraStop;

/** Whether the camera should send any configuration to the native module. Prevents unnecessary tile
* fetching and improves performance when the map is not visible. Defaults to `true`. */
allowUpdates?: boolean;

/** Any arbitrary primitive value that, when changed, causes the camera to retry moving to its target
* configuration. (Not yet implemented.) */
triggerKey?: string | number;
/** Executes when user tracking mode changes. */

/**
* Executes when user tracking mode changes.
* @deprecated use Viewport#onStatusChanged instead.
*/
onUserTrackingModeChange?: UserTrackingModeChangeCallback;
}

Expand Down

0 comments on commit 94fc4eb

Please sign in to comment.