Skip to content

Commit

Permalink
marker equals method mapbox#1716
Browse files Browse the repository at this point in the history
  • Loading branch information
hallahan committed Jul 17, 2015
1 parent 5363fc8 commit 0f56c2b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@ public class Marker extends Annotation {

public Marker() {}

/**
* If two markers have the same LatLng, they are equal.
*
* @param other object
* @return boolean - do they have the same LatLng
*/
public boolean equals(Object other) {
if (!(other instanceof Marker)) return false;
double lat = position.getLatitude();
double lng = position.getLongitude();
// TODO Implement equals
return false;
LatLng otherPosition = ((Marker)other).getPosition();
double otherLat = otherPosition.getLatitude();
double otherLng = otherPosition.getLongitude();
return (lat == otherLat && otherLng == lng);
}

public float getAlpha() {
Expand Down

0 comments on commit 0f56c2b

Please sign in to comment.