Reference documentation and code samples for the Google Geo Common Protos Client class Viewport.
A latitude-longitude viewport, represented as two diagonally oppositelowandhighpoints. A viewport is considered a closed region, i.e. it includes
its boundary. The latitude bounds must range between -90 to 90 degrees
inclusive, and the longitude bounds must range between -180 to 180 degrees
inclusive. Various cases include:
Iflow=high, the viewport consists of that single point.
Iflow.longitude>high.longitude, the longitude range is inverted
(the viewport crosses the 180 degree longitude line).
Iflow.longitude= -180 degrees andhigh.longitude= 180 degrees,
the viewport includes all longitudes.
Iflow.longitude= 180 degrees andhigh.longitude= -180 degrees,
the longitude range is empty.
Iflow.latitude>high.latitude, the latitude range is empty.
Bothlowandhighmust be populated, and the represented box cannot be
empty (as specified by the definitions above). An empty viewport will result
in an error.
For example, this viewport fully encloses New York City:
{
"low": {
"latitude": 40.477398,
"longitude": -74.259087
},
"high": {
"latitude": 40.91618,
"longitude": -73.70018
}
}
Generated from protobuf messagegoogle.geo.type.Viewport
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Geo Common Protos Client - Class Viewport (0.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.2.1 (latest)](/php/docs/reference/geo-common-protos/latest/Type.Viewport)\n- [0.2.0](/php/docs/reference/geo-common-protos/0.2.0/Type.Viewport)\n- [0.1.0](/php/docs/reference/geo-common-protos/0.1.0/Type.Viewport) \nReference documentation and code samples for the Google Geo Common Protos Client class Viewport.\n\nA latitude-longitude viewport, represented as two diagonally opposite `low`\nand `high` points. A viewport is considered a closed region, i.e. it includes\nits boundary. The latitude bounds must range between -90 to 90 degrees\ninclusive, and the longitude bounds must range between -180 to 180 degrees\ninclusive. Various cases include:\n\n- If `low` = `high`, the viewport consists of that single point.\n\n\u003c!-- --\u003e\n\n- If `low.longitude` \\\u003e `high.longitude`, the longitude range is inverted (the viewport crosses the 180 degree longitude line).\n - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, the viewport includes all longitudes.\n - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, the longitude range is empty.\n - If `low.latitude` \\\u003e `high.latitude`, the latitude range is empty. Both `low` and `high` must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error. For example, this viewport fully encloses New York City: { \"low\": { \"latitude\": 40.477398, \"longitude\": -74.259087 }, \"high\": { \"latitude\": 40.91618, \"longitude\": -73.70018 } }\n\nGenerated from protobuf message `google.geo.type.Viewport`\n\nNamespace\n---------\n\nGoogle \\\\ Geo \\\\ Type\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getLow\n\nRequired. The low point of the viewport.\n\n### hasLow\n\n### clearLow\n\n### setLow\n\nRequired. The low point of the viewport.\n\n### getHigh\n\nRequired. The high point of the viewport.\n\n### hasHigh\n\n### clearHigh\n\n### setHigh\n\nRequired. The high point of the viewport."]]