Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug]: Adding LocationPuck causes onMapIdle to be called infinitely #3801

Open
PRESIDENT810 opened this issue Mar 6, 2025 · 1 comment
Open
Labels
bug 🪲 Something isn't working

Comments

@PRESIDENT810
Copy link

PRESIDENT810 commented Mar 6, 2025

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.76.6

Platform

iOS

@rnmapbox/maps version

#main

Standalone component to reproduce

import { StyleSheet, View } from 'react-native';

import React from 'react';
import Mapbox, { LocationPuck } from '@rnmapbox/maps';

Mapbox.setAccessToken('');

const App = () => {

  return (
    <View style={styles.page}>
      <View
        style={styles.container}
      >
        <Mapbox.MapView
          style={styles.map}
          onMapIdle={() => console.log('onMapIdle')}
        >
        <LocationPuck />
        </Mapbox.MapView>
      </View>
    </View>
  );
}

export default App;

const styles = StyleSheet.create({
  page: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  container: {
    height: '100%',
    width: '100%',
  },
  map: {
    flex: 1
  }
})

Observed behavior and steps to reproduce

The reproduction component above is just something I wrote to make the bot open this issue and I have no idea if that works.

You can reproduce this issue by just using the example project in this repo which is a lot easier.

In src/examples/Map/ShowRegionDidChange.js

Add this method:

  onMapIdle(state) {
    console.log("onMapIdle called")
  }

and in render() method, add <LocationPuck /> in that <MapView> component.

Follow the reproduce instructions above.
Run the example project, and go to "Show Region Did Change". When the map settles, you'll see

Image

which never stops.

Also if you add this instead:

          <LocationPuck
            puckBearing={"heading"}
            puckBearingEnabled={true}
            pulsing={{
              isEnabled: true,
              color: "teal",
              radius: 30.0,
            }}
          />

you'll see onMapIdle is never called.

Expected behavior

I would expect onMapIdle to be only called once when the map is not moving?

Notes / preliminary analysis

No response

Additional links and references

No response

@PRESIDENT810
Copy link
Author

PRESIDENT810 commented Mar 6, 2025

Could be a dup of #2902 and mapbox/mapbox-maps-android#2116

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

No branches or pull requests

1 participant