Questions tagged [mapbox-gl-js]

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

78 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
116 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....
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
0answers
578 views

Mapbox GL JS style vector tile interaction in OpenLayers?

I am currently researching different approaches for integrating vector tiles (especially MVT and/or GeoJSON tiles, served from GeoServer) with OpenLayers (^4.0.0) in a manner that would retain access ...
4
votes
0answers
726 views

mapbox styling of vector tiles with many features in openlayers 4

I am trying to process a vector tile source in OpenLayers using the VectorTile layer and source in OpenLayers 4.1. The backend is serving pbf (mvt-based) tiles from an mbtiles source. The tiles have ...
3
votes
0answers
242 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 ...
3
votes
0answers
231 views

Supercluster and vector tiles

I am trying to take a set of points, use supercluster to create an index, and query that index for vector tiles. Things mostly work as expected, but when the tiles are loaded into Mapbox GL JS they ...
3
votes
0answers
378 views

Maintaining Curves in Mapbox-GL

I am trying out Mapbox-gl-js as an alternative to our current openLayers 3 solution. This is primarily due to a desire to shift away from raster backgrounds and to utilize the webGL and vector tile ...
3
votes
0answers
970 views

rotate custom icon on mapbox gl js

I try to rotate a custom Marker icon inside Mapbox gl-js. All the commented attempts not working. Are we absolutely need to go with geojson sources to rotate an icon and a custom one that is not able ...
3
votes
0answers
465 views

Data-driven styling in Mapbox GL JS - Error when drawing circle radius by zoom level and property

I'm playing around with data-driven styling in Mapbox GL JS. Setting the circle color based on a layer property works just fine: "circle-color": { 'property': 'mag', 'stops': [ [4, ...
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 ...
2
votes
0answers
128 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 ...
2
votes
0answers
297 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
0answers
272 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 ...
2
votes
0answers
163 views

Is there a “Disperse Markers” option in Mapbox GL-JS?

I have used the "Disperse Markers" tool in ArcGIS before, but I am currently working on a project where I am using Mapbox GL-JS to display point data. Many of my points overlap, and I would like them ...
2
votes
0answers
621 views

Mapbox GL checkbox menu

I am trying to toggle layers and legends using a checkbox menu. I'm able to toggle the bathroom and sq ft legends, but I'm not sure how to identify the layer layout in order to toggle it. Here is my ...
2
votes
0answers
419 views

Vector rendering issue using Mapbox-gl & GeoServer vector tiles (pbf)

I am rendering a vector line in the browser using mapbox-gl. The layer is being served using GeoServer as a pbf vector tile. The rendering issue is happening at most zoom levels and it is happening ...
2
votes
1answer
75 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:
2
votes
0answers
286 views

How to search vector layer features in Mapbox GL JS

I need to add a search bar that will search vector layer attribute features which are hosted by mapbox. I'm using the Mapbox GL JS API. I know this can be done fairly easily with Mapbox js/Leaflet. I'...
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
106 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
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 ...
1
vote
1answer
272 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
204 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 ...
1
vote
1answer
441 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
32 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
211 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
187 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 ...
1
vote
0answers
165 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 ...
1
vote
0answers
393 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 ...
1
vote
0answers
198 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 ...
1
vote
0answers
161 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 ...
1
vote
1answer
208 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 ...
1
vote
0answers
106 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
254 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
0answers
98 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 ...
1
vote
0answers
149 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
2k 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: ...
1
vote
0answers
105 views

Geoserver sending BigDecimal data as String in vector tiles

Setup details: Geoserver: 2.12.1 DataStore: PostgreSQL 10.1 with PostGIS 2.4.2 mapbox-gl: 0.42.0 I am using mapbox-gl to render vector tiles from geoserver using TMS. I am styling the tiles using ...
1
vote
0answers
153 views

Combining (merging) neighbour points to one centred point in PostGIS (reducing density)?

I'm new to spatial algorithms and PostGIS functionality. Currently I have a Pg 10 + Postgis 2.4 database with table of more than 400 000 records (points with additional properties), with Node.JS tile ...
1
vote
0answers
134 views

Mapbox-gl offline openmaptile font not shown

I'be downloaded a mbtile file related to rtl countries and used it as an offline source for Mapbox-gl server. All stuff are shown correctly except labels that have rtl characters. Even ltr characters ...
1
vote
0answers
39 views

Geocoder / Fly Map Problem

I'm a little stumped with this issue that I'm having.. I have a large zip code map (the whole U.S.) with a Geocoder. When I do a search for a particular zip code, and press enter or select it, the map ...
1
vote
0answers
402 views

Mapbox gl : How to perform a filter in a polygon?

I want to make a filter on the geometry of my layer source vector. var polygone = ..... var filter = polygone.reduce(function (memo, coord) { memo.push(coord); return memo; }, ['in', '$...
1
vote
0answers
298 views

mapbox gl- Toggle highlighting of specific feature of a layer in map style

I tried it with "Setpaintproperty" and "data driven functions" but I dont know the exact syntax.. map.on('mousemove', function(e) { var states = map.queryRenderedFeatures(e.point, { ...
1
vote
0answers
158 views

How to get search value of leaflet map

enter code here L.control.scale({ position: 'bottomleft' }).addTo(leafletMap); var searchcontroloption={position: 'topleft'}; L.Control.geocoder(searchcontroloption) .on('markgeocode', function(e) {...
1
vote
0answers
323 views

How do I convert my png tiles to mapbox’ pbf files?

I am trying to use my self hosted maps in Mapbox GL, but I only get errors or black screens. My JS code is: var map = new mapboxgl.Map({ container: 'map', style: { ...
1
vote
0answers
96 views

Keeping properties secure within mapbox-gl

Simply put, how could one develop a mapbox-gl application where the properties are secured ? For example, take a look at this simple mapbox-gl map with properties: http://jsbin.com/hovawa/edit?...
1
vote
0answers
160 views

Leaflet: Show/Hide Symbols Loaded from a Style File

I have a project that uses an OSM2VectorTiles map with Leaflet through the library, mapbox-gl-leaflet, in order to load my own locally-hosted style file. I edited the style file in Mapbox Studio to ...
1
vote
0answers
465 views

How to create hover effect on each polygon in mapbox map

function createPixelBox(jsonData){ // a1=(x1,y2),a2=(x2,y2),a3=(x2,y1),a4=(x1,y1) var x,y,x1,x2,y1,y2; var geodata=[]; var Length=jsonData.length; for(var i=0;i<Length;...
1
vote
0answers
661 views

Mabox GL JS - Display Zoom

How can i display the current zoom level using mapbox ? Like this: https://www.nps.gov/npmap/tools/npmap.js/examples/zoomdisplay-control/ I thought it could be easy, like adding navigation control, ...
1
vote
0answers
1k views

Highlighting polyline features in mapbox-gl.js

I am trying to use the following code to highlight features under the mouse pointer. The difference between my geojson data and the geojson data used in the linked example is that the example is ...