我试图像这样使用Mapbox GL JS文档(https://docs.mapbox.com/mapbox-gl-js/api/#lnglatbounds#contains)中的contains()函数:
var bounds1 = [[190, -10], [170, 10]];
var llb = new mapboxgl.LngLatBounds(bounds1[0], bounds1[1]);
var containsPoint = llb.contains([180, 0]); // should be true
但是我收到一个包含contains()不是函数的类型错误。我尝试更新mapbox-gl-js,但它是当前版本(1.6.0),这意味着contains()应该可以工作]
来自注释(https://jsfiddle.net/cs09g/q3x1ohun/54/)的JSFiddle显示contains
方法按v1.6.0
中的预期工作。