Masashi Katsumata edited this page Sep 19, 2016 · 12 revisions

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!

Jump to...

Clone this wiki locally

A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.

var points = [
  new, 140.75675),
  new, 140.75875000000002),
  new, 140.75905),
  new, 140.76018000000002),
  new, 140.75845),
  new, 140.75714000000002),
  new, 140.75611),
  new, 140.75484),
  new, 140.75475),
  new, 140.75364000000002),
  new, 140.75454000000002),
  new, 140.75465),
  new, 140.75673)
var latLngBounds = new;

var bounds = {
  east: latLngBounds.notheast.lng,
  west: latLngBounds.southwest.lng

// Create a rectangle
var rectangle = [
  new, bounds.west),
  new, bounds.east),
  new, bounds.east),
  new, bounds.west)

  'points': rectangle,
  'strokeColor' : '#AA00FF',
  'strokeWidth': 5,
  'fillColor' : '#880000'

LatLngBounds Class Reference

Method Return value Description
toString() String Converts to string.
toUrlValue(precision?:number) String Returns a string of the form "[ [lat_lo,lng_lo], [lat_hi,lng_hi] ]" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box.
extend(LatLng) void Extends this bounds to contain the given point.
contains(LatLng) Boolean Returns true if the given lat/lng is in this bounds.
getCenter() LatLng Computes the center of this LatLngBounds
Property Return value Description
southwest LatLng Returns the north-east corner of this bounds.
northeast LatLng Returns the south-west corner of this bounds.