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
0answers
30 views

Leaflet Sidebar - Show specific sidebar content after clicking a location

Similar question to this one but I don't have enough knowledge to apply it to my case. I have a Mapbox GL JS map (based on Leaflet) to which I added a Leaflet Sidebar V1. The sidebar content is made ...
0
votes
0answers
20 views

Mapbox GL JS Heatmap Label

I am working from this example on the Mapbox documentation page and I have managed to get points labeled onHover, but have not been able to get the actual heat map layer itself to display information ...
1
vote
3answers
37 views

Dynamical refresh of Mapbox layers after drawing edits

I fetch some GeoJSON from a DB, and add them to my map. After I use the mapbox-gl-draw library for editing. My problem is that, after editing a feature on the map I would like to directly change it (...
1
vote
1answer
51 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
0answers
9 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 ...
1
vote
1answer
21 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 (...
0
votes
1answer
57 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', ...
1
vote
0answers
28 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
68 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
54 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 ...
2
votes
0answers
31 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 ...
0
votes
1answer
44 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
0answers
55 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 ...
0
votes
1answer
30 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 ...
1
vote
1answer
119 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
vote
1answer
39 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
0answers
68 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
0answers
47 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
1answer
130 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 ...
1
vote
1answer
25 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/
0
votes
2answers
195 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
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. ...
0
votes
3answers
90 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
109 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
221 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. ...
0
votes
2answers
59 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 ...
-1
votes
2answers
175 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
1answer
52 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')....
0
votes
1answer
127 views

Mapbox GL JS ImageSource wrong coordinates

I'm struggling to position an image correctly onto my map. I'm using one of the following URLs for my (live) image: https://maps.dwd.de/geoserver/dwd/wms?service=WMS&version=1.3.0&request=...
0
votes
0answers
45 views

Vector Tiles generating taking time in Geoserver

I have displayed map box vector tiles for EPSG:3857 projection customized by me with 21 zoom levels.below is code using in my application <!DOCTYPE html --> <html> <head> <...
1
vote
0answers
59 views

GeoServer vector tiles (.pbf) wont display due to CORS issue [duplicate]

I am using Mapbox Gl JS to get mapbox vector tiles (pbf) from GeoServer 2.15, which I am running with Tomcat 8.5 on a Windows Server. The Mapbox GL JS javascript is in a folder in the Tomcat webapps ...
3
votes
1answer
169 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
vote
1answer
223 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 ...
0
votes
0answers
34 views

Putting inset map Popup in front using Mapbox GL?

I have maps of Hawaii and Alaska inset on a map of the continental US. All maps have markers and popups when you click the markers. How do I position the AK and HI popups so they are fully visible?
0
votes
0answers
27 views

Cannot display GeoServer vector tiles when serving web map using IIS [duplicate]

I am currently developing a web map with Mapbox GL JS. I have been adding layers to the map from GeoServer using the following url: "http://localhost:8080/geoserver/...". When opening the map in ...
0
votes
0answers
501 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 ...
0
votes
0answers
269 views

Interact with vector tiles from Mapbox in Leaflet.JS

I am trying to add GeoJSON layers on a Leaflet.JS map, but there are GsoJSON files with a very big size that can not be rendered as GeoJSON on the map. So i have added it to the map vector tile ...
0
votes
0answers
277 views

Categorical circle colour on mapbox gl js

Adapting the documented example here To produce the code below I get the following error. Error: "layers.circles-heat.paint.circle-color.stops[9][1]: color expected, "#5675d2" found" map....
1
vote
0answers
24 views

vectortiles: change style of basemap instead of data

I'm using Mapbox-GL-Leaflet bindings on Leaflet to style my vector tiles. I'd now allow the user to switch a style using Leaflet control. The easiest way would be to use LayerControl for this. Since ...
0
votes
1answer
143 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
1answer
451 views

Get distance for mapbox-gl-directions

Using the following code, how do I get the distance of the route directions? I want to run some math against the length. container: 'map', // container id style: 'mapbox://styles/mapbox/...
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 ...
0
votes
0answers
456 views

Adding select option menu to Mapbox map and filtering data source?

I'm attempting to add a drop down select menu for # of bedrooms to a mapbox map. The data source that I'm attempting to filter on is a geojson data file. I setup window onchange event listener ...
0
votes
1answer
267 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 ...
4
votes
0answers
118 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....
0
votes
0answers
136 views

Merging two MapBox MBTiles files using javascript/typescript in Cordova?

I am using the MapBox-GL-JS API to render maps in a Cordova hybrid app that runs on Android and iOS. I have serving vector tiles locally from the phone working. In my use case, I would like users to ...
3
votes
0answers
245 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 ...
0
votes
1answer
480 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> <...
1
vote
1answer
596 views

Mapbox GL JS - 3D Buildings - display only some buildings in 3D

I am using this example provided by mapbox gl js: Display buildings in 3D Now the problem is I only want to show some buildings in 3D. How can achieve this? I don't know where to find the source-...
0
votes
1answer
314 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 ...