alex3165 / react-mapbox-gl

A React binding of mapbox-gl-js
http://alex3165.github.io/react-mapbox-gl/
MIT License
1.92k stars 534 forks source link

Expected `.contains(lngLat)` instance method on LngLatBounds object #824

Open daschi opened 4 years ago

daschi commented 4 years ago

Hello and thank you for this incredibly useful package! I was wondering if there are plans to include the .contains(lngLat) method on the LngLatBounds object return from the mapbox map's getBounds() function.

Currently, getBounds() returns an object with most of the instance methods available in the API (i.e. getters and setters for cardinal directions and the center, toArray, toString, isEmpty), but this is missing contains.

Here's a link to it in the Mapbox GL docs: https://docs.mapbox.com/mapbox-gl-js/api/#lnglatbounds#contains

tchak commented 4 years ago

I see no place where react-mapbox-gl overrides or implements getBounds(). I think what happens is that react-mapbox-gl by default depends on mapbox-gl-js 1.8 but LngLatBounds .getBounds().contains() was added in 1.9.