本文整理汇总了Java中com.amap.api.maps.model.LatLngBounds.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java LatLngBounds.Builder方法的具体用法?Java LatLngBounds.Builder怎么用?Java LatLngBounds.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amap.api.maps.model.LatLngBounds
的用法示例。
在下文中一共展示了LatLngBounds.Builder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLatLngBounds
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
/**
* 根据自定义内容获取缩放bounds
*/
private LatLngBounds getLatLngBounds( List<RankEntity> RankEntitiesList) {
LatLngBounds.Builder b = LatLngBounds.builder();
for (int i = 0; i < RankEntitiesList.size(); i++) {
LatLng p = RankEntitiesList.get(i).getPosition();
b.include(p);
}
return b.build();
}
示例2: onClick
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
@Override
public void onClick(Marker marker, List<ClusterItem> clusterItems) {
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (ClusterItem clusterItem : clusterItems) {
builder.include(clusterItem.getPosition());
}
LatLngBounds latLngBounds = builder.build();
mAMap.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, 0));
}
示例3: onClick
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
@Override
public void onClick(Marker marker, List<ClusterItem> clusterItems) {
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (ClusterItem clusterItem : clusterItems) {
builder.include(clusterItem.getPosition());
}
LatLngBounds latLngBounds = builder.build();
mAMap.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, 0)
);
}
示例4: getBounds
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
private LatLngBounds getBounds() {
LatLngBounds.Builder b = LatLngBounds.builder();
if (mOriginLatLngList == null) {
return b.build();
}
for (int i = 0; i < mOriginLatLngList.size(); i++) {
b.include(mOriginLatLngList.get(i));
}
return b.build();
}
示例5: getBoundsOfInputPoints
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
LatLngBounds getBoundsOfInputPoints() {
if (boundsOfInputPoints == null) {
LatLngBounds.Builder builder = LatLngBounds.builder();
for (InputPoint inputPoint : pointsInClusterList) {
builder.include(inputPoint.getMapPosition());
}
boundsOfInputPoints = builder.build();
}
return boundsOfInputPoints;
}
示例6: getLatLngBounds
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
public LatLngBounds getLatLngBounds() {
LatLngBounds.Builder b = LatLngBounds.builder();
b.include(new LatLng(startPoint.latitude,startPoint.longitude));
b.include(new LatLng(endPoint.latitude,endPoint.longitude));
return b.build();
}
示例7: move
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
public void move(View view) {
addPolylineInPlayGround();
List<LatLng> points = readLatLngs();
LatLngBounds.Builder b = LatLngBounds.builder();
for (int i = 0; i < points.size(); i++) {
b.include(points.get(i));
}
LatLngBounds bounds = b.build();
aMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));
smoothMarker = new SmoothMarker(aMap);
smoothMarker.setDescriptor(BitmapDescriptorFactory.fromResource(R.drawable.car));
LatLng drivePoint = points.get(0);
Pair<Integer, LatLng> pair = PointsUtil.calShortestDistancePoint(points, drivePoint);
points.set(pair.first, drivePoint);
List<LatLng> subList = points.subList(pair.first, points.size());
smoothMarker.setPoints(subList);
smoothMarker.setSpeed(20);
aMap.setInfoWindowAdapter(infoWindowAdapter);
smoothMarker.setMoveListener(new SmoothMarker.SmoothMarkerMoveListener() {
@Override
public void move(double remainDistance, double totalDistance) {
if (infoWindowLayout != null && title != null) {
title.setText("距离终点还有: " + (int) remainDistance + "米\n" + "完成百分比:" + (int)
((totalDistance - remainDistance) / totalDistance * 100) + "%");
}
}
@Override
public void stop() {
Toast.makeText(MainActivity.this, "动画停止", Toast.LENGTH_SHORT).show();
Log.d("MainActivity", smoothMarker.getPosition().toString());
}
});
smoothMarker.getMarker().showInfoWindow();
smoothMarker.startSmoothMove();
}