本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}