MarkerItem: change UID to hold Object
This commit is contained in:
parent
025c482725
commit
2df9e8fccc
@ -181,7 +181,7 @@ public class ItemizedLayer<Item extends MarkerItem> extends MarkerLayer<Item>
|
||||
for (int i = 0; i < size; i++) {
|
||||
Item item = mItemList.get(i);
|
||||
|
||||
if (!bbox.contains(item.mGeoPoint))
|
||||
if (!bbox.contains(item.geoPoint))
|
||||
continue;
|
||||
|
||||
mapPosition.toScreenPoint(item.getPoint(), mTmpPoint);
|
||||
@ -243,4 +243,12 @@ public class ItemizedLayer<Item extends MarkerItem> extends MarkerLayer<Item>
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public Item getByUid(Object uid) {
|
||||
for (Item it : mItemList)
|
||||
if (it.getUid() == uid)
|
||||
return it;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -45,10 +45,10 @@ public class MarkerItem {
|
||||
UPPER_LEFT_CORNER, LOWER_LEFT_CORNER
|
||||
}
|
||||
|
||||
public final String mUid;
|
||||
public final String mTitle;
|
||||
public final String mDescription;
|
||||
public final GeoPoint mGeoPoint;
|
||||
public final Object uid;
|
||||
public final String title;
|
||||
public final String description;
|
||||
public final GeoPoint geoPoint;
|
||||
protected MarkerSymbol mMarker;
|
||||
|
||||
/**
|
||||
@ -56,34 +56,32 @@ public class MarkerItem {
|
||||
* this should be <b>singleLine</b> (no <code>'\n'</code> )
|
||||
* @param description
|
||||
* a <b>multiLine</b> description ( <code>'\n'</code> possible)
|
||||
* @param geoPoint
|
||||
* ...
|
||||
*/
|
||||
public MarkerItem(String title, String description, GeoPoint geoPoint) {
|
||||
this(null, title, description, geoPoint);
|
||||
}
|
||||
|
||||
public MarkerItem(String uid, String title, String description, GeoPoint geoPoint) {
|
||||
mTitle = title;
|
||||
mDescription = description;
|
||||
mGeoPoint = geoPoint;
|
||||
mUid = uid;
|
||||
public MarkerItem(Object uid, String title, String description, GeoPoint geoPoint) {
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.geoPoint = geoPoint;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return mUid;
|
||||
public Object getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return mTitle;
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getSnippet() {
|
||||
return mDescription;
|
||||
return description;
|
||||
}
|
||||
|
||||
public GeoPoint getPoint() {
|
||||
return mGeoPoint;
|
||||
return geoPoint;
|
||||
}
|
||||
|
||||
public MarkerSymbol getMarker() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user