diff options
author | Goblin911 <[email protected]> | 2013-08-28 16:32:26 +0800 |
---|---|---|
committer | Goblin911 <[email protected]> | 2013-08-28 16:32:26 +0800 |
commit | 68ed59a88f2409f632c3731c0e5dc246713676a2 (patch) | |
tree | c0f7ba850655ed4ce0e95a5a7815541cbe24f4c9 /client/Piztor/src/com/macaroon/piztor/MapMaker.java | |
parent | 0a8315a94d8ed1252f3f96d4ca41ddc632c3bc98 (diff) |
Fixed screen-rotation bug
Diffstat (limited to 'client/Piztor/src/com/macaroon/piztor/MapMaker.java')
-rw-r--r-- | client/Piztor/src/com/macaroon/piztor/MapMaker.java | 31 |
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(); + } + } } |