Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [mapbox-gl-js]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
447 views

Popups offset from points Mapbox GL JS

I've been playing a lot with mapbox for mapping some data of mine. I have created a map that is heavily borrowed from the original mapbox sweetgreen tutorial here. However, now that I am almost ...
1
vote
1answer
50 views

How do you 'incrementally' create vector tiles?

I am serving my own vector tile layer. In my current setup when a point of interest is added by a user it is stored in PostGis and the relevant zoomtiles are reproduced and written over the previous ...
0
votes
1answer
40 views

mapboxgl applying map.setFeatureState to a group of vector-tiles filtered features

Doing some tests, trying to let user click on a COUNTY and all counties belonging to STATE x get highlighted. You can see running here var map = new mapboxgl.Map({ container: 'map', ...
0
votes
0answers
8 views

Updating GeoJSON properties onPress Event

I'm new to Mapbox GL and I am creating an indoor map using react native that consist of parking slots with a green or red color based on the properties of the JSON file. The question is how to ...
0
votes
1answer
22 views

Mapbox - referencing a layer added in Studio in GL JS

I know this is a pretty basic question, but I'm fairly new with JavaScript and Mapbox. I have a map that I created in Mapbox Studio. Now I'm using GL JS to create an interactive map for my website. I ...
0
votes
3answers
2k views

Mapbox Feature icon-rotate as symbol

I have a requirement to enable a user to Rotate a single feature they've added to the map. The feature is part of a geojson FeatureCollection and styled as a symbol with layout properties. Obviously ...
1
vote
1answer
89 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 ...
0
votes
1answer
38 views

How to use Mapbox geocoder in OpenLayers application?

I want to use Mapbox geocoding services in OpenLayers 5 project. I'm using this method https://github.com/jonataswalker/ol-geocoder but it doesn't support Mapbox API
0
votes
1answer
251 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 ...
1
vote
1answer
19 views

Mapbox expression to return greater of two values

I'm looking to plot the equivalent of the SQL query SELECT column_3 FROM my_object WHERE map_layer is not null AND column_1 > column_2; Using this answer I can see where the expression should go (...
1
vote
0answers
27 views

Overlay image in Mapbox gl doesn't work in Chrome

I'm trying to prepare image overlay layer in mapbox gl with city plan as background. It works perfect in Firefox but in Chrome I see only dark grey polygon. I use 4Mb .png file. Firefox Desktop - ok ...
1
vote
1answer
47 views

Mapbox use point result from Geocoding/Search to queryRenderedFeatures on polygon layer that intersects

I've been quite stumped on this and while I have seen it used in other online examples I can't find anything on stack or in the documentation. Right now, I am trying to use the search bar result (a ...
0
votes
1answer
286 views

How to query features of raster layers hosted on GeoServer that are added to Mapbox?

Currently working with Mapbox gl js. I know for OpenLayers there's a function called GetFeatureInfo to do this, but is there a similar one for Mapbox? What I want to do is whenever the user clicks on ...
0
votes
1answer
40 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 ...
0
votes
1answer
447 views

Opacity Transition Mapbox Fade In

I am facing a problem using the 'fill-opacity-transition' in Mapbox GL JS. Maybe someone has an idea what the mistake could be? <!DOCTYPE html> <html> <head> <...
3
votes
4answers
4k views

Mapbox GL JS - “Source Loaded” event

I'm adding a vector tile source to my Mapbox GL js map like this: this.map.on('load', () => { this.map.addSource('userSource', { type: 'vector', url: 'mapbox://&...
2
votes
0answers
30 views

Get position/rotation of free labels in QGIS

I want to export the position and rotation of labels with placement "Free" as I need them in Mapbox, which has inferior label placement compared to QGIS. I've tried with various polygon-to-point ...
1
vote
1answer
265 views

Tippecanoe Vector Tiles overzooming not working

I have created Vector tiles with Tippecanoe in mbtiles format. I am using tileserver-gl for serving the Vector tiles. Firstly I am creating 20 mbtiles separately as different layers needed different ...
1
vote
1answer
894 views

Mapbox GL JS - Adding variable dependent images to popup

I've been working with popups in Mapbox GL JS, using HTML and want to be able to use variables within the Mapbox dataset, so different popups show different images, depending on attributes in the ...
1
vote
1answer
425 views

Clipping/cropping/masking a raster tile layer in Mapbox GL JS

I'm loading Landsat tiles into a Mapbox GL JS map via an AWS S3 tile server, and this is working OK, but what I'd really like to do is clip the tile layer to a GeoJSON polygon which is loaded in ...
0
votes
0answers
36 views

Mapbox GL JS - mapbox-gl-directions plugin show the same driving directions on all maps

I am using the example at the link https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/ to show results from the Mapbox Directions API. The problem arises when creating two maps and ...
4
votes
1answer
1k views

Filtering a layer based on property that's an array in with Mapbox GL JS?

I've got a relational dataset broken into two layers: members and organizations. They're GeoJSON, with features that look something like this: // Org Features { "type": "Feature", "geometry": { ...
4
votes
1answer
2k views

How to get geometry of clicked feature?

From Mapbox's documentation, I should get a GeoJson feature object when I call queryRenderedFeatures method. I run it from a click event without any filter: this.map.on("click", function(e) { ...
1
vote
1answer
36 views

Can Mapbox legends / overlay boxes be displayed differently when viewed on mobile devices?

I created a webmap using Mapbox GL JS for my website. In a desktop browser, it looks exactly the way that I want it to look. When I load it on a mobile device, the information box and legend are too ...
0
votes
1answer
82 views

Purpose of filterEl.addEventListener('keyup', function(e)

I'm learning the mapbox gl js examples and have trouble understanding a function. The function can be found here https://www.mapbox.com/mapbox-gl-js/example/filter-features-within-map-view/ it's in ...
0
votes
2answers
158 views

Mapbox GL JS vector tiles show in higher zoom level without enough vector tiles

If I have a set of vector tile files that only available to max zoom at 16, how can I show it on the map at zoom 17 or even 18? Because of the cause of the data, or the amount of the vector tiles in ...
0
votes
1answer
168 views

Where is data coming from Tilevector or mapstyle

I'm struggling to use the data that's in a vector tileset source (PortalsWithOrderNr) I commented out the add.source and add.layer but when I click on a portal I get most of the data that's in the ...
0
votes
0answers
64 views

Mapbox GL JS and data grid: how to make them speak to each other?

I'm looking for a solution to display cartographic data with Mapbox GL JS along with tabular data (see for example here). I didn't find anything in Mapbox GL JS that allows such a thing (maybe I'm ...
0
votes
1answer
139 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 ...
0
votes
0answers
44 views

Simplifying Mapbox vector tiles from GeoServer for beter performnce?

I use MapBox Vector tiles from GeoServer on my open source web site. How can I improve the performance of this service and how can I simplify the geometry of this service for performance? I know that ...
0
votes
2answers
3k views

Mapbox GL geocoder autocomplete

I am trying to to create multiple input autocomplete search fields that function same as the demo at https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/ . However, I do not want the ...
0
votes
1answer
99 views

Mapbox GL JS : Setting bounds of raster tile layer

I have some weather radar data as a raster tileset. Mapbox documentation states that raster tilesets will default to the size of the world on the map unless otherwise specified. Here is my code for ...
2
votes
1answer
74 views

Using mapbox to implement lighting effects?

I use mapbox.gl.js + postgrepsql+mapnik+ mapbox vector tile; this is my map: but I want this, The point of overlap is brighter:
1
vote
1answer
203 views

Combining popup info from overlapping polygons in Mapbox Studio?

I'm trying to display popup information from overlapping polygons similar to this question, but instead of a click, I'm using the mouse over to identify my popup. In areas that have overlapping ...
0
votes
3answers
84 views

How to get the text labels in a raster tile in OpenMapTiles?

I'd like to use OpenMapTiles to generate training data for a text recognition task. So, I need to have the corresponding text labels in a raster tile, preferably with their location on the image, ...
1
vote
1answer
1k views

Matching multiple properties in mapbox gl js filter

I am trying to write a filter that will match on values from several properties of a layer. For example, in my hypothetical layer of breweries, I'd like to match those breweries that have a state ...
1
vote
2answers
4k views

Custom icon for clusters in Mapbox GL Js

Is it possible to use a custom icon instead of a circle and a symbol (with the cluster_count string) for Mapbox GL Js' "Superclusters?" My goal here is to approximate something like Pie Clusters or ...
1
vote
1answer
21 views

Adding USGS WMTS to Mapbox gl js?

How do you add a wmts layer from the USGS basemaps found here as a mapbox-gl-js layer?: https://viewer.nationalmap.gov/services/
1
vote
1answer
1k views

Adding WMS to Mapbox GL JS

I am in the process of adding a WMS map server to a map I wrote in JavaScript using the Mapbox GL JS library. The map server is using the WMS from the FEMA National Flood Hazard Layer, and I would ...
0
votes
1answer
32 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
1answer
455 views

GeoServer WMS service CQL filter query with Mapbox GL

Is there any way to query WMS tile layer for Mapbox GL? map.addLayer({ 'id': 'wms-test-layer', 'type': 'raster', 'source': { 'type': 'raster', 'tiles': [ '...
3
votes
0answers
233 views

Converting XYZ tile coordinate to WMTS

I would like to add a WMTS tile endpoint to Mapbox-GL-JS, which only supports "XYZ" or TMS tiling schemes. According to what I understand of the WMTS specification the two seem to have the same zoom ...
1
vote
1answer
96 views

Mapbox gl offline

I'm trying to prepare mapboxgl app which works offline, I want to use only javascript engine, local rasters and geojsons. How to avoid connection to mapbox tiles? <script> mapboxgl.accessToken =...
1
vote
0answers
195 views

Do I need TileServerGL to serve locally stored vector Tiles (MBTiles) in Leaflet? [closed]

Situation: I want to create an offline web app and have locally stored .mbtiles (vector tiles) which I downloaded from Open Map Tiles (educational purpose of the project) with a size of about 20 GB. ...
1
vote
1answer
443 views

Mapbox GL JS compressed GeoJson files?

I am currently using Mapbox GL JS and pull multiple GeoJson files from the style.json file. Each file in about 10MB and takes too long to load. Is there a way to compress the files and uncompressed ...
0
votes
2answers
52 views

How to visualize choropleth with temporal component in browser

I have a vector dataset with monthly water risk data per river basin. The data is available for each month (January - December) and I would like to visualize this in a browser. The geometries are ...
3
votes
1answer
151 views

Mapbox - Icon rotations in FeatureCollection

I'm displaying various ships on a map and I have made real sized polygons to represent them. These are not visible at lower zooms, so I wanted to also add icons representing each ship. The icon is a ...
-1
votes
2answers
152 views

Error The sourceLayer parameter must be provided for vector source types

mapbox GL: I got this error Error: The sourceLayer parameter must be provided for vector source types. What is wrong?
0
votes
2answers
4k views

How to filter layer features by value?

I use Mapbox GL JS for visualization massive dataset. And now I try to create several checkboxes for filtering some features of a tileset by its value. Dataset was uploaded to Mapbox through Mapbox ...
0
votes
1answer
48 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')....