LoginSignup
0
0

More than 5 years have passed since last update.

osmbonuspack を使ってAndroid の OpenStreetMap 地図の KML の スタイルを変更する

Last updated at Posted at 2019-02-08

osmbonuspack を使ってAndroid の OpenStreetMap 地図に KML をインポートする
の続きです

osmbonuspack では、XML ファイルにより、使用されるスタイルが異なります

スタイルを持つ XML ファイル

XML ファイルのスタイルが使用される
xml_style.png

 スタイルを持たない XML ファイル

osmbonuspack のデファルトの XML スタイルが使用される
xml_default_icon.png

 osmbonuspack の KML スタイルを変更する

Drawable newMarker = getResources().getDrawable( R.drawable.new_marker );

Bitmap newIcon  = ( (BitmapDrawable)newMarker ).getBitmap();

Style newStyle = new Style( newIcon, 0x901010AA, 3.0, 0x20AA1010 );

        FolderOverlay kmlOverlay = (FolderOverlay)kmlDocument.mKmlRoot.buildOverlay(mMapView, newStyle, null, kmlDocument);

xml_custom_icon.png

github にソースを公開した

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0