Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: iOS: Can only change pitch or heading via setCamera when centerCoordinate is specified #3413

Closed
bradstiff opened this issue Mar 9, 2024 · 0 comments · Fixed by #3415
Labels
bug 🪲 Something isn't working

Comments

@bradstiff
Copy link

Mapbox Implementation

Mapbox

Mapbox Version

defaykt

React Native Version

0.73.5

Platform

iOS

@rnmapbox/maps version

10.1.13

Standalone component to reproduce

import React, { useRef, useEffect } from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

const BugReportExample = () => {
  const cameraRef = useRef();
  useEffect(() => {
    setTimeout(() => cameraRef.current?.setCamera({ heading: 90 }), 2000);
  }, []);
  return (
    <MapView style={{ flex: 1 }}>
      <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} ref={cameraRef} />
      <ShapeSource id="idStreetLayer" shape={aLine}>
        <LineLayer id="idStreetLayer" />
      </ShapeSource>
    </MapView>
  );
}

Observed behavior and steps to reproduce

The following camera specifications don't work on iOS, starting with version 10.1.13:

  • cameraRef.current?.setCamera({ heading: 90 })
  • cameraRef.current?.setCamera({ pitch: 45 })

They both work when a centerCoordinate is also specified.

Expected behavior

The above camera specifications should work without centerCoordinate being specified.

It works on Android.

It used to work on iOS until version 10.1.13.

Notes / preliminary analysis

No response

Additional links and references

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant