我正在尝试执行以下语句:
nowMap.getBounds.contains(mymarker.getPosition())
但它返回以下错误:
Object function (){return this.get(a)} has no method 'contains'
getBounds.contains
调用在bounds_changed
事件处理程序中执行,以确保map
已准备就绪。我读到这可能是由于v3.14 api
中的错误导致我升级到3.15
并仍然收到错误。请注意,如果包含jquery-mobile page
的{{1}}是我导航到的第一个map
,则不会收到错误。
答案 0 :(得分:0)
你有一个错字:
nowMap.getBounds.contains(mymarker.getPosition())
()
后遗失getBounds
。该行应该是:
nowMap.getBounds().contains(mymarker.getPosition())