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
1 answer

Mapbox geocoder in React

I recently made my first app on React. I had a d3 map that looks a bit old now, so I decided to switch to Mapbox. The data transmitted is a list of country names and a percentage. The goal is to visualize each country and its percentage. I wrote all…
Night18
  • 13
  • 3
0
votes
2 answers

3D Model Disappears when Zooming Out on MapBox

I have a Mapbox map that has several animated 3D-arrows that have been added to a custom layer on the map. However, whenever I zoom out too far on the map, the arrows disappear and the entire map goes white (as if a piece of white paper has been…
M. Black
  • 353
  • 1
  • 4
  • 20
0
votes
1 answer

Event scoping in custom Mapbox IControl

I want to create a Mapbox IControl object, which zooms the map in when a button in the control is clicked. This is my custom IControl class: class customControl { _map; _container; _myButton; constructor() { this._myButton =…
derhansen
  • 5,585
  • 1
  • 19
  • 29
0
votes
0 answers

Mapbox - How to properly use the Tilesets API

I am trying to update my existing tileset with new data. In postman, I sucessfully send the following; https://api.mapbox.com/tilesets/v1/sources/{{usermame}}/testing?access_token={{admin-access-token}} In the body, I have added a new line…
spreaderman
  • 918
  • 2
  • 10
  • 39
0
votes
0 answers

react mapbox gl: active item on click

I use react-mapbox-gl 5.1 and react-mapbox-gl-draw 2.0.4 const data = { features: data.map((layer) => { const { coordinates, geo_type } = layer return { geometry: { coordinates, // [32.4123131, 123131.2322] type:…
exsens
  • 9
  • 1
0
votes
1 answer

Mapbox GL JS Change the fill-color's property value based on an expression

I have a chloropleth map with a geojson data source backing it. The data set contains data for each country for two different years, with the fill color based on one of the properties in the JSON. Here is my addLayer code currently, which works…
DGoodman
  • 115
  • 1
  • 8
0
votes
0 answers

How to save Mapbox routes or requests URL in Django Model

I have an html page with a form and Mapbox. Below is a picture of what it looks like. I want the user to fill out a form and then plot a route on the map (see screenshot). Both the data of this form and the route itself were saved to the database,…
0
votes
0 answers

MapBoxGL - why does it flag my source as invalid geoJSON

I am trying to dynamically add polygons to a MapboxGL map by passing the coordinates into a funciton. Should be simple enough, but I'm having a tough time with it. Why does this work... map.addSource('zip_code', { …
0
votes
0 answers

how to zoom image equal to map zoom level in mapbox

I want to decrease the size of the image when the zoom level of the map is decrease . How can I achieve this? Here I want zoom image equal to map zoom level Thanks in advance map.value.map.on('load', () => { // Load an image from an external URL. …
Shark
  • 131
  • 6
0
votes
0 answers

How can we use Mapbox JS to filter unclassified raster using image service?

I want to filter the unclassified raster using image services based on the Legend Value of Raster(Image Service) I have tried the map.setFilter to filter the class value (Legend) of the raster using image service. But, it's not working properly.
0
votes
1 answer

GeoLocate control stopped working in Chrome on iOs

Does anyone know if something changed in Chrome on iPhones that prevents the GeoLocate control from working? My own website now just shows a spinning icon when I tap the control (I am allowing location tracking) and even the MapBox example page…
Maothor
  • 35
  • 6
0
votes
0 answers

Is it possible to give each property in Mapbox a different color based on data that we have on the property?

Is it possible in the Mapbox GL JS to set a property color for each property? For each address we know if the property is an existing customer or not, so we would like to give properties of our customers a different color then the properties that…
nicktc
  • 93
  • 1
  • 7
0
votes
1 answer

Mapbox Changing the Icon of certain locations

I am relatively new to Mapbox GL JS and I am working on a project where I find to change the color and icon of certain locations on the map. I went to Mapbox studio and was able to obtain the specific id for those locations. However, I do not know…
0
votes
1 answer

On a Mapbox map, how to keep a layer always visible, no matter the zoom level?

I have tried to understand the underlying mechanisms of the data display processing at the tile level but I have not found any literature explicit enough for me to understand how it all works. I have a simple need though: to keep a layer of symbols…
0
votes
1 answer

Edit a geojson source in mapbox and re-render layer

I have a geojson layer for extruding polygons in mapbox . A filter that at the beginning shows nothing. map.current.addSource('congeoex', { type: 'geojson', data: 'http://localhost:3000/geometries.geojson' }); …
codebot
  • 517
  • 8
  • 29
  • 55
1 2 3
99
100