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]: React Native Heatmaps Not Working and Causes Crash #3474

Open
gavinruihanyu opened this issue May 6, 2024 · 0 comments
Open

[Bug]: React Native Heatmaps Not Working and Causes Crash #3474

gavinruihanyu opened this issue May 6, 2024 · 0 comments
Labels
bug 🪲 Something isn't working

Comments

@gavinruihanyu
Copy link

gavinruihanyu commented May 6, 2024

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.74

Platform

Android

@rnmapbox/maps version

10.0.0-beta.11

Standalone component to reproduce

import React from "react";
import { Button, StyleSheet, TouchableOpacity, View, Text } from "react-native";
import Mapbox from "@rnmapbox/maps";
import { HeatmapLayer, ShapeSource, CircleLayer } from "@rnmapbox/maps";

Mapbox.setAccessToken("");

const App = () => {
  return (

<Mapbox.MapView
          styleURL="mapbox://styles/gavinruihanyu/cll3vsy9s006w01r8aptc3y9b"
          projection="globe"
          rotateEnabled={true}
          scaleBarEnabled={false}
          logoEnabled={false}
        >
          {/*Add the GeoJSON source and heatmap layer*/}
          <ShapeSource
            id="earthquakes"
            url="https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson"
          >
            {console.log("Setting up HeatmapLayer") /* THIS IS THE CULPRIT*/}
            <HeatmapLayer id="hello" sourceID="earthquakes" />
            {/* <CircleLayer
              id="earthquakeCircle"
              sourceID="earthquakes"
              style={{
                circleRadius: 4,
                circleColor: "blue",
                circleOpacity: 0.6,
              }}
            /> */}
          </ShapeSource>
        </Mapbox.MapView>
  );
}

export default App;

Observed behavior and steps to reproduce

The Behavior:
When launching an app bundled with either Metro or EAS Expo, the rendering of HeatmapLayer appears to cause the application to crash. This is happening on Android without double checking IOS.

Upon launch of the app, we initially render the globe:
image
However the application crashes immediately with no error logs or logs of any kind.
image
There does not seem to be a deletion of the running instance of the app considering that the app can still be accessed via:
image

Reproduction:
The application was both tested via bundling EAS Expo and React Native Cli Metro.
The error was only able to be reproduced in Android.
Virtualization was used for both cases. -> need to check if it crashes on an Android device

My team discovered that upon calling <HeatmapLayer id="earthquakesHeat" sourceID="earthquakes" /> we obtain the "crash". However, calling <HeatmapLayer sourceID="earthquakes" /> (without the ID param) we obtain a globe without the heatmap render. However it does not crash when there is no ID param.

Exact reproduction method:

  1. Create either an Expo EAS or a react-native Metro Project.
  2. Use any android emulator using virtualization (any chipset, all failed thus far)
  3. Run the following code mentioned above

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

@gavinruihanyu gavinruihanyu added the bug 🪲 Something isn't working label May 6, 2024
@github-actions github-actions bot closed this as completed May 6, 2024
@github-actions github-actions bot reopened this May 6, 2024
@gavinruihanyu gavinruihanyu changed the title [Bug]: React Native Heatmaps Crashes When 🆔 field is supplied [Bug]: React Native Heatmaps Causes Crash When 🆔 field is supplied May 6, 2024
@gavinruihanyu gavinruihanyu changed the title [Bug]: React Native Heatmaps Causes Crash When 🆔 field is supplied [Bug]: React Native Heatmaps Not Working and Causes Crash May 6, 2024
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

No branches or pull requests

1 participant