Merge branch 'android_marker'
This commit is contained in:
Submodule vtm-android-app updated: 88d1b3ea76...3b8538de3c
@@ -30,6 +30,7 @@ import org.oscim.layers.marker.MarkerItem;
|
||||
import org.oscim.layers.marker.MarkerItem.HotspotPlace;
|
||||
import org.oscim.layers.marker.MarkerSymbol;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -44,9 +45,8 @@ public class MarkerOverlayActivity extends MapActivity implements OnItemGestureL
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
registerMapView(mMapView);
|
||||
|
||||
MarkerSymbol symbol = AndroidGraphics.makeMarker(getResources(),
|
||||
R.drawable.marker_poi,
|
||||
HotspotPlace.CENTER);
|
||||
Drawable d = getResources().getDrawable(R.drawable.marker_poi);
|
||||
MarkerSymbol symbol = AndroidGraphics.makeMarker(d, HotspotPlace.CENTER);
|
||||
|
||||
ItemizedIconLayer<MarkerItem> markerLayer =
|
||||
new ItemizedIconLayer<MarkerItem>(mMap, new ArrayList<MarkerItem>(),
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.oscim.backend.canvas.Paint;
|
||||
import org.oscim.layers.marker.MarkerItem.HotspotPlace;
|
||||
import org.oscim.layers.marker.MarkerSymbol;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap.Config;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -90,14 +89,10 @@ public final class AndroidGraphics extends CanvasAdapter {
|
||||
return new AndroidBitmap(bitmap);
|
||||
}
|
||||
|
||||
public static MarkerSymbol makeMarker(Resources res, int id, HotspotPlace place) {
|
||||
|
||||
public static MarkerSymbol makeMarker(Drawable drawable, HotspotPlace place) {
|
||||
if (place == null)
|
||||
place = HotspotPlace.CENTER;
|
||||
|
||||
Drawable drawable = res.getDrawable(id);
|
||||
|
||||
return new MarkerSymbol(drawableToBitmap(drawable), place);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user