Questions tagged [mapbox-gl-js]

A WebGL JavaScript interactive maps library that can render Mapbox Vector Tiles.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Mapbox layer doesn't update on variable change | react-map-gl

I have a map with a custom layer. Right now I have a problem that when points state get updated the map doesn't rerender. How can I force a rerender of the map layer when points changes? Codesandbox: ...
user avatar
  • 51
0 votes
0 answers
24 views

Toggling Layers in Mapbox Vector Tiles from Python-based Interactive Visualization [closed]

I have been working with PyDeck and Panel as of late to explore the potential to build rich, Python-based, interactive sensemaking applications. One of my frustrations with PyDeck is not having the ...
user avatar
  • 111
0 votes
0 answers
9 views

Advanced version of zoom and property functions in MapBox-GL JS

I am using the "zoom and property" functions very well. Basically, it returns values based on zoom level and attributes' value For my special project, I needed a function that reads specific ...
user avatar
  • 942
0 votes
1 answer
26 views

Using Mapbox 'flyto' function to a polyline

I wonder whether the Mapbox GL JS 'flyto' function can be used to 'fly to' a polyline, for example a certain stretch of road/highway? If so, what is the code to do this?
user avatar
0 votes
0 answers
28 views

How do I change the camera speed in MapBox GL JS?

When you press the "up" arrow on the keyword, the camera moves "forward" with the current angle and height, etc. This makes it look sort of like a helicopter or airplane looking ...
user avatar
  • 9
3 votes
2 answers
118 views

How do I translate MapBox GL JS GPS coordinates into SWEREF 99 TM ones?

I have to deal with this: https://minkarta.lantmateriet.se/?e=493056&n=6795776&z=3&profile=karta&background=1&boundaries=false This is a URL which uses "e" and "n&...
user avatar
0 votes
0 answers
68 views

How should we display GeoPackage on Mapbox GL JS?

We used wgrib2 to convert weather radar data into NetCDF format. We converted it to GeoPackage format using gdal_translate. We created a Color Map on QGIS 3.10 and the GeoPackage appeared as expected. ...
user avatar
  • 101
0 votes
1 answer
38 views

Using several sources layers from the same tileset in Mapbox

I have a tileset where I am adding several layers, I want to call them so i can organize the order I receive it. I want first to show source layer1 and then underlaying source layer2. I have tried ...
user avatar
  • 186
0 votes
0 answers
64 views

How to add a new point at user click while modifying an existing line or polygon geometry using Mapbox-gl-draw

I would like to have an edit option for my user to edit an existing line or polygon plotted in a map. The edit option should allow user to add new vertices where user clicks. I have tried using Mapbox-...
user avatar
1 vote
1 answer
105 views

Mapbox - checkbox filters work in modal but not div

In my first map (https://codepen.io/flyinginsect2/pen/oNoQvNQ), the checkbox filters in the modal popup seem to work just fine. However, when I move the filters to a new div (https://codepen.io/...
user avatar
  • 145
0 votes
1 answer
143 views

Mapbox - combining multiple checkbox filters

I am creating a Mapbox map in which I want multiple checkboxes to create an 'and' filter on one layer. Here's the checkbox parts of my code so far: <input type="checkbox" id="srBox&...
user avatar
  • 145
0 votes
0 answers
57 views

Fit label text-size within the polygon Mapbox GL JS symbol-layer

I want to make the text-label in the symbol layer fit within the polygon. change the position and size of the text-label according to zoom and polygon. It is required for mapbox gl js. const map = new ...
user avatar
1 vote
0 answers
90 views

Projection XY with maplibre

I am using Leaflet with crs: L.CRS.Simple for a game map(XY coords) with "leaflet-rastercoords" https://github.com/commenthol/leaflet-rastercoords and want to switch to maplibre (aka Mapbox)....
user avatar
  • 233
0 votes
0 answers
29 views

How do I project GSM raster tilelayer in mapbox-gl-js if I want it to display as an overlay on my basemap if they have different EPSG?

I'm new in mapbox-gl. After persistent attempts to find information, I could not find a solution. The task is to display a layer in the EPSG:3395 coordinate system on top of the basemap mapbox-gl-js ...
user avatar
  • 1
2 votes
1 answer
303 views

Cropping specific area of map using Mapbox GL-JS

I am working on Mapbox. Is there any possible way to crop map image using Mapbox? Right now I am getting complete map as canvas but I just need to crop a specific area. The thing which I want is to ...
user avatar
  • 47
0 votes
0 answers
26 views

Can MapBox GL JS somehow be controlled with a gamepad instead of keyboard + mouse?

It strikes me as I'm screen-recording my fullscreen MapBox GL JS application, trying to make smooth and pleasant zoom-ins and rotations to "show the area" to others, as a video, that ...
user avatar
0 votes
0 answers
273 views

Updating cluster layers dynamically in Mapbox-gl-js

I use Mapbox GL JS to draw some points on the map. I also use a cluster to organize the points. My source code is almost the same as official example in their documentation. The only difference is I ...
user avatar
  • 1
0 votes
0 answers
209 views

Converting long/lat coordinates for a selected feature in Mapbox tile GeoJSON such as a road to Unreal Engine x,y coordinates

The goal is to be able to download a real-world height map, import it into Unreal as a landscape, then draw roads on that landscape based off the GeoJSON file coordinates for that road. I use this ...
user avatar
  • 101
0 votes
0 answers
38 views

OSM route inside campsite

I have a problem that I want router to route only inside campsite if starting point is inside campsite, not around campsite as the example in the image. Is there any way to do it? If it is important, ...
user avatar
  • 1
1 vote
1 answer
276 views

GeoServer vector tiles and MapBox (maplibre) gl js

I have a similar problem to this one: Mapbox Vector Tiles from Geoserver 2.11 in Mapbox GL JS I'm trying to do the same (just with maplibre-gl-js, a fork of MapBox GL js v1) and GeoServer (2.20.1) ...
user avatar
  • 51
0 votes
1 answer
174 views

Determine the coordinate system used in GeoJSON file?

I'm fairly new to geodata. I got some data (coming from mapbox api from scraping a website) with all geometry points. I'm trying to convert these points to long/lat so I can use it in my project (and ...
user avatar
0 votes
0 answers
41 views

Loading GeoJSON line geomtery layer in Mapbox not rendering properly in lower zoom levels

Tried to load a line geometry GeoJSON file from local to mapbox webmap but on lower zoom levels(5-13) line layers are not loading continuously, in higher zoom level it was working properly. Lower zoom ...
user avatar
0 votes
0 answers
65 views

How to make your MapBox GL JS map display little permanent labels rather than forcing me to hover over the balls?

I currently have the following line in my MapBox GL JS application: map.addSource('places of interest', { type: 'geojson', data: 'http://127.0.0.1/mycoolmap/geoJSON blobs/places of interest.geojson' })...
user avatar
0 votes
0 answers
17 views

Is there some way to make you able to "click to fly" in MapBox GL JS?

I know that there is a "fly to" feature, but every example I've found mentions explicit, hardcoded coordinates. I want to be able to click a few times on my map, then "start the flight&...
user avatar
1 vote
0 answers
66 views

What could explain the bizarre discrepancy in the geometry between these two 3D maps?

GPS location: 33.67619789331771, -117.68029382324094 MapBox GL JS screenshot: Google Maps screenshot: What could explain this? It should be noted that, for the places I actually know in real life, ...
user avatar
0 votes
1 answer
33 views

Interpreting unknown symbol on MapBox GL JS map

In my MapBox GL JS map, I've encountered this weird, thick line that goes all over the place: It doesn't seem to be a railroad, or a road of any kind. Possibly some kind of border marker. But I ...
user avatar
0 votes
1 answer
223 views

Mapbox popups - How to query only the top-most layer when there are multiple overlapping layers?

I have a Mapbox map with one line layer and multiple point layers, as in the screenshot below. Each has its own popup: map.on('click', function(e) { if(!e.originalEvent.defaultPrevented) { ...
user avatar
0 votes
0 answers
33 views

Older mapbox.js tilesize with non-powers of two sizes: what does that mean? (and what to do for Mapbox GL?)

I'm trying to update some (very) old mapbox.js code (0.6.7 - pre Leaflet!) to something more modern, and I'm confused about how it was handling tilesizes. The code uses Mapbox custom raster tilesets ...
user avatar
0 votes
0 answers
78 views

My Mapbox Tileset is not shown to full zoom extend (zoom 22). How can I create an overzoom for my map data, which is set at maxzoom 13?

I created a Mapbox Tileset with Map Tiling Service (MTS). In the recipe.js I set the maxzoom value of the data at 13 (1m resolution). The data is only shown till zoom level 13 and disappears at zoom ...
user avatar
1 vote
1 answer
30 views

Filtering substring from a geojson string column in Mapbox GL JS

I am trying to filter my Mapbox map based on a substring filter. I have a column called COUNTY which has strings like Kern,Ventura,Los Angeles. My current code is as follows - map.addLayer({ id: &...
user avatar
0 votes
1 answer
84 views

How to change the icon image when clicking off the symbol layer

In Mapbox, I can successfully swap marker images when clicking on a marker. However, I can't get it to change back when clicking an empty space on the map. This causes the pop-up to close, but the ...
user avatar
  • 1
0 votes
1 answer
181 views

How to generate a Mapbox Vector tile correctly?

I have a GeoJSON file that has this data { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties"...
user avatar
1 vote
0 answers
35 views

How to show attribution above Bing max zoom level where allow tile image stretching?

Currently some of location Bing provide image for stretch after crossing max zoom level 21 as per Bing metadata. Wanted to show attribution above max level where Bing tiles able to stretch it out. My ...
user avatar
0 votes
2 answers
194 views

Converting SLD to MapboxGL style

I'm struggling to convert SLD (from Qgis) to MapboxGL style format. Does anyone have any ideas if this is possible?
user avatar
  • 129
0 votes
1 answer
75 views

Why is my click region for a circle layer in Mapbox offset to the right?

I'm using mapbox gl js in a react framework to create we web map app. I have added a circle layer to the map and have a problem where the clickable mouseenter area of the circle is offset to the right....
user avatar
  • 597
0 votes
0 answers
22 views

Display a fixed title on a Mapbox JS map AND have it export with the map (to image, etc)

I've seen the posts for adding a title to the top of a Mapbox GL JS map using tags and HTML. These are great for on-screen titles, but they don't export with the map when using map.getCanvas()....
user avatar
0 votes
1 answer
129 views

How to fetch all features, not just within the visible extent, using MapBox Studio hosted data?

I uploaded a GeoJSON Dataset to MapBox Studio, then converted it into a Tileset. I'm displaying this in a MapBox GL-JS map: map.addSource('regionsSource', { type: 'vector', url: 'mapbox://username....
user avatar
  • 20.5k
1 vote
1 answer
177 views

What is the mathematical relationship between Radius (meters) and the Zoom level of the map?

I've created an HeatMap (using mapbox-gl) and I want to achive a behaviour similar to Snapchat, I mean every time you press on Shape you get the coordinates of your tap and from here I want to get all ...
user avatar
1 vote
1 answer
93 views

Georeference DXF file which don't has any SRS assigned

I have a DXF file which I converted from DWG (CAD) file. I convert it GeoJSON using ogr2ogr but the output coordinates are out range of WGS 84. I think it's been assigned with the random coordinates. ...
user avatar
1 vote
0 answers
86 views

How to adjust opacity in Mapbox choropleth plot?

In Mapbox choropleth plots, is it possible to have no shade (i.e., transparent) if the value is less than a threshold? For example, for a variable ranging between 0 to 1, if the value is less than 0....
user avatar
  • 375
0 votes
1 answer
23 views

How do I make it possible to control the camera in Mapbox GL JS like a 16-bit JRPG airship?

This is me controlling the camera in Mapbox GL JS with the arrow keys on the keyboard: https://streamable.com/e/orhkbu?autoplay=1 As you can tell, it doesn't look nor feel very good. Not even any ...
user avatar
0 votes
0 answers
154 views

Mapbox 3D building layer does not have 'height' property and all buildings are flat

mapbox-gl-js version: 2.4.1 source I am trying to get 3D buildings in Mapbox, but they are just flat, I added code to get the feature when I click on them and they have no height property, which is ...
user avatar
0 votes
0 answers
62 views

Getting a pop-up menu with GPS coords in Mapbox GL JS

In MapBox GL JS, how to make it so that you can right-click the map and get a little pop-up menu/div with the GPS coordinates? With Leaflet.js, it was (relatively) easy: theMap.on('contextmenu', ...
user avatar
1 vote
1 answer
86 views

Clustered static map from Mapbox

I'm trying to extract static maps using Mapbox's Static Images API. The goal is to embed these images into an HTML page/email etc. Here is a sample that I was able to generate successfully which is at ...
user avatar
1 vote
1 answer
2k views

Enable a 3D sphere/globe in MapBox GL JS, just like Google Maps does it?

MapBox GL JS looks very close to Google Maps (in 3D mode) up-close, but if you zoom out enough, the world just looks like an endlessly repeating strip of flat 2D world maps, like this: If you zoom ...
user avatar
0 votes
0 answers
61 views

Is there some way to get "smooth" terrain in MapBox GL JS?

I have successfully added "terrain" to my little MapBox GL JS world, but it looks strange to say the least. I understand that it cannot have data for every little atom (or even square ...
user avatar
0 votes
0 answers
20 views

Combining interactive features from two different Mapbox GL JS scripts

I'm interested in making a map that shows values of features on a map when the mouse hovers over a feature, and also making different GIS layers toggle on and off. Luckily, there exists a Mapbox ...
user avatar
  • 491
0 votes
0 answers
38 views

Using several Mapbox styles within a webapp

I am trying to find information about Mapbox and the styles in Mapbox studio, but I couldn't find nothing which answer my question exactly. I have several layers which my idea is group them in ...
user avatar
  • 186
1 vote
1 answer
173 views

Multiple Criteria in Mapbox Expressions

I am trying to determine method of stying across a data range using 'get' expression and multiple criteria in Mapbox Studio using Mapbox Expressions. In the example below I want to style a marker ...
user avatar
0 votes
1 answer
495 views

Adding data-driven elevation to Mapbox GL JS fill-extrusion-height

I can't quite figure out how to extract elevation data from a geojson to use with Mapbox fill-extrusion-height. The geojson looks like this but obviously with a lot more waypoints: { "type&...
user avatar

1
2 3 4 5
7