Questions tagged [mapbox-gl]
A client-side framework for rendering web maps with implementations on native platforms utilizing OpenGL.
117
questions
0
votes
0
answers
29
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: ...
0
votes
0
answers
23
views
Adding a lot of georeferenced images makes mapbox very slow
I have a map for which I have to add a lot of (about 150) images on a map.
I've seen their example Add a raster image to a map layer, which shows that you need to add a source with coordinates, then ...
1
vote
0
answers
36
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 ...
0
votes
0
answers
84
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
152
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 ...
0
votes
0
answers
42
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 ...
0
votes
0
answers
83
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 ...
1
vote
1
answer
31
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
82
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
458
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:...
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 ...
2
votes
1
answer
159
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
0
answers
41
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 ...
0
votes
1
answer
397
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
257
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, ...
1
vote
0
answers
111
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. ...
2
votes
0
answers
442
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
132
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
1k
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
208
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
376
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
2k
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
4k
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
143
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
237
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
478
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
375
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
504
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 ...
1
vote
1
answer
2k
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
301
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
69
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.
...
1
vote
1
answer
287
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
773
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
15
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
1
vote
0
answers
593
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
1k
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
548
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
582
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
511
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
550
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
175
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
6k
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("...
2
votes
0
answers
333
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 ...
1
vote
0
answers
930
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 ...
1
vote
0
answers
475
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 ...
1
vote
1
answer
9k
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 ...
2
votes
1
answer
1k
views
Can I use a browser's developer tools to see the zoom level of current map in browser?
What I'm looking for
Where a map is being served by Mapbox in my browser is there anywhere within the Chrome/Firefox Developer Tools where it shows the current zoom level as displayed on screen?
...
0
votes
1
answer
698
views
Mapbox GL JS Toggle Layers default to "off"
Using Mapbox's 'Toggle Layer' example, how would I load the map with the "contours" and "museums" layers turned off?
I want the layers to be turned "off" by default and have the user turn "on" the ...
0
votes
1
answer
1k
views
Mapbox GL JS - toggling 2 layers
I'm using Mapbox's Show and Hide Layer example where the user can toggle on/off layers, but seem to be running into an issue I can't pinpoint.
What I did
In Mapbox's example, I replace the first ...