A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [mapbox-gl-js]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Converting an inner rectangle in pixels to bounding box in map?

The drawing and the measures above shouldn't be taken seriously, but they might help illustrate what I am trying to achieve. I have an interactive map being displayed inside an HTML canvas, the map ...
0
votes
1answer
15 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 ...
1
vote
0answers
17 views

Cluster Source with tiles

Is it possible create a cluster source with tiles? With geojson works perfectly but I would like to work with a tile source. map.on('load', function () { // add source map.addSource('...
1
vote
0answers
31 views

Trying to find percentage of overlap using turf intersect returns 'found non-noded intersection between LINESTRING'

This worked just the other day and now it's throwing an error for every call. The original code (before adding the try/catch) is this: var cbgShape = turf.polygon(shapeData.geometry.coordinates....
1
vote
1answer
73 views

How do I increase the font size of contents in Map in Leaflet.js?

I am using Leaflet JS for displaying my map. Following is my code. The map gets displayed. But the size of the city names are not large. Each time I zoom in, the font size is very less. It is not ...
0
votes
0answers
19 views

How to Run Mapbox genfontgl in Window System

As title. Because I am Eastern, the fonts for our characters may not being supported by Mapbox make this problem so hard to me. I've found a tool to transform TTF to glyphs called Mapbox genfontgl, ...
0
votes
1answer
20 views

Execute JavaScript code in popup for Mapbox?

I'm trying to embed tweets into the popups for a map I've made in Mapbox. The text of the tweets is displaying properly, but not the styling — the embed code contains a script tag to load a widget for ...
1
vote
0answers
28 views

Why Server Vector Tiles for MapboxGL Client rendered incorrectly

I am trying to set up a web server in Node.js that serves vector tiles to be displayed in a browser using MapboxGL JS. The data for the vector tiles is stored in a PostGIS database. I receive a ...
1
vote
0answers
18 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
0answers
35 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
2answers
61 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
56 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
16 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
24 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
90 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
32 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
148 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
82 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
55 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
97 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
33 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
185 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
49 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
78 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
53 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
183 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
28 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
251 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
93 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
144 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
267 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
63 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
202 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
62 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
153 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
47 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
63 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
192 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
262 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
36 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
28 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
560 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
311 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
313 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
25 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
161 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
534 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 ...