Send feedback
Class Viewport (2.14.3)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.14.3 keyboard_arrow_down
public final class Viewport extends GeneratedMessageV3 implements ViewportOrBuilder
A latitude-longitude viewport, represented as two diagonally opposite low
and high
points. 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:
If low
= high
, the viewport consists of that single point.
If low.longitude
> high.longitude
, the longitude range is inverted
(the viewport crosses the 180 degree longitude line).
If low.longitude
= -180 degrees and high.longitude
= 180 degrees,
the viewport includes all longitudes.
If low.longitude
= 180 degrees and high.longitude
= -180 degrees,
the longitude range is empty.
If low.latitude
> 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
}
}
Protobuf type google.geo.type.Viewport
Static Fields
HIGH_FIELD_NUMBER
public static final int HIGH_FIELD_NUMBER
Field Value
LOW_FIELD_NUMBER
public static final int LOW_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Viewport getDefaultInstance ()
Returns
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Returns
newBuilder()
public static Viewport . Builder newBuilder ()
Returns
newBuilder(Viewport prototype)
public static Viewport . Builder newBuilder ( Viewport prototype )
Parameter
Returns
public static Viewport parseDelimitedFrom ( InputStream input )
Parameter
Returns
Exceptions
public static Viewport parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Viewport parseFrom ( byte [] data )
Parameter
Name Description data
byte []
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Viewport parseFrom ( ByteString data )
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
public static Viewport parseFrom ( CodedInputStream input )
Parameter
Returns
Exceptions
public static Viewport parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
public static Viewport parseFrom ( InputStream input )
Parameter
Returns
Exceptions
public static Viewport parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Viewport parseFrom ( ByteBuffer data )
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
Parameters
Returns
Exceptions
parser()
public static Parser<Viewport> parser ()
Returns
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Returns
Overrides
getDefaultInstanceForType()
public Viewport getDefaultInstanceForType ()
Returns
getHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns
Type Description LatLng
The high.
getHighOrBuilder()
public LatLngOrBuilder getHighOrBuilder ()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns
getLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
getLowOrBuilder()
public LatLngOrBuilder getLowOrBuilder ()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
getParserForType()
public Parser<Viewport> getParserForType ()
Returns
Overrides
getSerializedSize()
public int getSerializedSize ()
Returns
Overrides
getUnknownFields()
public final UnknownFieldSet getUnknownFields ()
Returns
Overrides
hasHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns
Type Description boolean
Whether the high field is set.
hasLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
Type Description boolean
Whether the low field is set.
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Returns
Overrides
isInitialized()
public final boolean isInitialized ()
Returns
Overrides
newBuilderForType()
public Viewport . Builder newBuilderForType ()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Viewport . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Parameter
Returns
Overrides
toBuilder()
public Viewport . Builder toBuilder ()
Returns
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Parameter
Overrides
Exceptions
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-27 UTC.
Need to tell us more?
[[["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-01-27 UTC."],[],[]]