古いアプリケーションをv1からv2に変換しています。マーカーの色に問題があります。私は基本的な白いアイコンを持っていて、色付けする必要があります。 V1でGoogle Maps Android API v2のマーカーの色を変更するために描画可能なものをビットマップに変換する
、私はそれをこのように行った:
Drawable d = DrawableUtils.resizeImageToDrawable(
MapViewFragment.mapviewActivity,
Configuration.Display.getDrawableFix(i),
Configuration.MapView.getWaypointIconWidth(),
Configuration.MapView.getWaypointIconHeight());
d.setColorFilter(color, Mode.MULTIPLY);
overlay = new MyFplnFixListItimizedOverlay(d);
v2のマーカーは、そのアイコンのドローアブルを受け入れていないので、私はこのように、ビットマップにDrawableの変換について考えた:
Drawable d = DrawableUtils.resizeImageToDrawable(
MapViewFragment.mapviewActivity,
Configuration.Display.getDrawableFix(i),
Configuration.MapView.getWaypointIconWidth(),
Configuration.MapView.getWaypointIconHeight());
d.setColorFilter(color, Mode.MULTIPLY);
Bitmap icon = ((BitmapDrawable) d).getBitmap();
Marker marker = MapViewFragment.map.addMarker(new MarkerOptions()
.position(point)
.title(Integer.toString(fplnType))
.visible(true)
.icon(BitmapDescriptorFactory.fromBitmap(icon)));
何らかの理由で、動作しません。アイコンは白色のままです。なぜ誰も知っていますか?
ありがとうございます。
共有いただきありがとうございます。あなたはOutOfMemoryExceptionsを処理しなければなりませんでしたか? – sealskej