我已在Android中使用我的标记开发了googleMap,但它们只会在刷新或执行过滤后显示,并且在第一次运行或清除缓存后不会显示。
protected void refreshMap()
{
final boolean useClusters = NumericUtil.parseBool(getObjectModel("useClusters"));
markerArray = new ArrayList();
markersMap = new Hashtable();
poiMarkersMap = new Hashtable();
locationMapper = new ArrayList();
IDictionary attachments = new Hashtable();
safeInvokeSync(new Runnable() {
@Override
public void run()
{
googleMap.clear();
if (mClusterManager != null)
mClusterManager.clearItems();
//configOfflineMaps();
}
});
safeInvokeAsync(new Runnable() {
@Override
public void run()
{
if (useClusters && valuesCount > 2)
{
if (mClusterManager == null)
{
mClusterManager = new ClusterManager<>(getContext(), googleMap);
mClusterManager.setRenderer(createMarkerRenderer());
googleMap.setOnCameraChangeListener(mClusterManager);
}
ClusterMarker clusterMarker = new ClusterMarker(position, marker.getTitle(), marker.getSnippet(), marker.getIcon(), entry);
mClusterManager.addItem(clusterMarker);
mClusterManager.cluster();
}
else
{
Marker newMarker = googleMap.addMarker(marker);
newMarker.setDraggable(checkPermissionsValue(Permissions.Update));
markersMap.put(newMarker.getId(), entry);
markerArray.add(newMarker);
}
}
});
}
}