2021年4月7日星期三

How can I simulate a click on Mapbox

I'm struggling to simulate a click on the map. Here is my code.

map.fire('click', function ()      {           newDropoff({lng: 27.4199870950609,lat: 53.240419723523775});          updateDropoffs(dropoffs);      })  

The original code is taken from this guide

map.on('click', function (e) {      // When the map is clicked, add a new drop off point      // and update the `dropoffs-symbol` layer      newDropoff(map.unproject(e.point));      updateDropoffs(dropoffs);      });  

Does anyone know what should be corrected in my code? PS I've checked other sources already

https://stackoverflow.com/questions/66970873/how-can-i-simulate-a-click-on-mapbox April 06, 2021 at 10:43PM

没有评论:

发表评论