I am trying to remove the markers added in google maps. I am able to
remove it by removing the overlayitem corresponding to the index from
the map. But when I try to save it this modification is not saved. I
am saving the coordinates using the function
public void saveCoordinates() {
mapOverlays = mapView.getOverlays();
GeoPointArrayList geopoints = new GeoPointArrayList();
geopoints.clear();
if (0 < mapOverlays.size()) {
for (int i = 0; i < mapOverlays.size(); i++) {
Overlay overlay = mapOverlays.get(i);
if (null != overlay) {
if (overlay instanceof
BalloonItemizedOverlay<?>) {
OverlayItem anItem =
((BalloonItemizedOverlay<?>) overlay)
.getItem(0);
if(anItem!=null){
point = anItem.getPoint();
GeoPointCoordinates coordinates
= new GeoPointCoordinates();
coordinates.setLatitude(point.getLatitudeE6());
coordinates.setLongitude(point.getLongitudeE6());
geopoints.add(coordinates);
}
}
}
}
DataStore.saveCoordinates(geopoints, this);
}
}
Is there any way in which I can clear the overlay corresponding to an
overlayitem. When I clear all the overlays in page using
MapView.getOverlays().clear() and then use the savecoordinates
function the details are correctly saved. Please advice me on how to
fix this issue?
Thanks,
Dijil
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en