How to use @mapbox/mapbox-gl-native - 1 common examples

To help you get started, we’ve selected a few @mapbox/mapbox-gl-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github consbio / mbgl-renderer / src / render.js View on Github external
default: {
                            // NOT HANDLED!
                            throw new Error(
                                `ERROR: Request kind not handled: ${kind}`
                            )
                        }
                    }
                } catch (err) {
                    console.error('Error while making tile request: %j', err)
                    callback(err)
                }
            },
            ratio,
        }

        const map = new mbgl.Map(mapOptions)
        map.load(style)

        map.render(
            {
                zoom,
                center,
                height,
                width,
                bearing,
                pitch,
            },
            (err, buffer) => {
                if (err) {
                    console.error('Error rendering map')
                    console.error(err)
                    return reject(err)

@mapbox/mapbox-gl-native

Renders map tiles with Mapbox GL

BSD-2-Clause
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular @mapbox/mapbox-gl-native functions