本文整理匯總了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;
}