Fleshing out Android Annotation API, working on removing annotations through JNI.

This commit is contained in:
Nicholas Hallahan
2015-07-14 10:45:29 -07:00
parent f710e9607a
commit 1ac1ba0e18
13 changed files with 381 additions and 6 deletions

View File

@@ -23,6 +23,8 @@ import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import com.mapbox.mapboxgl.annotations.Marker;
import com.mapbox.mapboxgl.annotations.MarkerOptions;
import com.mapbox.mapboxgl.geometry.LatLng;
import com.mapbox.mapboxgl.views.MapView;
import com.mapzen.android.lost.api.LocationListener;
@@ -80,6 +82,8 @@ public class MainActivity extends ActionBarActivity {
// Used for markers
private boolean mIsMarkersOn = false;
private Marker marker;
//
// Lifecycle events
//
@@ -272,14 +276,22 @@ public class MainActivity extends ActionBarActivity {
} else {
if (mIsMarkersOn) {
mIsMarkersOn = false;
removeMarkers();
}
}
}
private void addMarkers() {
LatLng backLot = new LatLng(38.649441, -121.369064);
mMapFragment.getMap().addMarker(backLot);
MapView map = mMapFragment.getMap();
marker = map.addMarker(new MarkerOptions()
.position(backLot)
.title("Back Lot")
.snippet("The back lot behind my house"));
}
private void removeMarkers() {
marker.remove();
}
// This class forwards location updates to updateLocation()