bounds.包含失败,而不应该失败



在示例 http://gmap3.net/issues/contains-failed.html

map.getBounds().contains(marker.getPosition()) 在标记可见时失败,

如果我将地图宽度从 1200px 更改为 800px,它就会成功

这是一个已知问题吗?

问候

让-巴蒂斯特。

使用800px ' 宽度,你有这些边界:

(-57.31109738854086, -173.32397500000002),    //south west GPS -> sw
(84.67616358203445, 178.23852499999998)       //north east GPS -> ne

在"1200px"的情况下:

(-57.31109738854086, 151.51977499999998),    //south west GPS  -> sw
(84.67616358203445, -146.60522500000002)     //north east GPS  -> ne

您的标记具有(49.00408, 2.562279999999987)坐标。所以对于第一种情况:

-57.31109738854086    <    49.00408         <     84.67616358203445   //true
-173.32397500000002   <  2.562279999999987  <     178.23852499999998  //true

对于第二个:

-57.31109738854086    <    49.00408         <     84.67616358203445   //true
151.51977499999998    <  2.562279999999987  <    -146.60522500000002  //false

这就是为什么在第两种情况下,您会"No"为警报,在第一种情况下"Yes"

相关内容

最新更新