Closed eraysezginer closed 6 years ago
See README: OfflineMap returns a promise, not a map directly. Try this:
var map = new mapboxgl.Map({
container: 'map',
style: 'styles/osm-bright/style-offline.json',
center: [2.15, 41.38],
zoom: 8
}).then(function(map) {
var marker = new mapboxgl.Marker()
.setLngLat([2.15, 41.38])
.addTo(map);
})
Hello,
I try to use simple marker (and other kind of mapbox features like LineString) but it's not showing on the map.Here is the code ;
But when I switch to online version with same code (OfflineMap-->Map) it works and shows the marker ;
What could be the reason, any idea?
Thank you