diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt index 51659aedb65..941fafb9ee6 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt @@ -349,6 +349,7 @@ object GpxUtilities { const val OBF_POINTS_GROUPS_ICONS = "points_groups_icons" const val OBF_POINTS_GROUPS_COLORS = "points_groups_colors" const val OBF_POINTS_GROUPS_BACKGROUNDS = "points_groups_backgrounds" + const val OBF_POINTS_GROUPS_EMPTY_NAME_VALUE = "." // stub to store empty points_groups_names const val OBF_POINTS_GROUPS_CATEGORY = "points_groups_category" // optional category of OBF-GPX point fun parsePointsGroupAttributes(parser: XmlPullParser): PointsGroup { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 7c9af7d092f..f19a11180de 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -23,6 +23,7 @@ import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_BACKGROUNDS; import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_COLORS; import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_DELIMITER; +import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_EMPTY_NAME_VALUE; import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_ICONS; import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_NAMES; import static net.osmand.shared.gpx.GpxUtilities.PointsGroup.OBF_POINTS_GROUPS_PREFIX; @@ -1305,7 +1306,9 @@ private void reconstructPointsGroups(GpxFile gpxFile, List pgNames, List String icon = pgIcons.get(i); String background = pgBackgrounds.get(i); int color = KAlgorithms.INSTANCE.parseColor(pgColors.get(i)); - if (name.isEmpty()) name = GpxFile.DEFAULT_WPT_GROUP_NAME; // follow current default + if (name.isEmpty() || OBF_POINTS_GROUPS_EMPTY_NAME_VALUE.equals(name)) { + name = GpxFile.DEFAULT_WPT_GROUP_NAME; // follow current default + } GpxUtilities.PointsGroup pg = new GpxUtilities.PointsGroup(name, icon, background, color); gpxFile.addPointsGroup(pg); }