PolygonApi.java 文件源码

java
阅读 37 收藏 0 点赞 0 评论 0

项目:android-api 作者:
@WorkerThread
public int create(PolygonOptions polygonOptions, Polygon.AllowHandleAccess allowHandleAccess) throws InvalidParameterException {
    if (allowHandleAccess == null)
        throw new NullPointerException("Null access token. Method is intended for internal use by Polygon");

    if (polygonOptions.getPoints().size() < 2)
        throw new InvalidParameterException("PolygonOptions points must contain at least two elements");

    List<LatLng> exteriorPoints = polygonOptions.getPoints();
    List<List<LatLng>> holes = polygonOptions.getHoles();

    final int[] ringVertexCounts = buildRingVertexCounts(exteriorPoints, holes);
    final double[] allPointsDoubleArray = buildPointsArray(exteriorPoints, holes, ringVertexCounts);

    return nativeCreatePolygon(
            m_jniEegeoMapApiPtr,
            polygonOptions.getIndoorMapId(),
            polygonOptions.getIndoorFloorId(),
            polygonOptions.getElevation(),
            polygonOptions.getElevationMode().ordinal(),
            allPointsDoubleArray,
            ringVertexCounts,
            polygonOptions.getFillColor()
    );
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号