Using Maptiler for style of the map crash the app after warning
See original GitHub issueSince I can’t get map and Street style to work in my project, so now I use Maptiler style instead. I had the same issue as #1840. Maptiler style has support for Mapbox, so this workaround works until I encounter this warning message in the iOS Simulator and then the app will crash every time the view is loaded.
Mapbox warning [event]:ParseStyle [code]:-1 [message]:source must have tiles {"filePath": "virtual bool mbgl::MGLCoreLoggingObserver::onRecord(mbgl::EventSeverity, mbgl::Event, int64_t, const std::string &)", "level": "warning", "line": 27, "message": "[event]:ParseStyle [code]:-1 [message]:source must have tiles"}
I have cleared the cache deintegrate pods, and install pods again etc.
I have added hasFinishedLoadingStyle
to see if that fix the problem and then apply the Camera
and MapView
:
<MapboxGL.MapView
ref={(c) => (this._map = c)}
onLongPress={() => SheetManager.show(`map-${id}`)}
style={style.maps}
styleURL={`https://api.maptiler.com/maps/streets/style.json?key=${MAPTILER_TOKEN}`}
logoEnabled={false}
compassEnabled={false}
pitchEnabled={false}
onDidFinishLoadingMap={() => this.onDidFinishLoadingStyle()}>
{this.state.hasFinishedLoadingStyle ? (
<>
<MapboxGL.Camera
animationDuration={1000}
animationMode={'linearTo'}
zoomLevel={14}
centerCoordinate={currentLocation}
/>
<MapboxGL.MarkerView id={'marker'} coordinate={currentLocation}>
<View>
<View style={style.markerContainer}>
<View style={style.textContainer}>
<Text style={style.text}>{'Samling'}</Text>
</View>
<MapboxGL.PointAnnotation
id={'makerPoint'}
coordinate={currentLocation}
/>
<Image
source={MapBikeWhiteUnselect}
style={{
width: 42,
height: 52,
backgroundColor: 'transparent',
resizeMode: 'cover',
}}
/>
</View>
</View>
</MapboxGL.MarkerView>
</>
) : null}
</MapboxGL.MapView>
Is there a way to use the setLogCallback
to ignore the messages to avoid the app to crash?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
A brand new website interface for an even better experience!
Using Maptiler for style of the map crash the app after warning.
Read more >[ANDROID] Mapbox.UserLocation crashes my app! · Issue #233
My app uses the new <UserLocation /> inside a <MapView /> . ... Using Maptiler for style of the map crash the app...
Read more >Generalization in maps - MapTiler Support
Let's say I use Maptiler basic map and I'm trying to get the minor roads in zoom level 7+ to be visible at...
Read more >GEOlayers 3 - Page 7 - aescripts + aeplugins
I am using a Mapbox map and I get the labe data just by using your ... be automatically able to use the...
Read more >react-native-maps crash application on provider="google ...
I have an Expo app with react-native-maps and I want to set custom styles to the map like in this thread react-native-maps custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
to future readers: this issue was caused from using LineGradient in my LineLayer component.
@jjrise Might also be good to check is app has permission before using
<UserLocation />
. Found this solution: https://github.com/rnmapbox/maps/issues/233#issuecomment-522237807