Skip to main content

Questions tagged [mapbox-gl]

A client-side framework for rendering web maps with implementations on native platforms utilizing OpenGL.

Filter by
Sorted by
Tagged with
1 vote
0 answers
40 views

How to render marker for each features gotten from vector tile API in Mapbox GL JS?

I am using Mapbox GL JS in my vuetify project. I have a vector tile API. This API will return points for each tile (xyz). I use addSource and addLayer to render the features gotten from the vector ...
timewalker's user avatar
1 vote
0 answers
122 views

maplibregl/mapboxgl color transitions get lost after setPaintProperty

I want my features to smoothly transition different to colors based on its data. For this I apply a new map.setPaintProperty but then the 'fill-color-transition' property becomes lost, forever.. Some ...
user1249791's user avatar
0 votes
0 answers
110 views

Change minimum zoom level of poi-label Native Layer of Mapbox

I'm currently working on a project that requires us to utilize the "poi-label" native layer of mapbox.mapbox-streets-v8 tileset of Mapbox. Currently, I've noticed that only a few POIs from ...
Reza's user avatar
  • 1
0 votes
2 answers
70 views

Mapbox GL JS relations

I have three layers as follows; ski areas (polygons) ski lifts (ways) ski rund (ways) There is a unique ID that makes it relate back to the ski area. This is an example: ski areas (polygons) // id=...
spreaderman's user avatar
0 votes
1 answer
1k views

Implementing H3-JS in Mapbox based map to Openlayers based map

In the H3-JS example I have, it is implemented in mapbox. But I would like to integrate the H3-JS binning as part of Openlayers map instead. This is the example I want to implement in OpenLayers. ...
SharmaPN's user avatar
1 vote
0 answers
717 views

Mapbox vector tile disappears at lower zoom levels

I am currently working with self-hosted vector tiles. These tiles are hosted on S3 and rendered on the map. The zoom levels are from 0 to 10 and generally load on all levels since maxzoom has been ...
Nacho Libre's user avatar
0 votes
1 answer
681 views

Using Mapbox expressions to paint color depending on two different data fields

I'm visualizing geospatial data that has an attribute table with fields like this: id | main_type | sub_type In Mapbox GL, I can use expressions to paint the polygons according to main_type: ...
interwebjill's user avatar
1 vote
1 answer
2k 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: ...
matieva's user avatar
  • 161
1 vote
0 answers
86 views

Using QGIS to filter some levels on the Ordnance Survey boundaries data

I am working on a full UK map and I need the postcode level 1 and 2 (areas and districts) and while I have gotten the postcode level 1 data, I need the postcode level 2 (postcode districts) data that ...
johndoe's user avatar
  • 11
1 vote
0 answers
1k views

Adding 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-...
Sreejith V's user avatar
2 votes
0 answers
2k 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 ...
Muhammad Imran Siddique's user avatar
0 votes
1 answer
1k views

Add/remove radius circle after fitting map to radius with Mapbox

I am trying to add a range slider to zoom in and out of a Mapbox map to a radius in miles. I have the map and the slider working and I can sort of zoom in and out of the map by getting the bounds of ...
JulesUK's user avatar
  • 113
1 vote
1 answer
633 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: &...
Divyam Khanna's user avatar
0 votes
1 answer
184 views

Stream GPS coordinates using D3 and Mapbox

I’m currently working on a project to stream GeoJSON data using D3 and Mapbox. But, I wasn’t able to plot my data based on their types. Basically, I have three different types of GPS data, when using ...
OrangeGoGo's user avatar
3 votes
2 answers
3k views

Deleting previous mapboxgl.Popup() existing on mapbox map

Before adding new mapboxgl.Popup(), I have to delete the existing ones if there are any. My code is: const popup = new mapboxgl.Popup() .setLngLat(middleCoordinates) .setHTML(`Distance:...
Toni BCN's user avatar
  • 327
2 votes
1 answer
1k views

How to update source property "attribution" in Mapbox GL?

I am using mapbox gl library. First layer is getting added then under that layer source is getting added. like below shown : sourceObj = { type: 'raster', tiles: tileUrls, ...
Avinash Dalvi's user avatar
0 votes
1 answer
2k views

Disable popup on double click event on Mapbox GL map

How to disable 'show popup' on 'double click' (show popup only on 'single click' event) event without disabling 'zoom in' (or 'zoom out' (with Shift button))? Mapbox GL jsfiddle example
spatialhast's user avatar
  • 3,641
2 votes
1 answer
710 views

Filtering layers displayed on map only for point layers, lineString layers or polygon layers using mapbox

I tried to use setFilter method in mapbox but this method is used to filter existing layer's features depending on specific property but not filtering all layers according to geometry In other words, ...
Mahmoud Adel's user avatar
2 votes
0 answers
456 views

Understanding fonts for vector maps

I am serving a custom vector map using Tileserver GL. Everything works as expected, but I just don't want to die dump. So... there is directory called (in my case) glyphs with subdirectories like e.g. ...
Georg's user avatar
  • 1,001
3 votes
0 answers
2k views

Accessing all layers displayed on map in Mapbox

I want to access names of all layers that I display on the map using Mapbox GL with React. Is there any specific method that enables me to access that?
Mahmoud Adel's user avatar
1 vote
1 answer
613 views

How do I add a layer from another Mapbox Studio style I created?

Per the example at https://docs.mapbox.com/ios/maps/examples/runtime-toggle-layer/ I'm able to easily add a layer from one of Mapbox's pre-defined map styles (code included in first func to show ...
Stonetip's user avatar
  • 187
1 vote
1 answer
3k views

Get MapBox Marker Coordinates Dynamically

I am new to MapBox and this may be a very simple solution, what I am trying to Achieve is to get the Coordinates of the marker which pops up when I search for Any Address/Location in the Search box. ...
Prince Kadiwar's user avatar
0 votes
1 answer
658 views

mapbox setFilter on interval values

Trying to apply a map.SetFilter over points with continuous values, grouped by categories like: 0-8000 orange 8000-16000 green. 16000-30000 yellow. 30000-40000 blue. Bigger than 40000 purple As ...
user1249791's user avatar
0 votes
1 answer
763 views

Filter features outside the viewport in Mapbox

I have a huge GeoJSON file having around 100K features and I want to filter features outside the viewport. I tried multiple approach given on: https://github.com/mapbox/mapbox-gl-js/issues/8350 and ...
Dolly's user avatar
  • 121
1 vote
1 answer
3k views

Removing default map label of places in Mapbox GL JS

I've added MapBox map layer in my HTML page using following script. mapboxgl.accessToken = '***********************'; var map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/...
hillsonghimire's user avatar
1 vote
1 answer
7k views

How to display the GeoJSON from PHP on the map?

I am using MapboxGLJS. I retrieve the coordinates from my database and I put it in GeoJSON format on PHP which look like this: <?php $sql = "SELECT * FROM waypoint"; $...
Thulaksan Jayapal's user avatar
2 votes
0 answers
340 views

How to put custom icon on polygon?

This is my code to draw a polygon on map but instead on putting a circle on each point, I want to put a image (custom icon). How do I do that? var draw = new MapboxDraw({//modifier des buttons pour ...
Thulaksan Jayapal's user avatar
1 vote
0 answers
331 views

Load a cluster layer using Mapbox

I have a Tile server developed in JavaScript using express. Here you can see the code. But I would like to know if its possible to load a cluster layer created using Mapbox and tiles to cluster layer....
Javier's user avatar
  • 233
0 votes
2 answers
939 views

GZIP geojson files & Mapbox GL JS

Is there a way to serve mapbox GL gzipped geojson files? I have style.json file that pulls multiple geojson files and it is pretty heavy.
ronaron's user avatar
  • 31
0 votes
1 answer
516 views

Adding collapsible legend box to Mapbox and features no longer click-able

So, first I started with this map: https://codepen.io/melissad34/pen/mNGjKR It works exactly the way I want it to work. Then I added a collapsible sidebar: https://codepen.io/melissad34/pen/LYYrLKN ...
Melissa's user avatar
  • 165
0 votes
1 answer
804 views

How to manipulate mapbox symbol icons - MapboxGL.js

I have my own Mapbox style that I build in MapBox Studio. Now I want to allow my user to move poi_label symbols. How could I do that? I am following this example Create a draggable point and also I am ...
MJK's user avatar
  • 103
3 votes
1 answer
3k views

Mapbox GL - multiple styles and filters per layer

The intention here is to determine the proper convention for adding multiple styling rules for a single layer in 'layers' list. My impression was such that multiple layer entries would mean a call to ...
Sleep6's user avatar
  • 397
-1 votes
1 answer
540 views

Setting correct proj4 string/info using GDAL

I am going to try and be as clear as I can - because I don't exactly know what I am doing but I am trying my best. I am sure this is probably simple but I have tried for hours to figure this out. I am ...
David 's user avatar
  • 252
0 votes
1 answer
159 views

Open iFrame of Links in Map Feature Data in MapBox

I have a MapBox map of points, with a column called "iframe_link", where there's a different link for each point. I made an iframe that works for one page, but I want to open an iframe for each point. ...
nittyjee's user avatar
  • 465
3 votes
1 answer
438 views

Way to analyze size of mbtiles file or pg database to find largest objects to optimize final size

Is there a way to figure out what OSM data is taking up the most space in my final mbtiles file? For example, Connecticut is 54MB after I have made some modifications to the scripts in openmaptiles. ...
Nic Hubbard's user avatar
0 votes
2 answers
2k views

Mapbox GL Feature Manipulation

Running "mapbox-gl": "^0.53.1" I want to update the color of a layer "type": "fill-extrusion" This is not just one feature that I select, but it might be a multitude of features that are altered (...
ill's user avatar
  • 181
1 vote
0 answers
52 views

Map-box layer to zoom [closed]

I have used a sector in my Geo map using turf.sector(),and using add layers() filling the sector with colors. Now how can I add zoom option to this sector.? I want it to reduce size on zooming in
ashpixuy's user avatar
2 votes
0 answers
1k views

Blur all other area outside polygon in mapbox-gl

I am trying to create an effect like Can view it by adding feature from fiddle in http://geojson.io/#map=14/46.9597/7.1446 when added the feature in mapbox as geojson layer of mapbox-gl I am getting ...
sanket ghenand's user avatar
0 votes
1 answer
2k views

Mapbox gl expression to get match in text field

I am trying to set one of the values from feature properties to text-field depending on a property "text-field": [ "match", ["get","label"], "L1","{...
Sam Raul's user avatar
2 votes
1 answer
1k views

Change dynamically created layer's minZoom after render

I want to change the minzoom of dynamically created layer after the rendering. I tried couple of things: map.getLayer('my_custom_layer'); // this gets the layer map.getLayer('my_custom_layer')....
senty's user avatar
  • 175
1 vote
1 answer
869 views

Mapbox GL JS/Android: Draw User's 3D Vector Layer of Buildings

Here: https://docs.mapbox.com/mapbox-gl-js/example/3d-buildings/ It's possible to draw 3D buildings by taking advantage of extrusions, however the 3D vector layer source is the Mapbox's underlying ...
michael's user avatar
  • 1,809
1 vote
0 answers
2k views

How to add GeoServer WMS layer to Mapbox GL API?

I have been using GeoServer WMS layers with OpenLayers 3 and it is working well. Below is the code how I have used to add my GeoServer WMS layer to the Mapbox GL API: var mapOptions: MapboxOptions ...
karthik's user avatar
  • 21
1 vote
1 answer
1k views

Location is not accurate when replicating an existing feature and zooming in

I am trying to resolve an issue with the accuracy of a selected point using queryRenderedFeatures. The accuracy is fine when zoomed out, but when zooming in it appears off. I am using the ...
its30's user avatar
  • 567
1 vote
1 answer
695 views

How to post marker to Mapbox GL map

I'm following this tutorial about Mapbox GL and flask which has been going great until the step to add markers to the map. I've tried to distill it to make it as simple as possible but it's still not ...
hselbie's user avatar
  • 981
5 votes
0 answers
297 views

Fixing buildings that do not appear in 3D using Mapbox gl js?

I'm trying to adopt this Display buildings in 3D example, but I found out that in my city (Minsk, Belarus) some buildings look flat like this: The coordinates of this particular building are 27....
Anton's user avatar
  • 151
4 votes
2 answers
10k views

Get GeoJSON Features using Mapbox?

I'm using Mapbox to create webmapping, I want to get GeoJSON Features. I tried map.queryRenderedFeatures but it returns array empty. there are my code: map.on('load', function(e) { map.addSource("...
Faneva A's user avatar
4 votes
0 answers
428 views

WMTS with Mapbox WebGL

I need to add a WMTS to a mapping application that uses mapbox-webgl (this is a React App using react-map-gl). There is no support for WMTS in mapbox-webgl but it seems like I should be able to do ...
Shane's user avatar
  • 41
1 vote
0 answers
1k views

How to update circle-color or marker symbol on update of a source property in Mapbox GL?

I am trying to get Mapbox GL work in my React code as below: I have a property called strength in each of my features in a FeatureCollection of a mapbox-gl map. I want to display a circle (ideally a ...
Abhishek Pathak's user avatar
1 vote
0 answers
651 views

Mapbox multiple filters to layers

I'm new to Mapbox GL and want to understand how i would go about the following; I have 5 principle layers (from the same source, all vector tiles from Geoserver) which will only be drawn in ...
mapping dom's user avatar
  • 1,512
2 votes
3 answers
17k views

Set border width and color in Mapbox GL

I'm working on an application based on Mapbox GL, I need to give to the user the opportunity to set the width and the color of the borders of polygons but I can't find the right GeoJSON proprieties to ...
Emiliano S.'s user avatar