mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

Application crashes when adding a heatmap layer type #14807

Closed captainbarbosa closed 5 years ago

captainbarbosa commented 5 years ago

Steps to reproduce

  1. Create a heatmap layer and add it to a map view after the style has finished loading:
func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {
    // Parse GeoJSON data. This example uses all M1.0+ earthquakes from 12/22/15 to 1/21/16 as logged by USGS' Earthquake hazards program.
    guard let url = URL(string: "https://www.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson") else { return }
    let source = MGLShapeSource(identifier: "earthquakes", url: url, options: nil)
    style.addSource(source)

    // Create a heatmap layer.
    let heatmapLayer = MGLHeatmapStyleLayer(identifier: "earthquakes", source: source)
    style.addLayer(heatmapLayer)
}

Full minimal test case can be found here.

  1. Try to run this code in an application and observe crash.

Expected behavior

Actual behavior

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error

Configuration

Mapbox SDK versions: v5.1.0-alpha.1 iOS/macOS versions: 10.14.4 Device/simulator models: iPhone X, physical device Xcode version: 10.2.1

long1eu commented 5 years ago

I'm getting this issue in 5.2. Any workaround?

zholmes1 commented 3 years ago

@long1eu Did you ever find a solution? I'm encountering this issue when I add a heatmap on iOS only. Android works fine, I'm using the react-native version of this library (current react native version uses the 5.9.0 iOS SDK)

long1eu commented 3 years ago

unfortunately not

zholmes1 commented 3 years ago

unfortunately not

Gotcha. Thanks for the quick reply!