Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mapbox-gl-js]

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

1
vote
1answer
20 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
43 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
36 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
23 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
17 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
33 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
22 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
23 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 ...
2
votes
1answer
47 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
61 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
17 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
21 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
156 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
144 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
62 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
19 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
44 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
163 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/...
0
votes
1answer
454 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
263 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
137 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
79 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
77 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 ...
1
vote
0answers
142 views

Convert Z/X/Y 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
177 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> <...
0
votes
1answer
359 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
163 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 ...
1
vote
1answer
161 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
0answers
137 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 ...
0
votes
0answers
17 views

How can GeoServer transform a 'no RHR layer' into a RHR layer?

We are using GeoServer 2.11.2 and Mapbox. We have many layers that do not follow the rule of the right hand and we need to serve them to other application. The problem is that we have to show in a ...
0
votes
2answers
310 views

GeoServer GeoJSON WMS layer request in Mapbox

I'm creating a Mapbox GL JS web map which pulls GeoJSON layers from GeoServer. I've used the documentation to find my problem lies in the 'GetFeatureInfo' get request URL which follows the following ...
2
votes
0answers
83 views

Extend / override Mapbox-gl 'baselayer' loadTile

Similar to how Leaflet's guide shows how to override L.TileLayer's getTileUrl method in place of your own (and L.GridLayer's createTile method), I want to know how to extend/override Mapbox-gl's ...
1
vote
1answer
236 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 ...
1
vote
0answers
25 views

Merge node results into one MultilineString

I'm trying to generate MultiLineStrings from street data nodes. Right now my workflow is as follows: I run something like the following through the Overpass Api, to get all the nodes: [out:json][...
1
vote
0answers
155 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
0answers
130 views

Vector Tiles in a JavaFX application

I currently building a desktop routing application using Java and JavaFX plus MapBox and Leaflet. My problems occured when i try to load a vector tile into a WebView component. If i'm using this HTML ...
0
votes
1answer
95 views

How to load geojson features outside view with Mapbox GL?

I am trying to load all features from an imported geoJSON. I want to do so because I need some propeties in order to create a list of all elements. But when trying to access them it looks like I can ...
2
votes
0answers
233 views

Mapbox GL Expression to filter array in property

I have GeoJSON Feature properties that look like this: { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "id": "someID", "...
2
votes
1answer
246 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? ...
1
vote
1answer
296 views

Mapbox.js (or GL) with OpenLayers

Our initial need is to have a GIS tool that overlays images on a map which is not facing north. In our research we have seen that only Mapbox and OpenLayers support this. Along with that we want ...
1
vote
0answers
106 views

Remove map layer when animation restarts Mapbox gl

I am having issues in 'clearing' the map from lines when the user clicks on an element. The idea is to switch between different city-animations on click. For each city, a new geojson is called. The ...
4
votes
1answer
497 views

How do I filter 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": { ...
0
votes
0answers
110 views

Data-driven cluster colour with mapboxgl

I am trying to draw circle which colour depends on a "group" attribute in my geojson. I followed a simple example with these colours: map.addSource("data", { type: "geojson", data: url, ...
0
votes
1answer
85 views

GDAL - Unable to convert to Web Mercator using gdalwarp

I am making geoTIFs of weather data (for a Mapbox overlay) and I am converting them to web mercator for use on the map. The images were generated from the same source file and both images have the ...
0
votes
1answer
178 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 ...
1
vote
0answers
220 views

Using GDAL tools to convert GeoTIFF for Mapbox use

(Edit) I have added a link to the files needed to reproduce problem (unzips to 180MB TIFF) : https://www.dropbox.com/s/qrrlsjlmafctt38/issue.zip?dl=0 I have been working on a project the past few ...
0
votes
1answer
231 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 ...
1
vote
0answers
148 views

Vector tile layers over 3D terrain

I have a set of vector tile layers I'm hosting (mbtiles) on Mapbox. Currently, I'm using Leaflet to overlay these on a 2D satellite view and works. However I'm wanting to add in some features to my ...
0
votes
0answers
49 views

Convert “world file” GIS for MapBox GL?

I'm trying to display GIF image with a world file on Mapbox gl. The image is displayed but it looks like it was shifted couple of degrees up.The Image documentation state that it was created using ...
1
vote
0answers
113 views

MapBox GL JS - Markers or Layers

Ok. I've a server which send me a geojson data, according to the specifications. I'm using mapbox gl js, and not sure what type of method to choose: 1) creating a layer with geojson properties of ...