command.setCommandRequest(request);
commandService.execute(command, new CommandCallback() {
public void onSuccess(CommandResponse response) {
if (response instanceof SearchByLocationResponse) {
SearchByLocationResponse sblr = (SearchByLocationResponse) response;
for (Entry<String, List<org.geomajas.layer.feature.Feature>> entry : sblr.getFeatureMap()
.entrySet()) {
Layer<?> layer = searchLayer(layers, entry.getKey());
List<Feature> features = new ArrayList<Feature>(entry.getValue().size());
for (org.geomajas.layer.feature.Feature feature : entry.getValue()) {
features.add(new FeatureImpl(feature, layer));