本文整理匯總了Java中com.google.android.gms.maps.model.PolylineOptions.geodesic方法的典型用法代碼示例。如果您正苦於以下問題:Java PolylineOptions.geodesic方法的具體用法?Java PolylineOptions.geodesic怎麽用?Java PolylineOptions.geodesic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.PolylineOptions
的用法示例。
在下文中一共展示了PolylineOptions.geodesic方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addPolylineToMapAsMarkers
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
/**
* Add a Polyline to the map as markers
*
* @param map
* @param polylineOptions
* @param polylineMarkerOptions
* @param globalPolylineOptions
* @return
*/
public PolylineMarkers addPolylineToMapAsMarkers(GoogleMap map,
PolylineOptions polylineOptions,
MarkerOptions polylineMarkerOptions,
PolylineOptions globalPolylineOptions) {
PolylineMarkers polylineMarkers = new PolylineMarkers(this);
if (globalPolylineOptions != null) {
polylineOptions.color(globalPolylineOptions.getColor());
polylineOptions.geodesic(globalPolylineOptions.isGeodesic());
}
Polyline polyline = addPolylineToMap(map, polylineOptions);
polylineMarkers.setPolyline(polyline);
List<Marker> markers = addPointsToMapAsMarkers(map,
polylineOptions.getPoints(), polylineMarkerOptions, false);
polylineMarkers.setMarkers(markers);
return polylineMarkers;
}
示例2: drawSubsection
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
public static void drawSubsection(GoogleMap map, List<LatLng> coords, int startIndex, int endIndex, int color){
if(sectionPolyline != null){
sectionPolyline.remove();
}
PolylineOptions line = new PolylineOptions();
line.geodesic(true);
line.width(14);
line.zIndex(100);
line.color(color);
int start = startIndex;
int end = endIndex;
if(startIndex > endIndex){
int temp = startIndex;
start = endIndex;
end = temp;
}
for(LatLng ll : coords.subList(start, end)){
line.add(ll);
}
sectionPolyline = map.addPolyline(line);
}
示例3: addPolylinesToMap
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
/**
* Add a list of Polylines to the map
*
* @param map
* @param polylines
* @return
*/
public static MultiPolyline addPolylinesToMap(GoogleMap map,
MultiPolylineOptions polylines) {
MultiPolyline multiPolyline = new MultiPolyline();
for (PolylineOptions polylineOption : polylines.getPolylineOptions()) {
if (polylines.getOptions() != null) {
polylineOption.color(polylines.getOptions().getColor());
polylineOption.geodesic(polylines.getOptions().isGeodesic());
}
Polyline polyline = addPolylineToMap(map, polylineOption);
multiPolyline.add(polyline);
}
return multiPolyline;
}
示例4: getEditPolylineOptions
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
/**
* Get the edit polyline options
*
* @param style observation shape style
* @return edit polyline options
*/
private PolylineOptions getEditPolylineOptions(ObservationShapeStyle style) {
PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.width(style.getStrokeWidth());
polylineOptions.color(style.getStrokeColor());
polylineOptions.geodesic(MapShapeObservation.GEODESIC);
return polylineOptions;
}
示例5: setMapRoute
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
@Override
public void setMapRoute(List<Coordinate> points) {
LatLngParser parser = new LatLngParser();
CameraPosition cameraPosition =
new CameraPosition.Builder()
.target(parser.parse(points.get(FIRST)))
.zoom(MapNavigationConstants.NAVIGATION_ZOOM)
.build();
googleMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
googleMap.animateCamera(
CameraUpdateFactory.zoomTo(
MapNavigationConstants.NAVIGATION_ZOOM),
MapNavigationConstants.ZOOM_DURATION, null);
PolylineOptions polynesOpt = new PolylineOptions();
polynesOpt.color(R.color.map_navigation_route);
for(Coordinate coordinate:points){
polynesOpt.add(parser.parse(coordinate));
}
polynesOpt.geodesic(true);
googleMap.addPolyline(polynesOpt);
}
示例6: toPolylineOptions
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
/**
* Gets a new PolylineOptions object containing styles for the GeoJsonLineString
*
* @return new PolylineOptions object
*/
public PolylineOptions toPolylineOptions() {
PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.color(mPolylineOptions.getColor());
polylineOptions.geodesic(mPolylineOptions.isGeodesic());
polylineOptions.visible(mPolylineOptions.isVisible());
polylineOptions.width(mPolylineOptions.getWidth());
polylineOptions.zIndex(mPolylineOptions.getZIndex());
return polylineOptions;
}
示例7: createPolyline
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
/**
* Create polyline
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void createPolyline(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
final PolylineOptions polylineOptions = new PolylineOptions();
int color;
LatLngBounds.Builder builder = new LatLngBounds.Builder();
JSONObject opts = args.getJSONObject(1);
if (opts.has("points")) {
JSONArray points = opts.getJSONArray("points");
List<LatLng> path = PluginUtil.JSONArray2LatLngList(points);
int i = 0;
for (i = 0; i < path.size(); i++) {
polylineOptions.add(path.get(i));
builder.include(path.get(i));
}
}
if (opts.has("color")) {
color = PluginUtil.parsePluginColor(opts.getJSONArray("color"));
polylineOptions.color(color);
}
if (opts.has("width")) {
polylineOptions.width(opts.getInt("width") * this.density);
}
if (opts.has("visible")) {
polylineOptions.visible(opts.getBoolean("visible"));
}
if (opts.has("geodesic")) {
polylineOptions.geodesic(opts.getBoolean("geodesic"));
}
if (opts.has("zIndex")) {
polylineOptions.zIndex(opts.getInt("zIndex"));
}
Polyline polyline = map.addPolyline(polylineOptions);
String id = "polyline_" + polyline.getId();
this.objects.put(id, polyline);
String boundsId = "polyline_bounds_" + polyline.getId();
this.objects.put(boundsId, builder.build());
JSONObject result = new JSONObject();
result.put("hashCode", polyline.hashCode());
result.put("id", id);
callbackContext.success(result);
}
示例8: setPolylineOptions
import com.google.android.gms.maps.model.PolylineOptions; //導入方法依賴的package包/類
/**
* Set the polyline options
*
* @param style shape style
* @param polylineOptions polyline options
* @param visible visible flag
*/
private void setPolylineOptions(ObservationShapeStyle style, PolylineOptions polylineOptions, boolean visible) {
polylineOptions.width(style.getStrokeWidth());
polylineOptions.color(style.getStrokeColor());
polylineOptions.visible(visible);
polylineOptions.geodesic(MapShapeObservation.GEODESIC);
}