简体   繁体   中英

Mapbox-gl js offline mode

Is it possible to use mapbox-gl offline with Javascript ?

I read documentation and I see it's possible with iOS & android .

Yes. Mapbox-GL-JS works just fine "offline". For instance, if you have got the JS and CSS hosted locally, you can do this to initialise a map:

const map = new mapboxgl.Map({
    style: { version: 8, sources: {}, layers: [] },
    container: 'map'
}); 

But if you want to display text labels or symbols, you'll need to host your glyphs locally. And obviously any map data you want to display will have to be hosted locally too, either as GeoJSON or with some kind of vector tile server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM