code: public static GeometryCriterion buildGeometryCriterion(final Geometry geometry, final MapWidget mapWidget,
  			VectorLayer layer) {
  		List<String> layers;
  		if (null == layer) {
  			layers = getVisibleServerLayerIds(mapWidget.getMapModel());
  		} else {
  			layers = new ArrayList<String>();
  			layers.add(layer.getServerLayerId());
  		}
  		return new GeometryCriterion(layers, GeometryConverter.toDto(geometry));
  	}
docs: Build {@link GeometryCriterion} for the map widget, geometry and optional layer.
  
  @param geometry geometry
  @param mapWidget map widget
  @param layer layer
  @return geometry criterion