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.

Wrong position of MarkerView

See original GitHub issue

Environment

  • Mapbox (GL) implementation: v10
  • Mapbox (GL) version: 10.7.0
  • @rnmapbox/maps Version #main
  • Platform: iOS
  • React Native Version 0.69.4
  • Platform OS: iOS 15
  • Device: iPhone X
  • Emulator/ Simulator: simulator and physical device
  • Dev OS: macOS Monterey 12

Standalone component to reproduce

import React from 'react';
import { View } from 'react-native';
import {
  MapView,
  ShapeSource,
  Camera,
  CircleLayer,
  MarkerView,
} from '@rnmapbox/maps';

const coordinate = [30.319378097536216, 59.879647222152855];

const BugReport = () => (
  <MapView style={{ flex: 1 }}>
    <Camera
      defaultSettings={{
        centerCoordinate: coordinate,
        zoomLevel: 16,
      }}
    />
    <ShapeSource
      id='point'
      shape={{
        type: 'Point',
        coordinates: coordinate,
      }}
    >
      <CircleLayer
        id='circle'
        style={{ circleRadius: 10, circleColor: 'black' }}
      />
    </ShapeSource>
    <MarkerView id='marker' coordinate={coordinate}>
      <View
        style={{
          width: 60,
          height: 60,
          borderRadius: 30,
          backgroundColor: 'rgba(255,0,0,0.5)',
        }}
      />
    </MarkerView>
  </MapView>
);

Observed behavior and steps to reproduce

Expected behavior

Notes / preliminary analysis

PointAnnotation displays perfectly

I think it’s because initialized with wrong bounds (should be 60 instead of 375)

Screenshot 2022-08-11 at 10 56 51

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
michaekcommented, Sep 1, 2022

Since there is an example that reproduces the issue against the current HEAD, it seems that this issue should be reopened.

2reactions
michaekcommented, Sep 20, 2022

I don’t think I’ll be able to test anytime soon, but there’s a good possibility that #2203 has resolved this issue. Maybe someone who’s reproduced this issue prior to that changeset could verify?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The last MarkerView x-position is wrong. · Issue #2832 - GitHub
My requirement is The actual result is The ONLY last MarkerView x-position is wrong. Here is my MarkerView class: public class ...
Read more >
MarkerView goes out of the chart for the last point on the chart
I have found a simple solution to this issue. You need to set chart in your custom marker view as below: setChartView(chart);.
Read more >
Overview | Maps JavaScript API - Google Developers
With Advanced Markers, you can customize the default marker's background, border, and glyph color, adjust marker size, and replace the default marker icon...
Read more >
Work with markers in Mapbox.js | Help
In this guide, we'll show how to add markers, customize them, and make them interactive with Mapbox.js. Think of this guide as a...
Read more >
Introduction to React Native Maps - LogRocket Blog
Having accurate information about your users' location is a great way ... android:name="org.apache.http.legacy" android:required="false"/> ...
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