Questions tagged [mapbox-gl]

A client-side map rendered with implementations in native platforms utilizing OpenGL.

Mapbox GL is an open-source framework and API being developed by Mapbox. Mapbox GL differs from Mapbox as it downloads vector map data and renders the map image on the client.

1207 questions
38
votes
7 answers

Attempting to load the view of a view controller while it is deallocating ... UIAlertController

I am building with the release version of Xcode 7.0. No storyboards, just nib files. I have a single UINavigationController created by the app delegate and initialize it with a view controller. self.window = [[UIWindow alloc]…
picciano
  • 22,341
  • 9
  • 69
  • 82
37
votes
3 answers

Mapbox-GL setStyle removes layers

I'm building a mapping web application using Mapbox-GL. It has a lot of cool features. I've set up the buttons to switch base maps (ie. satellite, terrain, etc) following the example on the Mapbox website. The problem that I am having is that when…
Gold Masta
  • 695
  • 1
  • 10
  • 22
28
votes
3 answers

How to find all layers in Mapboxgl ? Ultimately I want to show custom layer only on water and not on land

I created a custom circle layer. I want to show this layer only on water and not on land. I managed to do the opposite (ie: showing the layer on land and not on water) using below command. Refer this image for better understanding…
Prasanna Elangovan
  • 291
  • 1
  • 3
  • 6
21
votes
8 answers

How to fix canvas size in Mapbox GL?

I'm using Mapbox GL to show a map and crop a fixed size image from the center of it. It works great for a particular resolution I designed it (1920x1080) but when I started to make the page responsive where the map styles width and height changes,…
Andres
  • 6,080
  • 13
  • 60
  • 110
21
votes
7 answers

Message from debugger: Terminated due to memory issue

My app working with Geojson file. I use MapBox SDK to add MGLPolyline to map. But the problem is my file too large, so that the app crash and got the error: Message from debugger: Terminated due to memory issue. I faced with 66234 objects at first…
lee
  • 7,955
  • 8
  • 44
  • 60
20
votes
6 answers

How to close all popups programmatically in mapbox gl?

So, I know that we have Marker.togglePopup() in Mapbox GL API. But can we close all popups programmatically?
Yahor Vaziyanau
  • 345
  • 1
  • 4
  • 12
20
votes
4 answers

mapbox gl change icon color

Is there a way to change a mapbox-gl-js icon-image color? This code taken from https://www.mapbox.com/mapbox-gl-js/example/geojson-markers/ won't change the marker color to red map.addLayer({ "id": "markers", "type": "symbol", "source":…
jordi
  • 3,391
  • 2
  • 14
  • 14
20
votes
4 answers

Using Mapbox GL Offline

Is there a way to use Mapbox GL (asking about both JS and native) in an offline setting? With MBTiles, you could use either the MBTiles file or extract the raster images. I'm wondering if there's anything similar that would allow Mapbox GL to load…
Trevor
  • 301
  • 1
  • 2
  • 4
16
votes
6 answers

Possible to render react component within mapboxgl.Popup() in .setHTML or .setDOMContent?

I am wondering if it is possible to render a react component within a mapboxgl.Popup(). Something like this: componentDidMount() { new mapboxgl.Popup() .setLngLat(coordinates) .setHTML(`
${
jasonrberney
  • 161
  • 1
  • 6
16
votes
1 answer

Removing a source in mapbox gl js doesn't remove its layers

I'm trying to selectively remove a source in mapbox gl js, I'm using map.removeSource('') but nothing happens. The layers still remain on the map. I've created an example in Codepen.
Carpetfizz
  • 8,707
  • 22
  • 85
  • 146
15
votes
1 answer

Is it possible to query features that are not being displayed?

I would like to know if there is a way to query features that are not being displayed on a map. Both queryRenderedFeatures and querySourceFeatures only work when the features are being displayed on the map. I tried also to hide the features using…
thiagoxvo
  • 347
  • 2
  • 10
13
votes
1 answer

Unexpected '!' in 'worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker'

hi I'm trying to use mapbox-gl in React with this tutorial. and I'm getting this error : Unexpected '!' in 'worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker' while importing "worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker" here is my important…
Marzieh Mahdavi
  • 153
  • 1
  • 6
13
votes
1 answer

Change text color in mapbox cluster map

I am trying to change the text color in the mapbox cluster map (https://www.mapbox.com/mapbox-gl-js/example/cluster/), but I can't figure out how. Here is the relevant code piece: map.addLayer({ id: "cluster-count", type: "symbol", …
Felix
  • 987
  • 1
  • 12
  • 23
13
votes
4 answers

Mapbox GL How to create custom control?

I want to create custom control using Mapbox gl Api. I'm trying to extend Control class and add my own functionality. It doesn't seem working. I'm getting TypeError: "x" is not a constructor error in my console. Even though after extending the…
Linus
  • 149
  • 1
  • 1
  • 5
12
votes
2 answers

Remove all labels on Mapbox GL JS?

I'm using the Mapbox Dark v9 style and would like to remove all the labels. I found a list of labels here. And have tried the map.removeLayer function to remove some of them, e.g.: map.removeLayer("place_label"); As well…
cpd
  • 735
  • 2
  • 7
  • 16
1
2 3
80 81