2013-12-10 44 views
0

我想爲雜貨店創建一個目錄應用程序。我已經有了這個地方的平面圖。我只是想在視圖中顯示它,我想把一些標記/插針/圖像放在它上面..我不知道從哪裏開始。有人告訴我使用位圖和遊說,但我不知道如何使用它作爲谷歌的其他教程是相當模糊,很難理解..顯示自定義地圖並在地圖上放置圖釘/圖像

什麼我的應用程序要求:

  • 顯示的自從圖像源地圖
  • 讓我放標誌物,引腳和一些圖片上的這

回答

1

一個簡單的方法頂部是用使用的ImageView:

//使從floorPlanImage,例如從位圖文件 Bitmap floorPlanImage = BitmapFactory.decodeFile(filePath, options); //做一個可變的位圖,所以它是可以改變的 Bitmap mutableFloorPlanImage = floorPlanImage.copy(Bitmap.Config.ARGB_8888, true); //創建一個帆布畫上你floorPlanImage Canvas mCanvas = new Canvas(mutableFloorPlanImage); //畫一個標記或在floorPlanImage另一個圖像,您可以使用左和頂部//座標來定位它,在本示例中,兩個都是0 mCanvas.drawBitmap(markerBitmap, 0, 0, null); //顯示ImageView中的最終位圖 imageView.setImageBitmap(mutableFloorPlanImage);