Skip to content

LatLngBounds.contains()

wf9a5m75 edited this page Sep 23, 2014 · 6 revisions

If you want to know the coordinates are in the bounds, LatLngBounds.contains() method returns the value as boolean.

###Usage

Method Return value Description
contains(LatLng) Boolean Returns true if the given lat/lng is in this bounds.

###Example

map.getVisibleRegion(function(latLngBounds) {
  var point = new plugin.google.maps.LatLng(0, 0);
  var isContained = latLngBounds.contains(point);
  alert(point.toUrlValue() + " is" + (isContained ? " " : " not ") + " contained in this bounds.");
});

Join the official community

New versions will be announced through the official community. Stay tune!

Do you have a question or feature request?

Feel free to ask me on the issues tracker.

Or on the official community is also welcome!


New version 2.0-beta2 is available.

The cordova-googlemaps-plugin v2.0 has more faster, more features.

https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md

Clone this wiki locally