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


Java Builder.include方法代码示例

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


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

示例1: addPanPropertiesToMap

import com.google.android.gms.maps.model.LatLngBounds.Builder; //导入方法依赖的package包/类
private void addPanPropertiesToMap() {
	LatLngBounds bounds = null;
	Builder latLngBoundBuilder = new LatLngBounds.Builder();
	if (punchLocationCollection != null && punchLocationCollection.size() > 0) {
		int totalLocations = punchLocationCollection.size();
		for (int currentLocation = 0; currentLocation < totalLocations; currentLocation++) {
			LatLng latLng = new LatLng(Double.parseDouble(punchLocationCollection.get(currentLocation).getLatitude()), Double.parseDouble(punchLocationCollection.get(currentLocation)
					.getLongitude()));
			latLngBoundBuilder = latLngBoundBuilder.include(latLng);
		}
	}

	if (deviceCurrentLocation != null) {
		latLngBoundBuilder.include(new LatLng(deviceCurrentLocation.getLatitude(), deviceCurrentLocation.getLongitude()));
	}

	// Build the map with the bounds that encompass all the
	// specified location as well the current location
	bounds = latLngBoundBuilder.build();

	mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 50));
	// Zoom in, animating the camera.
	// mMap.animateCamera(CameraUpdateFactory.zoomTo(50), 2000, null);
}
 
开发者ID:appez,项目名称:appez-android,代码行数:25,代码来源:SmartMapHandlerActivity.java

示例2: JSONArray2LatLngBounds

import com.google.android.gms.maps.model.LatLngBounds.Builder; //导入方法依赖的package包/类
public static LatLngBounds JSONArray2LatLngBounds(JSONArray points) throws JSONException {
  List<LatLng> path = JSONArray2LatLngList(points);
  Builder builder = LatLngBounds.builder();
  int i = 0;
  for (i = 0; i < path.size(); i++) {
    builder.include(path.get(i));
  }
  return builder.build();
}
 
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:10,代码来源:PluginUtil.java

示例3: onMapChange

import com.google.android.gms.maps.model.LatLngBounds.Builder; //导入方法依赖的package包/类
@Override
public void onMapChange(List<Node> nodes, List<? extends Edge> edges) {
	
	Builder bounds = LatLngBounds.builder();
	boolean hasBounds = false;
	
	for (Node n: nodes) {
		Marker m = gmap.addMarker(new MarkerOptions()
							.position(toGms(n.location))
							.title(n.name)
							.snippet(n.description));
		
		hasBounds = true;
		bounds.include(toGms(n.location));
		markers.put(m, n);
	}
	
	
	for (Edge e: edges) {
		gmap.addPolyline(new PolylineOptions()
						.add(toGms(e.nodeA.location), toGms(e.nodeB.location))
						.color(getColor(e.type)));
	}
	
	if (hasBounds) {
		gameBounds = bounds.build();
		
		if (zoom == null) {
			zoom = Zoom.ToGame;
		}
		
		zoomMap();
	}
}
 
开发者ID:jakobwenzel,项目名称:rallye-android-client,代码行数:35,代码来源:GameMapFragment.java

示例4: onMarkerClick

import com.google.android.gms.maps.model.LatLngBounds.Builder; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
	
	Node source = markers.get(marker),
			target;
	Builder bounds = LatLngBounds.builder();
	ArrayList<Node> targets = new ArrayList<Node>();
	
	bounds.include(toGms(source.location));
	
	for (Edge e: source.getEdges()) {
		target = e.getOtherNode(source);
		targets.add(target);
		bounds.include(toGms(target.location));
	}
	Log.i(THIS, "found "+ targets.size() +" targets/edges");
	
	for (Entry<Marker, Node> m: markers.entrySet()) {
		Marker current = m.getKey();
		boolean cond = targets.contains(m.getValue());
		current.setVisible(cond);
	}
	marker.setVisible(true);
	
	zoom = Zoom.ToBounds;
	currentBounds = bounds.build();
	zoomMap();
	marker.showInfoWindow();
	
	return true;
}
 
开发者ID:jakobwenzel,项目名称:rallye-android-client,代码行数:32,代码来源:GameMapFragment.java


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