我正在使用Android应用程序,该应用程序使用Google Maps和Google Maps Android API Utility Library。通过使用实用程序库,我得到了聚集标记。但是当标记变得可见时,我想在标记周围显示圆圈。 以下是我用来添加聚类标记的代码:
public class ClusterMarkersFragment {
public GoogleMap map;
private ClusterManager<MarkerItem> fenceClusterManager;
public static ClusterMarkersFragment newInstance () {
ClusterMarkersFragment clusterMarkersFragment = new
ClusterMarkersFragment();
return clusterMarkersFragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = inflater.inflate( R.layout.fragment_cluster_marker_map,
container, false );
map = ((SupportMapFragment) getChildFragmentManager()
.findFragmentById( R.id.view_map )).getMap();
map.setMyLocationEnabled(false);
fenceClusterManager = new ClusterManager<MarkerItem>(getActivity(), map);
map.setOnCameraChangeListener(fenceClusterManager);
addClusterItems(getListofLatLngPairs());
return view;
}
private List< LatLngPair > getListofLatLngPairs () {
// returns the list from database
}
private void addClusterItems(List<LatLngPair> latLngPairs) {
for (LatLngPair latLngPair : latLngPairs) {
MarkerItem markerItem = new MarkerItem(latLngPair.lat, latLngPair.lng, (int) latLngPair);
fenceClusterManager.addItem(markerItem);
}
}
}
以下是截图
答案 0 :(得分:0)
试试这个:
fileNames <- Sys.glob("*.csv")
for (fileName in fileNames) {
if (length(grep("string", readLines(fileName))) > 0) { print(fileName)}
}