문제

I am trying to execute the following statement:

nowMap.getBounds.contains(mymarker.getPosition())

but it is returning the following error:

Object function (){return this.get(a)} has no method 'contains'

The getBounds.contains call executes within a bounds_changed event handler to ensure that the map is ready. I read that this may be due to a bug in the v3.14 api so I upgraded to 3.15 and am still getting the error. Note that I do NOT get the error if the jquery-mobile page that includes the map is the first page I navigate to.

도움이 되었습니까?

해결책

You have a typo:

nowMap.getBounds.contains(mymarker.getPosition())

There is () missing after getBounds. That line should be:

nowMap.getBounds().contains(mymarker.getPosition())
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top