Questions tagged [mapbox-gl]
A client-side framework for rendering web maps with implementations on native platforms utilizing OpenGL.
124
questions
0
votes
0
answers
15
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 ...
0
votes
0
answers
9
views
MapBox-GL query point on mobile
On a mobile device, when clicking on points to get info, it randomly appears.
var features = map.queryRenderedFeatures(e.point, {
layers: ['stations']
});
I guess it is a matter of ...
0
votes
0
answers
38
views
GeoJSON file doesn't plot points on MapBox in Jupyter notebook
I am running Jupyter notebook on a Databricks cluster and attempting to render a map. I tried the example from the documentation to test and it doesn't plot the points.
# Load data from sample csv
...
0
votes
0
answers
76
views
Mapbox-GL-JS case insensitive get expression
This seems like it should be obvious but I can't find an example. I want to get a color value from a geojson property but have it case-insensitive (Color, color, COLOR):
'fill-color': ['get', 'Color']
...
0
votes
0
answers
132
views
How to resolve issue with filtering layers in Mapbox?
I'm new to mapbox and having trouble with filtering the layers. The mapbox the filter object that I construct is not doing any filtering. I first construct a filter object, then use the spread ...
0
votes
2
answers
62
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=...
0
votes
1
answer
730
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. ...
0
votes
0
answers
93
views
mapa.addControl(new mapboxgl.NavigationControl()) doesn't on Angular
I'm trying to use the controls in an Angular web app with the 10 version, but I don't know why doesn't work.
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from "@angular/core&...
0
votes
0
answers
55
views
How to centering and zoom an area of interest on mapbox
I'm developing a web app where I will use Mapbox to implement all about routes. Still, the only complicated thing I see is the possible centering and zooming in a random area with more shipments.
The ...
1
vote
0
answers
492
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 ...
0
votes
1
answer
351
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:
...
1
vote
1
answer
1k
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: ...
1
vote
0
answers
70
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 ...
1
vote
0
answers
945
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-...
1
vote
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 ...
0
votes
1
answer
950
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 ...
1
vote
1
answer
438
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: &...
0
votes
1
answer
164
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 ...
3
votes
2
answers
2k
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:...
2
votes
1
answer
775
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,
...
0
votes
1
answer
1k
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
2
votes
1
answer
607
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, ...
2
votes
0
answers
299
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. ...
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?
1
vote
1
answer
453
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 ...
1
vote
1
answer
2k
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. ...
0
votes
1
answer
543
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
...
0
votes
1
answer
611
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
...
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/...
1
vote
1
answer
6k
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";
$...
2
votes
0
answers
314
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 ...
1
vote
0
answers
319
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....
0
votes
2
answers
774
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.
0
votes
1
answer
481
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
...
0
votes
1
answer
728
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 ...
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 ...
-1
votes
1
answer
446
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 ...
0
votes
1
answer
148
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.
...
2
votes
1
answer
397
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. ...
0
votes
2
answers
1k
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 (...
1
vote
0
answers
37
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
2
votes
0
answers
897
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 ...
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","{...
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')....
1
vote
1
answer
780
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 ...
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 ...
1
vote
1
answer
857
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 ...
1
vote
1
answer
657
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 ...
5
votes
0
answers
250
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....
4
votes
2
answers
9k
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("...