diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index b682ceed0d..d091660db2 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -222,14 +222,8 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { for (String k : n.getTagKeySet()) { String val = n.getTag(k); - boolean valLengthZero = val.length() == 0; - boolean kLengthZero = k.length() == 0; - boolean poiTypeTag = EditPoiData.POI_TYPE_TAG.equals(k); - boolean kStartsWithRemoveTagPrefix = k.startsWith(EditPoiData.REMOVE_TAG_PREFIX); - String removeTagPrefixK = EditPoiData.REMOVE_TAG_PREFIX + k; -// boolean tagWithRemoveTagPrefix = n.getTag(EditPoiData.REMOVE_TAG_PREFIX + k) != null; - boolean tagWithRemoveTagPrefix = k.contains(EditPoiData.REMOVE_TAG_PREFIX); - if (valLengthZero || kLengthZero || poiTypeTag || kStartsWithRemoveTagPrefix || tagWithRemoveTagPrefix) + if (val.length() == 0 || k.length() == 0 || EditPoiData.POI_TYPE_TAG.equals(k) || + k.startsWith(EditPoiData.REMOVE_TAG_PREFIX) || k.contains(EditPoiData.REMOVE_TAG_PREFIX)) continue; ser.startTag(null, "tag"); //$NON-NLS-1$ ser.attribute(null, "k", k); //$NON-NLS-1$ diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java index 3ad79ad9eb..2ce3a736de 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java @@ -48,7 +48,6 @@ import net.osmand.plus.osmedit.OsmPoint; import net.osmand.plus.osmedit.dialogs.PoiSubTypeDialogFragment; import net.osmand.plus.quickaction.CreateEditActionDialog; import net.osmand.plus.quickaction.QuickAction; -import net.osmand.plus.quickaction.QuickActionFactory; import net.osmand.util.Algorithms; import java.lang.reflect.Type; @@ -540,9 +539,13 @@ public class AddPOIAction extends QuickAction { } private void setTagsIntoParams(Map tags) { - HashMap padrams = getParams(); + if (!tags.containsKey(POI_TYPE_TAG)) { + Map additionalTags = new HashMap<>(tags); + tags.clear(); + tags.put(POI_TYPE_TAG, getTagsFromParams().get(POI_TYPE_TAG)); + tags.putAll(additionalTags); + } getParams().put(KEY_TAG, new Gson().toJson(tags)); - padrams = getParams(); } private void putTagIntoParams(String tag, String value) {