2013-04-30 76 views

回答

0

您可以使用GroundOverlayOptions對象在地圖上設置圖像。與.positionFromBounds(bounds)一起,您應該能夠覆蓋您的特定區域。

看一看 https://developers.google.com/maps/documentation/android-api/groundoverlay

代碼示例:

LatLng NEWARK = new LatLng(40.714086, -74.228697); 

GroundOverlayOptions newarkMap = new GroundOverlayOptions() 
      .image(BitmapDescriptorFactory.fromResource(R.drawable.newark_nj_1922)) 
     .position(NEWARK, 8600f, 6500f); 
map.addGroundOverlay(newarkMap); 

您也可以考慮Shapeshttps://developers.google.com/maps/documentation/android-api/shapes

// Instantiates a new Polygon object and adds points to define a rectangle 
PolygonOptions rectOptions = new PolygonOptions() 
      .add(new LatLng(37.35, -122.0), 
       new LatLng(37.45, -122.0), 
       new LatLng(37.45, -122.2), 
       new LatLng(37.35, -122.2), 
       new LatLng(37.35, -122.0)); 

// Get back the mutable Polygon 
Polygon polygon = myMap.addPolygon(rectOptions); 
相關問題