本文整理匯總了Java中com.google.android.gms.maps.model.Polygon.setClickable方法的典型用法代碼示例。如果您正苦於以下問題:Java Polygon.setClickable方法的具體用法?Java Polygon.setClickable怎麽用?Java Polygon.setClickable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.Polygon
的用法示例。
在下文中一共展示了Polygon.setClickable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: refreshZone
import com.google.android.gms.maps.model.Polygon; //導入方法依賴的package包/類
/**
* Refreshes the polygon and label marker of the given zone according to zone's appearance options.
*
* @param zone zone object
*/
private void refreshZone(Zone zone) {
Pair<Marker,Polygon> markerAndPolygon = zoneVsMarkerAndPolygonMap.get(zone);
ZoneOptions zoneOptions = zone.getOptions();
//update polygon
Polygon p = markerAndPolygon.second;
PolygonOptions polygonOptions = zoneOptions.getPolygonOptions();
p.setStrokeColor(polygonOptions.getStrokeColor());
p.setStrokeWidth(polygonOptions.getStrokeWidth());
p.setFillColor(polygonOptions.getFillColor());
p.setGeodesic(polygonOptions.isGeodesic());
p.setHoles(polygonOptions.getHoles());
p.setVisible(polygonOptions.isVisible());
p.setZIndex(polygonOptions.getZIndex());
p.setClickable(polygonOptions.isClickable());
Log.i(TAG,"updated polygon id: "+p.getId());
//update label marker
Marker m = markerAndPolygon.first;
ZoneLabelOptions zoneLabelOptions = zoneOptions.getZoneLabelOptions();
MarkerOptions mO = zoneLabelOptions.getLabelMarkerOptions();
if(zoneLabelOptions.isDisplayLabel())
mO.icon(BitmapDescriptorFactory.fromBitmap(getLabelBitmap(zone.getName(),zoneLabelOptions)));
m.setIcon(mO.getIcon());
m.setZIndex(mO.getZIndex());
m.setVisible(mO.isVisible());
m.setAlpha(mO.getAlpha());
m.setAnchor(mO.getAnchorV(),mO.getAnchorU());
m.setDraggable(mO.isDraggable());
m.setFlat(mO.isFlat());
m.setInfoWindowAnchor(mO.getInfoWindowAnchorV(),mO.getInfoWindowAnchorU());
m.setRotation(mO.getRotation());
m.setSnippet(mO.getSnippet());
m.setTitle(zone.getName());
}
示例2: addPolygonToMap
import com.google.android.gms.maps.model.Polygon; //導入方法依賴的package包/類
/**
* Adds a DataPolygon to the map as a Polygon
*
* @param polygonOptions
* @param polygon contains coordinates for the Polygon
* @return Polygon object created from given DataPolygon
*/
protected Polygon addPolygonToMap(PolygonOptions polygonOptions, DataPolygon polygon) {
// First array of coordinates are the outline
polygonOptions.addAll(polygon.getOuterBoundaryCoordinates());
// Following arrays are holes
List<List<LatLng>> innerBoundaries = polygon.getInnerBoundaryCoordinates();
for (List<LatLng> innerBoundary : innerBoundaries) {
polygonOptions.addHole(innerBoundary);
}
Polygon addedPolygon = mMap.addPolygon(polygonOptions);
addedPolygon.setClickable(true);
return addedPolygon;
}