int layerId = Integer.valueOf(layerIds.get(i));
Layer layer = map.getLayer(i);
if (layer != null && layer instanceof FeatureLayer) {
FeatureLayer featureLayer = (FeatureLayer) layer;
try {
QueryParam queryParam = new QueryParam();
queryParam.setWhere(where);
FeatureCollection<? extends FeatureType, ? extends Feature> layerFeatureCollection = featureLayer
.query(queryParam);
if (layerFeatureCollection != null
&& !layerFeatureCollection.isEmpty()) {
for (FeatureIterator<? extends Feature> itr = layerFeatureCollection