diff options
author | Cameron Mace <cameron@mapbox.com> | 2016-12-01 08:48:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 08:48:25 -0500 |
commit | b1068b432ee17c14ea756b7c48be4c955303de95 (patch) | |
tree | a08c74f5db007a51581db1e3a3ef09adcac10898 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java | |
parent | 5f29c3ba26f84c8aea6f70640c348b32cdf397bf (diff) | |
download | qtlocation-mapboxgl-b1068b432ee17c14ea756b7c48be4c955303de95.tar.gz |
cherry-picked 7013 into master (#7247)
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java index 328ee1894c..282da6407e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java @@ -7,14 +7,13 @@ import android.os.Parcelable; import com.mapbox.mapboxsdk.exceptions.InvalidMarkerPositionException; import com.mapbox.mapboxsdk.geometry.LatLng; - /** * <p> - * Builder for composing {@link com.mapbox.mapboxsdk.annotations.Marker} objects. + * Builder for composing {@link Marker} objects. See {@link Marker} for additional information. * </p> * <h3>Example</h3> * <pre> - * mMapView.addMarker(new MarkerOptions() + * mapView.addMarker(new MarkerOptions() * .title("Intersection") * .snippet("H St NW with 15th St NW") * .position(new LatLng(38.9002073, -77.03364419))); @@ -22,6 +21,9 @@ import com.mapbox.mapboxsdk.geometry.LatLng; */ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions> implements Parcelable { + /** + * Defines options for a Marker. + */ public MarkerOptions() { } @@ -43,11 +45,24 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions return this; } + /** + * Describe the kinds of special objects contained in this Parcelable's + * marshalled representation. + * + * @return integer 0. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written. May be 0 or + * {@link #PARCELABLE_WRITE_RETURN_VALUE}. + */ @Override public void writeToParcel(Parcel out, int flags) { out.writeParcelable(getPosition(), flags); @@ -74,18 +89,39 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions return new Marker(position, icon, title, snippet); } + /** + * Returns the position set for this {@link MarkerOptions} object. + * + * @return A {@link LatLng} object specifying the marker's current position. + */ public LatLng getPosition() { return position; } + /** + * Gets the snippet set for this {@link MarkerOptions} object. + * + * @return A string containing the marker's snippet. + */ public String getSnippet() { return snippet; } + /** + * Gets the title set for this {@link MarkerOptions} object. + * + * @return A string containing the marker's title. + */ public String getTitle() { return title; } + /** + * Gets the custom icon set for this {@link MarkerOptions} object. + * + * @return A {@link Icon} object that the marker is using. If the icon wasn't set, default icon + * will return. + */ public Icon getIcon() { return icon; } @@ -101,6 +137,14 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions } }; + /** + * Compares this {@link MarkerOptions} object with another {@link MarkerOptions} and + * determines if their properties match. + * + * @param o Another {@link MarkerOptions} to compare with this object. + * @return True if marker properties match this {@link MarkerOptions} object. + * Else, false. + */ @Override public boolean equals(Object o) { if (this == o) return true; @@ -117,6 +161,14 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions return !(getTitle() != null ? !getTitle().equals(marker.getTitle()) : marker.getTitle() != null); } + /** + * Gives an integer which can be used as the bucket number for storing elements of the set/map. + * This bucket number is the address of the element inside the set/map. There's no guarantee + * that this hash value will be consistent between different Java implementations, or even + * between different execution runs of the same program. + * + * @return integer value you can use for storing element. + */ @Override public int hashCode() { int result = 1; |