I need to emulate a user click on my MapBox GL JS map.
I doesn't matter where in my map: could be useful to do in the point at the center of my maps if this could be easier.
I've found here https://stackoverflow.com/questions/18323105/programmatically-opening-a-popup-in-a-mapbox-map something that could be useful ...
map.fireEvent('click', {latlng: L.latLng(28.04419, -81.947864)});
... but seems to be something about Leaflet
I'd like my code coud be something like this ("broken code" ... )
bounds = map.getBounds();
x = bounds._ne.lng;
y = bounds._ne.lat;
map.fireEvent('click', {latlng: L.latLng(x, y)});
Does fireEvent exist in MapBox GL JS or are there alternatives?
No comments:
Post a Comment