Questions tagged [mapbox-gl-js]

WebGL based Javascript library that renders Mapbox Vector Tiles in the browser. Not to be confused with Mapbox.js (older, Leaflet based library) or Mapbox-GL (collective term for several similar SDKs, including Android and iOS specific libraries).

A Javascript library that renders interactive maps, particularly using Mapbox Vector Tiles, using WebGL. It also supports GeoJSON, traditional raster tiles, static images and video. Mapbox-GL-JS is open source, and actively developed by Mapbox, as part of a suite of mapping APIs, including Android and iOS SDKs, and routing and geoocoding APIs.


Resources :

  1. The official documentation
  2. Mapbox Style Specification
  3. Visual Map Designer for Mapbox - [maputnik/editor]
  4. Map tile server for Mapbox GL JS - [klokantech/tileserver-gl]
  5. GitHub
2528 questions
0
votes
0 answers

Why are tiles not loading and the map not filling its parent div?

Tiles are not loading and the map not filling its parent div on all screensizes including mobile, however, when you resize the screen manually the map loads properly? All I get a small segment of the map appearing in the parent div Tried changing…
GOose
  • 1
0
votes
1 answer

Mapbox GL map not moving while dragging it

I am facing following bug when using mapbox-gl-leaflet. When I drag the map, SOMETIMES the markers move over the map. Other layers work perfectly. The problem seems related with Mapbox GL. I have tried different versions, no luck yet. Not sure…
Rashomon
  • 5,962
  • 4
  • 29
  • 67
0
votes
0 answers

How to avoid having both circles and pins displayed when zooming in Mapbox?

Here's our map We're working on a map, trying to have different renderings depending on the zoom level. at low zoom level, display circles at high zoom level, display map pins with SVG logos inside Is there any way to have them displayed at the…
0
votes
0 answers

componentWillUnmount causes mapbox gl js not to render

I am using mapbox-gl": "^2.10.0" and "react": "^18.2.0". I have a simple code in my component like so import React, { useRef, useEffect } from 'react'; import mapboxgl from 'mapbox-gl'; function Map() { const mapContainer = useRef(null); const…
codebot
  • 517
  • 8
  • 29
  • 55
0
votes
0 answers

Smooth / blur WebGL Polygons

I have some code that generates two WebGL triangles, one green and one blue, and puts them on a mapbox-gl-js map. The four coordinates are those of four European cities. Here is the code I have:
Pufferfishe
  • 139
  • 1
  • 7
0
votes
2 answers

In Mapbox GL JS, can you pass coordinates to an external GeoJSON data source?

Can you pass coordinate values as variables when trying to retreive an external GeoJSON data source? Ideally I'd like to pass something like this, but it doesn't work for me. map.addSource('geojsonpoints', { type: "geojson", data:…
0
votes
0 answers

How to automatically add roofs as polygons in Mapbox

Currently I am getting streets from the geocoding api then displying houses in that street in satelite view. Is there a way to automatically detect house roofs and automatically draw polygons over them? mapboxgl.accessToken = accessToken; …
0
votes
1 answer

Mapbox GL JS animating multiple points along separate paths, duration not consistent

I want to animate multiple points along predetermined paths on a Mapbox map. I have found this example on the Mapbox website. It animates only one point along one line: https://docs.mapbox.com/mapbox-gl-js/example/animate-point-along-route/ I also…
0
votes
0 answers

Is there a way that I can connect a polygon format (JS) to a map (HTML)

I'm trying to put a polygon format from Mapbox into the Mapbox map itself (via a Github copy for a project), and I haven't yielded any results. I did the formatting, using different files, combining them into 1 via a combiner, etc. Polygon…
Ali'sCode
  • 11
  • 1
0
votes
0 answers

How to add waipoints between others Mapbox Directions

I'm working with mapbox gl directions, I can start the map, and create the directions from point A to B, but I got a issue when I add more waypoints, if I try to move the traced route in the waypoint A.a and A.b, the result doesn't respect the array…
cesg.dav
  • 320
  • 1
  • 14
0
votes
0 answers

Need to render maps offline in a web application as my server has restricted internet access

I have created a web application and deployed it in our server. But with current norms in our company there will be restricted access to the internet. I have to render the maps without calling the MAPBOXGLJS API as it needs internet access. Please…
0
votes
1 answer

How to use match filter in Mapbox react-native-mapbox-gl

I'm getting the following error when trying to filter a SymbolLayer with match: Here's the SymbolLayer code:
0
votes
0 answers

Mapbox query Rendered Features does not return full country geometry

I'm using mapbox and turf for a project. When I click on a country I want it to go to that country and display the whole country on the screen. So if I'm zoomed into a small country like Bhutan and I click on China I want it to zoom out and go up to…
cmcnphp
  • 400
  • 1
  • 4
  • 14
0
votes
0 answers

Mapbox-gl and Supercluster: How to get access to reduce methods of supercluster instance in mapbox-gl

As I see supercluster uses like peer dependency for mapbox-gl. Mapbox provides the possibility of clustering from the box and this is thanks supercluster. Supercluster has very important method - reduce: a reduce function that merges properties of…
0
votes
1 answer

How to use a more accurate DEM in mapbox?

I want to create a 3D map that is more accurate than the standard one mapbox provides. I found a DEM of Europe called EU-DEM with a vertical accuracy of +/- 7m. Mapbox only accepts 8-bit GeoTIFFs files but EU-DEM is a 32-Bit DEM. Can this GeoTIFF…
Mez
  • 61
  • 4
1 2 3
99
100