Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
28 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
22 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
42 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
36 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
58 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
38 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
81 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
71 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
56 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
66 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
15 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
124 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 ...
1
vote
0answers
46 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
91 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
22 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
103 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
62 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
50 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 ...
0
votes
0answers
54 views

Mapserver with tileindex to Mapbox

I have many tif files in a single directory which I want to show as a layer in Mapbox. Starting with Mapserver (running a Docker container) to publish the tifs as PNG raster layer. I receive png ...
2
votes
0answers
129 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
170 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
1answer
97 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
54 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
242 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
54 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
49 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
105 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
87 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
110 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
113 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
44 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
94 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 ...
0
votes
0answers
31 views

Add image over the fill/line layers in Mapbox GL JS

I have custom map (image overlay with bounds) with some areas (fill/line layers): How to add image layer (like image overlay in map style and with same size) over the other layers? This image have ...
1
vote
1answer
78 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
2answers
462 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
0answers
67 views

Looped query rendered feature function for a set of intersect points upon a GeoJSON building layer in Mapbox GL JS

I'm currently using mapbox gl to visualise and analyse a GeoJSON layer of buildings. My current aim is to develop a function that will use the mapbox draw functionality to draw a line (using the ...
1
vote
0answers
138 views

Visualising road segments as heatmap

I have some data on frequency of different road segments, and need to visualise it as a heatmap. Is there some utility/plugin for Mapbox or Leaflet which does this kind of visualisation. I am only ...
1
vote
1answer
927 views

mapbox gl expression to match multiple values

i have a layer that i want to filter by multiple values stored in array let filter = ['in','id', 1,2,3] map.setFilter('layer_name',filter) this works fine and it will return only features with ID 1,...
1
vote
0answers
57 views

Building RGB-encoded DEM for Mapbox GL

I'm trying to create a RGB-encoded DEM file like the one that mapbox has for Maputnik that is being hosted on TileserverGL. I've converted a single-band DEM into a color-mapped RGB DEM then converted ...
0
votes
1answer
139 views

Adding geojson features to OpenMapTiles displayed with MapboxGLJS is not working

The OpenMapTiles example for display using Mapbox GL JS works nicely to display the map. However, when trying to add lines and features to the map using Mapbox GL JS functions like this: map.on('...
1
vote
1answer
120 views

Mapbox Vector Tiles dropping features across tile boundaries

I'm currently working on a project that involves the creation of vector tiles from geojson files. These vector tiles are then displayed using Mapbox GL JS. Recently, we've ran into an issue where ...
1
vote
1answer
196 views

Missing tile endpoint in OpenMapTiles -> Mapbox GL JS example

OpenMapTiles.org gives an example snippet (which is described as) showing how to use Mapbox GL JS to display openmaptiles generated tiles. The full OMT example: <!DOCTYPE html> <html> &...
5
votes
1answer
238 views

Mapbox vector tiles version 2 MVTv2 and Geoserver 2.13.x

I use WMS on Geoserver to display MVTs in conjunction with mapboxgl.js v0.45.0. A OSM road layer renders 1:1 on top of the Mapbox base layer, so far so good. However, I got a warning from the js ...
1
vote
1answer
327 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 ...
2
votes
1answer
984 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) { ...
0
votes
1answer
814 views

How to add text labels to a Mapbox GL JS map that has no vector layers?

Using http://bl.ocks.org/danswick/a4de5c170c04fdd38bb4 and https://www.mapbox.com/mapbox-gl-js/example/cluster/ I made a Mapbox GL JS map. It has no vector tiles basemap but raster tiles. It has ...
1
vote
0answers
122 views

Turf.js midpoint of line

I'd like to open a popup in on the midpoint of a polyline/linestring in Mapbox GL, like it's the default case in Leaflet. How can I do this via turf.js? If I use centroid/center/centerOfMass it will ...
0
votes
1answer
313 views

Local GeoJSON Access Mapbox GL JS / Online GeoJSON Updating?

I've seen a lot of similar questions floating around but they have not really addressed what I am looking for. I am a novice at web development. I'm attempting to change my project so that my ...
1
vote
0answers
79 views

How would I go about getting the user input from a popup that contains a text input in Mapbox GL JS?

I want to make a list of places I'd like to visit. When I click on the map a marker is placed and a popup appears above the marker. The popup contains a text input field and a submit button to save ...
1
vote
0answers
741 views

mapbox set fill-color dynamcally

I'm using the mapbox library and I have this function that processes a response of type json, but I want the color of every single feature to be dynamic based on a property of the feature itself: ...