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


Java PolylineOptions.getPoints方法代码示例

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


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

示例1: updateMap

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
public void updateMap(GoogleMap map, PolylineOptions options)
{

    GeoJsonLayer x = new GeoJsonLayer(map,new JSONObject());

    GeoJsonLineString linestring = new GeoJsonLineString(options.getPoints());
    GeoJsonFeature linestringFeature = new GeoJsonFeature(linestring, "Path", null, null);
    x.addFeature(linestringFeature);

    x.addLayerToMap();
}
 
开发者ID:carlosfaria94,项目名称:UbiBike-client,代码行数:12,代码来源:DisplayRoute.java

示例2: updateMap

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 * Adds a GeoJSON layer to the referenced map.
 * The layer contains info on the user's current path, which is updated using the user's current location.
 * A PolylineOptions object is used to store all the positions necessary to build the track.
 */
public void updateMap(GoogleMap map, PolylineOptions options, Location location)
{

    GeoJsonLayer x = new GeoJsonLayer(map,new JSONObject());
    options.add(new LatLng(location.getLatitude(),location.getLongitude()));

    GeoJsonLineString linestring = new GeoJsonLineString(options.getPoints());
    GeoJsonFeature linestringFeature = new GeoJsonFeature(linestring, "Path", null, null);
    x.addFeature(linestringFeature);

    x.addLayerToMap();
}
 
开发者ID:carlosfaria94,项目名称:UbiBike-client,代码行数:18,代码来源:MapsActivity.java

示例3: addPolyline

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 *
 * @param polylineOptions polylineOptions to add
 * @return true if polylineOptions has been added to the path, false if last point of the path does not match first point in the given polylineOptions
 */
public boolean addPolyline(PolylineOptions polylineOptions) {
    if(getLastPoint()==null || polylineOptions.getPoints()!=null
            && polylineOptions.getPoints().size()>0
            && polylineOptions.getPoints().get(0).equals(getLastPoint())) {
        edges.add(polylineOptions);
        return true;
    }
    return false;
}
 
开发者ID:Ubudu,项目名称:GoogleMapsLayout-Android,代码行数:15,代码来源:Path.java

示例4: addPolylineToPath

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 *
 * NOTE: cannot draw a polyline if there are no points, or only single point, specified in the PolylineOptions given as argument
 *
 * @param uuid path uuid
 * @param polylineOptions polyline options
 * @return true if polyline has been successfully added to Google Maps, false otherwise
 */
public boolean addPolylineToPath(String uuid, PolylineOptions polylineOptions) {

    if(polylineOptions.getPoints()==null || polylineOptions.getPoints().size()<2) {
        // cannot draw a polyline because there are no points or only single point
        return false;
    }

    polylineOptions.zIndex(POLYLINE_Z_INDEX);

    Path path = getPathWithUuid(uuid);
    // if path does not exist, create it
    if(path==null) {
        path = new Path(uuid);
        pathVsPolylinesMap.put(path,new ArrayList<Polyline>());
    }
    // add polyline
    path.addPolyline(polylineOptions);
    // get all polyline objects already drawn on Google Maps
    List<Polyline> polylines = pathVsPolylinesMap.get(path);
    // add to Google Maps the new polyline described by the given poliylineOptions object
    Polyline polyline = addPolylineToGoogleMap(polylineOptions);
    // add newly added polyline object to the list
    polylines.add(polyline);
    // update the mapping
    pathVsPolylinesMap.put(path,polylines);

    return true;
}
 
开发者ID:Ubudu,项目名称:GoogleMapsLayout-Android,代码行数:37,代码来源:MapLayout.java

示例5: OsmPolyline

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
public OsmPolyline(PolylineOptions polylineOptions, MapView osmMap) {
    this.osmMap = osmMap;
    org.osmdroid.views.overlay.Polyline polyline = new org.osmdroid.views.overlay.Polyline();
    polyline.setColor(polylineOptions.getColor());
    polyline.setVisible(polylineOptions.isVisible());
    ArrayList<GeoPoint> points = new ArrayList<>();
    for (LatLng latlng : polylineOptions.getPoints()){
        points.add(new GeoPoint(latlng.latitude,latlng.longitude));
    }
    polyline.setPoints(points);
    polyline.setWidth(polylineOptions.getWidth());
    osmMap.getOverlayManager().add(polyline);
    osmMap.invalidate();
    osmPolyline = polyline;
}
 
开发者ID:RSDT,项目名称:Japp16,代码行数:16,代码来源:OsmPolyline.java

示例6: calcBikePathDitance

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
public float calcBikePathDitance (){
    float distance = 0;
    ArrayList <LatLng> pathPoints;
    for (PolylineOptions path : totalInRoutePaths){
        pathPoints = (ArrayList) path.getPoints();
        for (int i = 0; i < pathPoints.size() - 1; i++){
            distance += calcDistanceBetweenPoints(pathPoints.get(i), pathPoints.get(i+1));
        }
    }

    return distance;
}
 
开发者ID:nogalavi,项目名称:Bikeable,代码行数:13,代码来源:BikePathCalculator.java

示例7: checkIfPathInSquare

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
public boolean checkIfPathInSquare (PolylineOptions path) {
    ArrayList <LatLng> pathPoints = (ArrayList)path.getPoints();
    int numOfPointsInPath = pathPoints.size();
    if (checkIfPointInSquare (pathPoints.get(0)) || checkIfPointInSquare (pathPoints.get(numOfPointsInPath - 1)) ||
            checkIfPointInSquare(pathPoints.get(numOfPointsInPath/2))){
        return true;
    }
    return false;
}
 
开发者ID:nogalavi,项目名称:Bikeable,代码行数:10,代码来源:BikePathCalculator.java


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