当前位置: 首页>>代码示例>>Java>>正文


Java Polygon.setVisible方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.model.Polygon.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Polygon.setVisible方法的具体用法?Java Polygon.setVisible怎么用?Java Polygon.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.model.Polygon的用法示例。


在下文中一共展示了Polygon.setVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addToMap

import com.google.android.gms.maps.model.Polygon; //导入方法依赖的package包/类
/**
 * Adds a single geometry object to the map with its specified style
 *
 * @param geometry defines the type of object to add to the map
 * @param style    defines styling properties to add to the object when added to the map
 * @return the object that was added to the map, this is a Marker, Polyline, Polygon or an array
 * of either objects
 */
private Object addToMap(KmlPlacemark placemark, KmlGeometry geometry, KmlStyle style,
        KmlStyle inlineStyle, boolean isVisible) {

    String geometryType = geometry.getGeometryType();
    if (geometryType.equals("Point")) {
        Marker marker = addPointToMap(placemark, (KmlPoint) geometry, style, inlineStyle);
        marker.setVisible(isVisible);
        return marker;
    } else if (geometryType.equals("LineString")) {
        Polyline polyline = addLineStringToMap((KmlLineString) geometry, style, inlineStyle);
        polyline.setVisible(isVisible);
        return polyline;
    } else if (geometryType.equals("Polygon")) {
        Polygon polygon = addPolygonToMap((KmlPolygon) geometry, style, inlineStyle);
        polygon.setVisible(isVisible);
        return polygon;
    } else if (geometryType.equals("MultiGeometry")) {
        return addMultiGeometryToMap(placemark, (KmlMultiGeometry) geometry, style, inlineStyle,
                isVisible);
    }

    return null;
}
 
开发者ID:josegury,项目名称:AndroidMarkerClusteringMaps,代码行数:32,代码来源:KmlRenderer.java

示例2: setVisible

import com.google.android.gms.maps.model.Polygon; //导入方法依赖的package包/类
public void setVisible(boolean visible) {
    Log.d(TAG, "set visible " + visible);
    backgroundTileOverlay.setVisible(visible);

    if (polygonOptions == null) {
        Log.d(TAG, "waiting for polygons");
        waitingForPolygons.add(this);
        return;
    }
    else if (polygons == null) {
        polygonsReady();
    }
    else {
        for (Polygon polygon : polygons) {
            polygon.setVisible(visible);
        }
    }
}
 
开发者ID:ngageoint,项目名称:disconnected-content-explorer-android,代码行数:19,代码来源:OfflineMap.java

示例3: 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());
}
 
开发者ID:Ubudu,项目名称:GoogleMapsLayout-Android,代码行数:43,代码来源:MapLayout.java

示例4: addKmlPlacemarkToMap

import com.google.android.gms.maps.model.Polygon; //导入方法依赖的package包/类
/**
 * Adds a single geometry object to the map with its specified style (used for KML)
 *
 * @param geometry defines the type of object to add to the map
 * @param style    defines styling properties to add to the object when added to the map
 * @return the object that was added to the map, this is a Marker, Polyline, Polygon or an array
 * of either objects
 */
protected Object addKmlPlacemarkToMap(KmlPlacemark placemark, Geometry geometry, KmlStyle style,
                                      KmlStyle inlineStyle, boolean isVisible) {
    String geometryType = geometry.getGeometryType();
    boolean hasDrawOrder = placemark.hasProperty("drawOrder");
    float drawOrder = 0;

    if (hasDrawOrder) {
        try {
            drawOrder = Float.parseFloat(placemark.getProperty("drawOrder"));
        } catch (NumberFormatException e) {
            hasDrawOrder = false;
        }
    }
    switch (geometryType) {
        case "Point":
            MarkerOptions markerOptions = style.getMarkerOptions();
            if (inlineStyle != null) {
                setInlinePointStyle(markerOptions, inlineStyle, style.getIconUrl());
            } else if (style.getIconUrl() != null) {
                // Use shared style
                addMarkerIcons(style.getIconUrl(), markerOptions);
            }
            Marker marker = addPointToMap(markerOptions, (KmlPoint) geometry);
            marker.setVisible(isVisible);
            setMarkerInfoWindow(style, marker, placemark);
            if (hasDrawOrder) {
                marker.setZIndex(drawOrder);
            }
            return marker;
        case "LineString":
            PolylineOptions polylineOptions = style.getPolylineOptions();
            if (inlineStyle != null) {
                setInlineLineStringStyle(polylineOptions, inlineStyle);
            } else if (style.isLineRandomColorMode()) {
                polylineOptions.color(KmlStyle.computeRandomColor(polylineOptions.getColor()));
            }
            Polyline polyline = addLineStringToMap(polylineOptions, (LineString) geometry);
            polyline.setVisible(isVisible);
            if (hasDrawOrder) {
                polyline.setZIndex(drawOrder);
            }
            return polyline;
        case "Polygon":
            PolygonOptions polygonOptions = style.getPolygonOptions();
            if (inlineStyle != null) {
                setInlinePolygonStyle(polygonOptions, inlineStyle);
            } else if (style.isPolyRandomColorMode()) {
                polygonOptions.fillColor(KmlStyle.computeRandomColor(polygonOptions.getFillColor()));
            }
            Polygon polygon = addPolygonToMap(polygonOptions, (DataPolygon) geometry);
            polygon.setVisible(isVisible);
            if (hasDrawOrder) {
                polygon.setZIndex(drawOrder);
            }
            return polygon;
        case "MultiGeometry":
            return addMultiGeometryToMap(placemark, (KmlMultiGeometry) geometry, style, inlineStyle,
                    isVisible);
    }
    return null;
}
 
开发者ID:googlemaps,项目名称:android-maps-utils,代码行数:70,代码来源:Renderer.java

示例5: setVisible

import com.google.android.gms.maps.model.Polygon; //导入方法依赖的package包/类
/**
 * Set visibility on the map
 *
 * @param visible visibility flag
 * @since 1.3.2
 */
public void setVisible(boolean visible) {
    for (Polygon polygon : polygons) {
        polygon.setVisible(visible);
    }
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:12,代码来源:MultiPolygon.java


注:本文中的com.google.android.gms.maps.model.Polygon.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。