I am trying to get all the markers within the bounds of the map. When the user interacts with the map (zoom in/out, move, click), I want to get all the markers within the bounds of the map to show a list of those markers.
I tried implementing some of the functions this example had without any luck: https://www.mapbox.com/mapbox-gl-js/example/filter-features-within-map-view/
Here is a working version of the map on codepen: https://codepen.io/anon/pen/MPGgWq
I looked thru what it returned in features and bounds and none of that information helps me accomplish this. I am using the markers so I can display a custom marker image and also set the description that appears in a pop box.
map.on('moveend', function (e) {
var features = map.queryRenderedFeatures();
var bounds = map.getBounds();
console.log(features);
console.log(bounds);
});