A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/android/reference/com/google/android/gms/maps/model/GroundOverlay below:

GroundOverlay | Google Play services

GroundOverlay

Stay organized with collections Save and categorize content based on your preferences.

A ground overlay is an image that is fixed to a map. A ground overlay has the following properties:

Position
There are two ways to specify the position of the ground overlay: You must specify the position of the ground overlay before it is added to the map, otherwise an IllegalArgumentException will be thrown when the ground overlay is added to the map. Furthermore, you must only specify the position using one of these methods in the GroundOverlayOptions object; otherwise an IllegalStateException will be thrown when specifying using a second method.
Image
The image (as an BitmapDescriptor) to be used for this overlay. The image will be scaled to fit the position provided. You must specify an image before adding the ground overlay to the map; if not an IllegalArgumentException will be thrown when it is added to the map.
Bearing
The amount that the image should be rotated in a clockwise direction. The center of the rotation will be the image's anchor. This is optional and the default bearing is 0, i.e., the image is aligned so that up is north.
zIndex
The order in which this ground overlay is drawn with respect to other overlays (including Polylines and TileOverlays, but not Markers). An overlay with a larger zIndex is drawn over overlays with smaller zIndexes. The order of overlays with the same zIndex value is arbitrary. This is optional and the default zIndex is 0.
Transparency
Transparency of the ground overlay in the range [0..1] where 0 means the overlay is opaque and 1 means the overlay is fully transparent. If the specified bitmap is already partially transparent, the transparency of each pixel will be scaled accordingly (for example, if a pixel in the bitmap has an alpha value of 200 and you specify the transparency of the ground overlay as 0.25, then the pixel will be rendered on the screen with an alpha value of 150). Specification of this property is optional and the default transparency is 0 (opaque).
Visibility
Indicates if the ground overlay is visible or invisible, i.e. whether it is drawn on the map. An invisible ground overlay is not drawn, but retains all of its other properties. This is optional and the default visibility is true, i.e., visible.
Clickability
If you want to handle events fired when the user clicks the ground overlay, set this property to true. You can change this value at any time. The default is false. If this property is set to true, your app will receive notifications to the GoogleMap.OnGroundOverlayClickListener registered through GoogleMap.setOnGroundOverlayClickListener(GoogleMap.OnGroundOverlayClickListener).
Tag
An Object associated with the ground overlay. For example, the Object can contain data about what the ground overlay represents. This is easier than storing a separate Map<GroundOverlay, Object>. As another example, you can associate a String ID corresponding to the ID from a data set. Google Maps SDK for Android neither reads nor writes this property.

Methods in this class must be called on the Android UI thread. If not, an IllegalStateException will be thrown at runtime.

Example
GoogleMap map = ...; // get a map.
 BitmapDescriptor imageDescriptor = ...; // get an image.
 LatLngBounds bounds = ...; // get a bounds
 // Adds a ground overlay with 50% transparency.
 GroundOverlay groundOverlay = map.addGroundOverlay(new GroundOverlayOptions()
     .image(imageDescriptor)
     .positionFromBounds(bounds)
     .transparency(0.5));
 
Public Method Summary boolean float getBearing

()

Gets the bearing of the ground overlay in degrees clockwise from north.

LatLngBounds getBounds

()

Gets the bounds for the ground overlay.

float getHeight

()

Gets the height of the ground overlay.

String getId

()

Gets this ground overlay's id.

LatLng Object getTag

()

Gets the tag for the circle.

float float getWidth

()

Gets the width of the ground overlay.

float getZIndex

()

Gets the zIndex of this ground overlay.

int boolean isClickable

()

Gets the clickability of the ground overlay.

boolean isVisible

()

Gets the visibility of this ground overlay.

void remove

()

Removes this ground overlay from the map.

void setBearing

(float bearing)

Sets the bearing of the ground overlay (the direction that the vertical axis of the ground overlay points) in degrees clockwise from north.

void setClickable

(boolean clickable)

Sets the clickability of the ground overlay.

void setDimensions

(float width, float height)

Sets the dimensions of the ground overlay.

void setDimensions

(float width)

Sets the width of the ground overlay.

void void setPosition

(

LatLng

latLng)

Sets the position of the ground overlay by changing the location of the anchor point.

void void void setTransparency

(float transparency)

Sets the transparency of this ground overlay.

void setVisible

(boolean visible)

Sets the visibility of this ground overlay.

void setZIndex

(float zIndex)

Sets the zIndex of this ground overlay.

Inherited Method Summary From class java.lang.Object Object

clone()

boolean void

finalize()

final Class<?>

getClass()

int

hashCode()

final void

notify()

final void

notifyAll()

String

toString()

final void

wait(long arg0, int arg1)

final void

wait(long arg0)

final void

wait()

Public Methods public boolean equals (Object other)

Tests if this GroundOverlay is equal to another.

Returns public float getBearing ()

Gets the bearing of the ground overlay in degrees clockwise from north.

Returns public LatLngBounds getBounds ()

Gets the bounds for the ground overlay. This ignores the rotation of the ground overlay.

Returns public float getHeight ()

Gets the height of the ground overlay.

Returns public String getId ()

Gets this ground overlay's id. The id will be unique amongst all GroundOverlays on a map.

Returns public LatLng getPosition ()

Gets the location of the anchor point.

Returns public Object getTag ()

Gets the tag for the circle.

Returns public float getTransparency ()

Gets the transparency of this ground overlay.

Returns public float getWidth ()

Gets the width of the ground overlay.

Returns public float getZIndex ()

Gets the zIndex of this ground overlay.

Returns public boolean isClickable () public boolean isVisible ()

Gets the visibility of this ground overlay. Note that this does not return whether the ground overlay is actually on screen, but whether it will be drawn if it is contained in the camera's viewport.

Returns public void remove ()

Removes this ground overlay from the map. After a ground overlay has been removed, the behavior of all its methods is undefined.

public void setBearing (float bearing)

Sets the bearing of the ground overlay (the direction that the vertical axis of the ground overlay points) in degrees clockwise from north. The rotation is performed about the anchor point.

Parameters bearing bearing in degrees clockwise from north public void setClickable (boolean clickable) public void setDimensions (float width, float height)

Sets the dimensions of the ground overlay. The image will be stretched to fit the dimensions.

Parameters width width in meters height height in meters public void setDimensions (float width)

Sets the width of the ground overlay. The height of the ground overlay will be adapted accordingly to preserve aspect ratio.

public void setImage (BitmapDescriptor imageDescriptor)

Sets the image for the Ground Overlay. The new image will occupy the same bounds as the old image.

public void setPosition (LatLng latLng)

Sets the position of the ground overlay by changing the location of the anchor point. Preserves all other properties of the image.

Parameters latLng a LatLng that is the new location to place the anchor point. public void setPositionFromBounds (LatLngBounds bounds)

Sets the position of the ground overlay by fitting it to the given LatLngBounds. This method will ignore the rotation (bearing) of the ground overlay when positioning it, but the bearing will still be used when drawing it.

public void setTag (Object tag)

Sets the tag for the ground overlay.

You can use this property to associate an arbitrary Object with this ground overlay. For example, the Object can contain data about what the ground overlay represents. This is easier than storing a separate Map<GroundOverlay, Object>. As another example, you can associate a String ID corresponding to the ID from a data set. Google Maps SDK for Android neither reads nor writes this property. It is your responsibility to call setTag(null) to clear the tag when you no longer need it, to prevent memory leaks in your app.

Parameters tag if null, the tag is cleared. public void setTransparency (float transparency)

Sets the transparency of this ground overlay. See the documentation at the top of this class for more information.

Parameters transparency a float in the range [0..1] where 0 means that the ground overlay is opaque and 1 means that the ground overlay is transparent. public void setVisible (boolean visible)

Sets the visibility of this ground overlay. When not visible, a ground overlay is not drawn, but it keeps all of its other properties.

Parameters visible if true, then the ground overlay is visible; if false, it is not public void setZIndex (float zIndex)

Sets the zIndex of this ground overlay. See the documentation at the top of this class for more information.

Parameters zIndex the zIndex of this ground overlay

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 2024-10-31 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["A GroundOverlay is an image that is fixed to a specific location or area on a Google Map, allowing for the display of custom imagery."],["GroundOverlays can be customized using properties such as position, image, bearing, transparency, visibility, and z-index."],["Developers can interact with GroundOverlays through methods like `setPosition()`, `setImage()`, `setTransparency()`, and more, to control their appearance and behavior."],["GroundOverlays provide features like clickability and custom data storage through tags, enabling interactive elements and data association."],["It's essential to use methods on the UI thread, set the position and image before adding to the map, and manage data tags carefully to prevent errors and memory leaks."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4