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

Mapbox error Exception in onDidFinishLoadingStyle #404

Open
ErTurco opened this issue Jun 12, 2024 · 6 comments
Open

Mapbox error Exception in onDidFinishLoadingStyle #404

ErTurco opened this issue Jun 12, 2024 · 6 comments

Comments

@ErTurco
Copy link

ErTurco commented Jun 12, 2024

Steps to Trigger Behavior

  1. Execute attached code

Expected Behavior

Map should be visible on Android device without crash

Actual Behavior

The app returns error on Android device (works fine on iOS device)

Mapbox error Exception in onDidFinishLoadingStyle {"level": "error", "message": "Exception in onDidFinishLoadingStyle", "tag": "Mbgl-MapChangeReceiver"}

Screenshots (if applicable)

Screen taken on iOS device
photo1718180140

Version(s) affected

  • Platform: Android
  • OS version: Android 14
  • Device type: Samsung Galaxy A54 5G
  • Emulator/ Simulator: No
  • Development OS: MacOS Sonoma 14.5
  • maplibre-react-native Version: 10.0.0-alpha.4
  • React Native Version 0.74.2

Additional context

import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import MapLibreGL from '@maplibre/maplibre-react-native';

MapLibreGL.setAccessToken(null);

const styles = StyleSheet.create({
  page: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  map: {
    flex: 1,
    alignSelf: 'stretch',
  },
});

export default class App extends Component {
  render() {
    return (
      <View style={styles.page}>
        <MapLibreGL.MapView
          style={styles.map}>
            <MapLibreGL.Camera centerCoordinate={[-87.622088, 41.878781]} zoomLevel={10}/>
            <MapLibreGL.VectorSource
              tileUrlTemplates={[
                'https://tiles.mapillary.com/maps/vtp/mly1_public/2/{z}/{x}/{y}?access_token=<TOKEN>,
              ]}
              maxZoomLevel={12}>
                <MapLibreGL.LineLayer
                id="mapillary-lines"
                sourceLayerID="sequence"
                style={{
                  lineCap: 'round',
                  lineJoin: 'round',
                  lineOpacity: 0.6,
                  lineColor: 'rgb(53, 175, 109)',
                  lineWidth: 2.0,
                }} />
            </MapLibreGL.VectorSource>
        </MapLibreGL.MapView>
      </View>
    );
  }
}
@tyrauber
Copy link
Collaborator

@ErTurco, Thanks for the bug report. FYI: Might want to rotate that access_token.

@mohanedmoh
Copy link

@ErTurco there is still history version of the comment with the token on it, I think you need to remove the comment and add it again without the token

@ErTurco
Copy link
Author

ErTurco commented Jun 24, 2024

@ErTurco there is still history version of the comment with the token on it, I think you need to remove the comment and add it again without the token

I can't delete the comment

@mohanedmoh
Copy link

you may need to remove the issue and reopen it, or change your token from mapbox

@ErTurco
Copy link
Author

ErTurco commented Jun 24, 2024

I can't delete the issue, in the actions I don't have delete but just edit.

@ErTurco
Copy link
Author

ErTurco commented Jun 25, 2024

I remembered that I took the URL (with token) for the tiles from the public example: https://docs.mapbox.com/mapbox-gl-js/example/third-party/, a Mapbox public page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants