organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
8.58k stars 837 forks source link

Prohibit adding POIs if maps are not updated #7930

Open gtrus21 opened 2 weeks ago

gtrus21 commented 2 weeks ago

Please prohibit making changes to OSM if the maps of this region are not updated to the latest version. Otherwise, edit conflicts, duplicates, etc. arise.

Jean-BaptisteC commented 2 weeks ago

That's already the case, if map is outdated. Button to access to editor is not visible.

patepelo commented 2 weeks ago

That's already the case, if map is outdated. Button to access to editor is not visible.

What if a user has updated a region but not the one he's editing?

gtrus21 commented 2 weeks ago

Today one user created a POI, although I had already created this POI before him, and his map was not updated

I created a POI, and after a while a user with an old map created it again in the same building because he didn’t see mine

Jean-BaptisteC commented 2 weeks ago

Can you share the position of POI?

gtrus21 commented 2 weeks ago

It turned out that the edit of that user was never uploaded, because it was not registered on OSM. But the point is that this POI was created on his phone, which means the editor allowed it to be created, despite the fact that the maps were old

matkoniecz commented 2 weeks ago

But the point is that this POI was created on his phone, which means the editor allowed it to be created, despite the fact that the maps were old

It does not follow. Maybe they created it 2 years ago and registered only now?

gtrus21 commented 2 weeks ago

The POI was created 24 days ago, I have it on my maps dated 03/26/24. The user does not have one, so he did not update the cards. The user is a complete newbie who only recently learned about OSM

biodranik commented 2 weeks ago

Let's clarify the issue: editing of POIs on the outdated map is DISABLED in OM (although a user can edit some features before updating the app and maps).

Adding new POIs is always enabled now, even if maps are outdated. So a warning should be displayed with a button to update the current map if a user selects "Add place". @Jean-BaptisteC correct?

pastk commented 2 weeks ago

When editing is disabled it should be also obvious to the user why its disabled. Now the button just doesn't show up and this is confusing.

biodranik commented 2 weeks ago

On iOS the Edit Place button is sometimes disabled, and sometimes hidden. @kirylkaveryn did you observe that behavior? What's in the code?

kirylkaveryn commented 2 weeks ago

On iOS the Edit Place button is sometimes disabled, and sometimes hidden. @kirylkaveryn did you observe that behavior? What's in the code?

I found that there are two options to control these buttons:

  1. enabling: For example in the PlacePageCommonLayout

    lazy var buttonsViewController: PlacePageButtonsViewController = {
    let vc = storyboard.instantiateViewController(ofType: PlacePageButtonsViewController.self)
    vc.buttonsData = placePageData.buttonsData!
    vc.buttonsEnabled = placePageData.mapNodeAttributes?.nodeStatus == .onDisk // <--- Here
    vc.delegate = interactor
    return vc
    } ()

    or

    placePageData.onMapNodeStatusUpdate = { [weak self] in
      guard let self = self else { return }
      self.actionBarViewController.updateDownloadButtonState(self.placePageData.mapNodeAttributes!.nodeStatus)
      switch self.placePageData.mapNodeAttributes!.nodeStatus {
      case .onDisk, .onDiskOutOfDate, .undefined:
        self.actionBarViewController.resetButtons()
        if self.placePageData.buttonsData != nil {
          self.buttonsViewController.buttonsEnabled = true // <--- Here
        }
      default:
        break
      }
    }
  2. visibility Visibility is taken from the place_page_info:

editPlaceButton.isHidden = !buttonsData.showEditPlace

_showEditPlace = rawData.ShouldShowEditPlace();

bool Info::ShouldShowEditPlace() const
{
  return m_canEditOrAdd &&
         // TODO(mgsergio): Does IsFeature() imply !IsMyPosition()?
         !IsMyPosition() && IsFeature();
}

So maybe we should control only the enabling, not the visibility?

biodranik commented 2 weeks ago

So maybe we should control only the enabling, not the visibility?

Right, "Edit Place" should be visible only for existing objects (e.g. we don't show it for empty map places selected by a long tap).

The next question is how to make it obvious to users that the map needs to be updated. Note that for non-downloaded areas a download map button is displayed in the bottom bar under the Place Page. Maybe we should always display "Update maps" button there in such cases?

pastk commented 2 weeks ago

The next question is how to make it obvious to users that the map needs to be updated. Note that for non-downloaded areas a download map button is displayed in the bottom bar under the Place Page. Maybe we should always display "Update maps" button there in such cases?

If "Edit" is disabled then instead of it display an explanation text together with an "Update map" button?

For a more general case of browsing an out-of-date map it'd be good to add an "update" button somewhere in the corner of the screen (e.g. top right?).

kirylkaveryn commented 2 weeks ago

Maybe we should always display "Update maps" button there in such cases?

Or "Update map to edit". And by tapping on the button we may open the downloading screen.

Kopterlove commented 4 days ago

If I didn't update the app, OM know what need to be updated?

User can be without internet for weeks or months. If he already made tons of changes, and make connect to internet and update the app... changes can be uploaded without issue?