Search in sources :

Example 1 with MapPinDrawable

use of greendroid.graphics.drawable.MapPinDrawable in project GreenDroid by cyrilmottier.

the class MapPinMapActivity method onCreate.

//@formatter:on
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setActionBarContentView(R.layout.map_pin);
    final MapView mapView = (MapView) findViewById(R.id.map_view);
    mapView.setBuiltInZoomControls(true);
    final Resources r = getResources();
    for (int i = 0; i < sAreas.length; i++) {
        final OverlayItem[] items = sAreas[i];
        ColorStateList pinCsl = createRandomColorStateList();
        ColorStateList dotCsl = createRandomColorStateList();
        BasicItemizedOverlay itemizedOverlay = new BasicItemizedOverlay(new MapPinDrawable(r, pinCsl, dotCsl));
        for (int j = 0; j < items.length; j++) {
            itemizedOverlay.addOverlay(items[j]);
        }
        mapView.getOverlays().add(itemizedOverlay);
    }
}
Also used : OverlayItem(com.google.android.maps.OverlayItem) MapView(com.google.android.maps.MapView) ColorStateList(android.content.res.ColorStateList) Resources(android.content.res.Resources) GeoPoint(com.google.android.maps.GeoPoint) MapPinDrawable(greendroid.graphics.drawable.MapPinDrawable)

Aggregations

ColorStateList (android.content.res.ColorStateList)1 Resources (android.content.res.Resources)1 GeoPoint (com.google.android.maps.GeoPoint)1 MapView (com.google.android.maps.MapView)1 OverlayItem (com.google.android.maps.OverlayItem)1 MapPinDrawable (greendroid.graphics.drawable.MapPinDrawable)1