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);
}
}
Aggregations