Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 23673

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

16 votes
Accepted

Removing events map.on("click"...) from mapbox gl?

First split out the click function so it can be referenced on it's own: function onClick(e) {...} Then register your on click with: map.on('click', 'clusters', onClick); Then just before you rem …
AndrewHarvey's user avatar
  • 2,269
11 votes

How to filter layer features by value?

The "Filter symbols by toggling a list" example toggles the visibility of whole layers. For more fine grained filtering use map.setFilter, see https://www.mapbox.com/mapbox-gl-js/api/#map#setfilter. …
AndrewHarvey's user avatar
  • 2,269
7 votes

How to change the icon-image on click

This is a good question. Typically you'd use feature-state for this like in https://docs.mapbox.com/mapbox-gl-js/example/hover-styles/, however feature-state doesn't support the icon-image layout pro …
AndrewHarvey's user avatar
  • 2,269
6 votes
Accepted

Combining popup info from overlapping polygons in Mapbox GL JS

Within your map.on('click') callback, e.features is an array of all features from testlayer at the point clicked. So instead of only choosing the first in your popup, you can display all values like …
AndrewHarvey's user avatar
  • 2,269
4 votes
Accepted

Change dynamically created layer's minZoom after render

Use map.setLayerZoomRange: map.setLayerZoomRange('my-layer', minzoom, maxzoom);
AndrewHarvey's user avatar
  • 2,269
3 votes
Accepted

Symbolizing field with many values in Mapbox Studio?

In QGIS you would do this by choosing a color ramp (or random) and hitting Classify, Mapbox Studio doesn't yet offer this feature but in the meantime if you choose the "Edit property as JSON" at the b …
AndrewHarvey's user avatar
  • 2,269
2 votes
Accepted

Get MapBox Marker Coordinates Dynamically

When you select a result from the search, as it places the marker on the map, the Geocoder will also fire a 'result' event, https://github.com/mapbox/mapbox-gl-geocoder/blob/master/API.md#on which you …
AndrewHarvey's user avatar
  • 2,269
2 votes
Accepted

MapBox get div element of Marker

You're saving the mapboxgl.Marker object so you can latter access this via the getElement method, eg: deviceMarker.getElement() See https://www.mapbox.com/mapbox-gl-js/api/#marker#getelement
AndrewHarvey's user avatar
  • 2,269
2 votes
Accepted

MapBox GL JS popups for the 0.18.0 version?

Mapbox don't currently publish docs for older GL JS versions (ticketed here https://github.com/mapbox/mapbox-gl-js/issues/2398) But you can build and view docs for older versions locally with: git …
AndrewHarvey's user avatar
  • 2,269
2 votes

Location is not accurate when replicating an existing feature and zooming in

When you first called queryRenderedFeatures you're getting the coordinates generalised to the zoom level your map was initially at, which as you can see is a bit off the source data coordinates. You' …
AndrewHarvey's user avatar
  • 2,269
2 votes
Accepted

Mapbox GL JS/Android: Draw User's 3D Vector Layer of Buildings

Check the error console, it explains that 'fill-color': '#088', 'fill-opacity': 0.8 aren't valid paint properties for fill-extrusion layers. See the example at https://docs.mapbox.com/mapbox-gl-j …
AndrewHarvey's user avatar
  • 2,269
2 votes
Accepted

Adding an ArcGIS map service to Mapbox GL JS

In your addLayer function, the tiles option must be the URL to the raster tiles. https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/28 is the URL to the HTML page describing the ERS …
AndrewHarvey's user avatar
  • 2,269
2 votes

query features from a bounding box bigger than viewport mapbox gl js

As per the Mapbox GL JS API docs, queryRenderedFeatures and querySourcesFeatures only guarantee to query features within the current viewport. If you need to query outside this you could: Load the …
AndrewHarvey's user avatar
  • 2,269
2 votes

How to enlarge the marker on mouseover in mapbox gl js

At the moment there are two ways to do this. Add a unique id property to each of your Features. Create a new hover layer with larger circle-radius and a filter initially to select none of the id's. …
AndrewHarvey's user avatar
  • 2,269
1 vote
Accepted

Offset a label inside a polygon with mapbox-gl style?

I believe using "text-keep-upright": true is the way to go, the fact that that causes the labels to render on the wrong side of the line, I think is a bug see https://github.com/mapbox/mapbox-gl-js/is …
AndrewHarvey's user avatar
  • 2,269

15 30 50 per page