question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug][MapboxV10] - Expo SDK45: Compass position and fade not working

See original GitHub issue

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

Android

@rnmapbox/maps version

^10.0.0-beta.57

Standalone component to reproduce

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

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

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}} styleJSON={styleJSON}
                animated={true}
                zoomEnabled={true}
                rotateEnabled={true}
                scrollEnabled={true}
                pitchEnabled={true}
                compassEnabled={true}
                compassFadeWhenNorth={false}
                compassPosition={{ top: 80, right: 80 }}
                logoEnabled>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

Hi,

When trying to change the position of the compass, it gets stuck at the top right. Same for the compassFadeWhenNorth props which is always true.

Thx, Cyril

Expected behavior

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

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

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}} styleJSON={styleJSON}
                animated={true}
                zoomEnabled={true}
                rotateEnabled={true}
                scrollEnabled={true}
                pitchEnabled={true}
                compassEnabled={true}
                compassFadeWhenNorth={false}
                compassPosition={{ top: 80, right: 80 }}
                logoEnabled>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Notes / preliminary analysis

No response

Additional links and references

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
emendo-webcommented, Nov 23, 2022

Hi,

I tested with 10.0.0-beta.59 and I still the same problem. The props compassPosition don’t change the position.

Only compassViewPosition and compassViewMargins props working

Thx, Cyril

0reactions
emendo-webcommented, Nov 24, 2022

Solution finded.

With expo you need to set plugin in app.config.js (Not tested with typescript). in plugins array.

If you set the plugins in your app.json you don’t use V10

Only compass rotation is not refresh now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrate to v10 | Maps SDK | iOS - Mapbox docs
The Mapbox Maps SDK v10 introduces improvements to how Mapbox works on iOS platforms, as well as changes to how developers use the...
Read more >
Compass is not showing in "edge-to-edge" mode #1295
You can experiment by grabbing my fork, building, and then launching the "Display the use's location" sample. For comparison, here is a video...
Read more >
Camera animation not working when map is touched
I would like to perform a long press on the map and as soon as the long press is detected, move the center...
Read more >
Untitled
Xps 13 developer edition docking station, School bus tiny house big living! ... Problem management process objectives, Banquette d'angle bar, Omkt llc, ...
Read more >
frequent-ids - CodaLab Worksheets
... 2037 tags 2031 promo 2031 44 2021 45 2019 grid 2016 maincontent 2016 help ... 807 132 eur 132 issues 132 reservation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found