Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mapmaker/flatmap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')) != '':
Expand Down
10 changes: 3 additions & 7 deletions mapmaker/flatmap/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions mapmaker/sources/svg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
NON_INHERITED_PROPERTIES = [
'id',
'class',
'group',
'markup',
'models',
'tooltip',
Expand Down