本文整理汇总了Java中com.amap.api.maps.model.LatLngBounds.contains方法的典型用法代码示例。如果您正苦于以下问题:Java LatLngBounds.contains方法的具体用法?Java LatLngBounds.contains怎么用?Java LatLngBounds.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amap.api.maps.model.LatLngBounds
的用法示例。
在下文中一共展示了LatLngBounds.contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateClusters
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
private void calculateClusters() {
mIsCanceled = false;
mClusters.clear();
LatLngBounds visibleBounds = mAMap.getProjection().getVisibleRegion().latLngBounds;
for (ClusterItem clusterItem : mClusterItems) {
if (mIsCanceled) {
return;
}
LatLng latlng = clusterItem.getPosition();
if (visibleBounds.contains(latlng)) {
Cluster cluster = getCluster(latlng,mClusters);
if (cluster != null) {
cluster.addClusterItem(clusterItem);
} else {
cluster = new Cluster(latlng);
mClusters.add(cluster);
cluster.addClusterItem(clusterItem);
}
}
}
//复制一份数据,规避同步
List<Cluster> clusters = new ArrayList<Cluster>();
clusters.addAll(mClusters);
Message message = Message.obtain();
message.what = MarkerHandler.ADD_CLUSTER_LIST;
message.obj = clusters;
if (mIsCanceled) {
return;
}
mMarkerhandler.sendMessage(message);
}
示例2: calculateClusters
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
private void calculateClusters() {
mIsCanceled = false;
mClusters.clear();
LatLngBounds visibleBounds = mAMap.getProjection().getVisibleRegion().latLngBounds;
for (ClusterItem clusterItem : mClusterItems) {
if (mIsCanceled) {
return;
}
LatLng latlng = clusterItem.getPosition();
if (visibleBounds.contains(latlng)) {
Cluster cluster = getCluster(latlng, mClusters);
if (cluster != null) {
cluster.addClusterItem(clusterItem);
} else {
cluster = new Cluster(latlng);
mClusters.add(cluster);
cluster.addClusterItem(clusterItem);
}
}
}
//复制一份数据,规避同步
List<Cluster> clusters = new ArrayList<Cluster>();
clusters.addAll(mClusters);
Message message = Message.obtain();
message.what = MarkerHandler.ADD_CLUSTER_LIST;
message.obj = clusters;
if (mIsCanceled) {
return;
}
mMarkerhandler.sendMessage(message);
}
示例3: addIfNecessary
import com.amap.api.maps.model.LatLngBounds; //导入方法依赖的package包/类
private void addIfNecessary(InputPoint point, Projection projection, LatLngBounds bounds) {
if (bounds != null && bounds.contains(point.getMapPosition()) && !releventInputPointsSet.contains(point)) {
point.buildScreenPosition(projection);
relevantInputPointsList.add(point);
releventInputPointsSet.add(point);
}
}