summaryrefslogtreecommitdiff
path: root/client/Piztor/src/com/macaroon/piztor/MapMaker.java
diff options
context:
space:
mode:
Diffstat (limited to 'client/Piztor/src/com/macaroon/piztor/MapMaker.java')
-rw-r--r--client/Piztor/src/com/macaroon/piztor/MapMaker.java31
1 files changed, 16 insertions, 15 deletions
diff --git a/client/Piztor/src/com/macaroon/piztor/MapMaker.java b/client/Piztor/src/com/macaroon/piztor/MapMaker.java
index bdc3554..89f29fc 100644
--- a/client/Piztor/src/com/macaroon/piztor/MapMaker.java
+++ b/client/Piztor/src/com/macaroon/piztor/MapMaker.java
@@ -101,38 +101,39 @@ public class MapMaker extends Activity{
mMapView.getOverlays().add(mLocationOverlay);
mLocationOverlay.enableCompass();
mMapView.refresh();
+ mOverlay = new MyOverlay(context.getResources().getDrawable(R.drawable.circle_red), mMapView);
}
public void UpdateMap(MapInfo mapInfo) {
/**
- * Update Location Overlay
- */
- GeoPoint location = mapInfo.getMyInfo().getLocation();
- LocationData locationData = new LocationData();
- locationData.latitude = location.getLatitudeE6() / 1e6;
- locationData.longitude = location.getLongitudeE6() / 1e6;
- mLocationOverlay.setData(locationData);
- mMapView.refresh();
-
- /**
* Update location of others
*/
- mOverlay.removeAll();
+ if (mOverlay != null && mOverlay.getAllItem().size() != 0) {
+ System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ clearOverlay(mMapView);
+ System.out.println("+++++++++++++++++++++++------------------------------------------");
+ }
+ mOverlay = new MyOverlay(context.getResources().getDrawable(R.drawable.circle_red), mMapView);
//mMapView.refresh();
GeoPoint p;
Vector<UserInfo> allUsers = mapInfo.getVector();
-
+ System.out.println("SSSSSSSSSSSSSSSSize "+allUsers.size());
for(int i = 0; i < allUsers.size(); i++) {
+ if (allUsers.get(i).uid == Infomation.myInfo.uid) continue;
p = new GeoPoint((int)(allUsers.get(i).getLatitude() * 1E6)
,(int)(allUsers.get(i).getLongitude() * 1E6));
curItem = new OverlayItem(p, "^_^", "");
- curItem.setMarker(context.getResources().getDrawable(R.drawable.marka));
+ curItem.setMarker(context.getResources().getDrawable(R.drawable.circle_red));
mOverlay.addItem(curItem);
}
mItems = new ArrayList<OverlayItem>();
mItems.addAll(mOverlay.getAllItem());
- mMapView.getOverlays().add(mOverlay);
- mMapView.refresh();
+ if (mMapView != null) {
+ if (mMapView.getOverlays() != null) {
+ mMapView.getOverlays().add(mOverlay);
+ mMapView.refresh();
+ }
+ }
}