diff --git a/mapmaker/flatmap/__init__.py b/mapmaker/flatmap/__init__.py index f041e186..e0f488fb 100644 --- a/mapmaker/flatmap/__init__.py +++ b/mapmaker/flatmap/__init__.py @@ -298,7 +298,7 @@ def new_feature(self, layer_id: str, geometry, properties, is_group=False) -> Op self.__last_geojson_id += 1 feature = Feature(self.__last_geojson_id, geometry, properties, is_group=is_group) self.__features_by_geojson_id[feature.geojson_id] = feature - if feature.id: + if feature.id and (not properties.get('group', False) or is_group): self.__features_with_id[feature.id] = feature if self.map_kind == MAP_KIND.FUNCTIONAL: if (name := properties.get('name', '')) != '': diff --git a/mapmaker/flatmap/layers.py b/mapmaker/flatmap/layers.py index fd1ef626..47b839bf 100644 --- a/mapmaker/flatmap/layers.py +++ b/mapmaker/flatmap/layers.py @@ -430,15 +430,11 @@ def add_group_features(self, group_name: str, features: list[Feature], feature.geometry = feature.geometry.buffer(0).difference(interior_polygon) # Construct a MultiPolygon containing all of the group's polygons - # But only if the group contains a `.group` element... - - # So that any grouped features don't have duplicate ids - grouped_properties.pop('id', None) + # But only if the group contained a `.group` element... feature_group = None # Our returned Feature if generate_group: - grouped_polygon_features = [ feature for feature in features if feature.is_group ] - for feature in layer_features: - grouped_polygon_features.append(feature) + grouped_polygon_features = [] + grouped_polygon_features.extend(layer_features) grouped_polygons = [] for feature in grouped_polygon_features: diff --git a/mapmaker/sources/svg/__init__.py b/mapmaker/sources/svg/__init__.py index 0a807418..cbe6093c 100644 --- a/mapmaker/sources/svg/__init__.py +++ b/mapmaker/sources/svg/__init__.py @@ -81,6 +81,7 @@ NON_INHERITED_PROPERTIES = [ 'id', 'class', + 'group', 'markup', 'models', 'tooltip',