Questions tagged [mapbox]

Mapbox is a location data platform for mobile and web applications. They provide building blocks to add location-based features such as maps, search, and navigation into any experience you create.

Mapbox is built on a platform of live-updating global data. Their secure data pipeline processes over 250 million miles of anonymized traffic data per day. Through apps powered by Mapbox, including Bosch, Snap, Lonely Planet, Tableau, Red Bull, DoorDash, The Weather Channel, and Hotels.com, they reach more than 520 million people each month.

Mapbox was born out of Development Seed and the necessity to build new tools and platforms for positive impact projects including those with The World Bank, United Nations, The Red Cross and other NGO and not-for-profit organizations. Since 2010, they have quickly expanded their offering of mapping and location-based APIs and SDKs to offer many tools for developers who want to build with maps.

Developer documentation and resources:

Troubleshooting:

Related tags:

6499 questions
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
0 answers

Showing Direction Arrow on Line in Mapboxgl

Trying to show a arrow as indication of direction in mapboxgl. The arrow is only visible at high zoom and is not visible at low zooms. Adding a image Layer with 'symbol-placement': 'line' Line Layer map.addLayer({ 'id': 'route', …
vito
  • 473
  • 1
  • 7
  • 17
16
votes
3 answers

Mapbox-gl typing won't allow accessToken assignment

I'm using the mapbox-gl library with TypeScript, and I've installed its community sourced type definitions with @types/mapbox-gl. When I try to import and set an accessToken to use the library, my TypeScript compiler throws this error: TS2540:…
kyleburke
  • 269
  • 4
  • 8
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
2 answers

How to set the reduce options with Mapbox's clusters?

I'm POC-ing clusters with Mabpox-gl-js v0.45. I would like to customize my cluster's properties (actual default values are point_count and point_count_abbreviated). Each of my points (one for each city) have a surface property (an integer) which I…
Fractaliste
  • 5,777
  • 11
  • 42
  • 86
15
votes
2 answers

Mapbox event listener

I've added custom buttons to my MapBox map and they shop up correctly. However when I add a click listener it does not work. I see no error in my console. The code looks like this: const currentLocationControl = new…
Jenssen
  • 1,801
  • 4
  • 38
  • 72
15
votes
3 answers

How to set the zIndex layer order for geoJson layers?

I would like to have certain layers to be always on top of others, no matter in which order they are added to the map. I am aware of bringToFront(), but it does not meet my requirements. I would like to set the zIndex dynamically based on…
bob
  • 311
  • 1
  • 3
  • 6
14
votes
1 answer

How to draw polyline over map in apple watchOS

We have tried with apple map but apple map SDK does not allow us to draw polyline over the map so we have seen one application that is doing a similar thing using MapBox SDK. But unfortunately, Mapbox official documentation does not provide any…
Pradeep
  • 563
  • 1
  • 3
  • 16
14
votes
2 answers

Flutter: Map with image overlay

I'm actually working on a web project where a Map (Leaflet) is displayed with an image in overlay. On the web application, the user is able to move the image to match exactly the fingerprint of the building on the Leaflet map. Once the image is…
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
14
votes
1 answer

How to use Leaflet Map for free?

Leaflet is open source and free. However the examples on leaflet site use Mapbox to render map. Mapbox is more expensive than Google map (Mapbox pricing). The question is: can anyone use Leaflet really free?
Tony
  • 603
  • 5
  • 9
  • 17
14
votes
2 answers

Mapbox Android determine zoom level that contain all markers

Is there a way to determine a zoom level so that all of my markers can fit in the zoom level? i am using mapbox 0.4.0 I think the answer is similar to this, but I can't find the android…
stephen1706
  • 1,010
  • 11
  • 22
13
votes
4 answers

Missing MapBox CSS using React

I'm trying to work with MapBox using React. I've created the project with create-react-app, added mapbox-gl ("mapbox-gl": "^0.46.0-beta.1"), but I have a problem with css file. It shows me this warning: This page appears to be missing CSS…
Javier
  • 1,975
  • 3
  • 24
  • 46
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
2 answers

Custom Drawing on Mapbox Map Canvas

I would like to be able to manually draw complex shapes on a mapbox map using the android sdk. I have inherited the map view class and overridden the ondraw event but unfortunately whatever I draw gets over drawn by the map itself. As an example I…
Reafidy
  • 8,240
  • 5
  • 51
  • 83
13
votes
2 answers

Street labels in Mapbox Tile Layer too small

I have the following Leaflet map: JSFiddle link