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