rnmapbox / rnmapbox/maps

[Bug]: CompassImage not working

Open
#4,170 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug 🪲
Dominant language
Kotlin
Stars
2.9k
Forks
947
Avg merge
6d 37m
Merged PRs (30d)
1

Description

Mapbox Version

default

React Native Version

0.81.4

Platform

Android

@rnmapbox/maps version

10.1.44

Standalone component to reproduce
import React from 'react';
import {
  MapView,
  Camera,
  Images,
} 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}} 
        compassEnabled={true}
        compassImage={'compassHeading'}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <Images
          images={{
            compassHeading: 'https://cdn-icons-png.freepik.com/512/14979/14979943.png', // example image, in my code I used a require(...)
          }}
        />
      </MapView>
    );
  }
}
Observed behavior and steps to reproduce

Compass did not render correctly

Expected behavior

Compass to assume the image I assigned for it.

Notes / preliminary analysis

I have no error nor warning on this. I have read some issues that mention something like this but only found #2402

It is from 2022, any update on this matter?

Additional links and references

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the standalone Android reproduction with React Native 0.81.4 and @rnmapbox/maps 10.1.44, then compare the CompassImage behavior with issue #2402. The work is done when the custom image supplied through the Images component renders as the map compass without errors or warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.