Question

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.

Was it helpful?

Solution

You have a typo:

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

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

nowMap.getBounds().contains(mymarker.getPosition())
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top