Android Question MarkersOverlay1_LongClick

T201016

Active Member
Licensed User
Longtime User
Hello!

How can I solve the following problem with markers:

1. I have several overlapping markers (one under the other)
- describing photographs taken in one place.
2. Only the FIRST of them are visible at the top of the map, the rest are barely visible!)
3. Pressing on the marker in the foreground will display a photo view,
When the view closes, another new photo opens and so on until the last occurrence.

Q:

Is it possible to break this "unexpected loop" by displaying, for example, a list of all
OTHER (NOT VISIBLE) photos hidden behind a marker - giving you the option to choose,
Which photo do I want to see yet?

Regards
 

T201016

Active Member
Licensed User
Longtime User
How are you displaying the photo? Is it in the info window?

Might be simpler to open a dialog and show all the relevant images in a HorizontalScrollView.

Thanks Erel!
(By the way, they mention that I'm working on maps OSMdroid.)

But I have a problem with multiple markers. If there are two markers very close together on the map
I am getting click events for both of them on one touch. Is there a way to prevent or ignore the second click?

I thought about it:
Create a global variable long and set it to 0 at startup.
In the release, click the current time with DateTime.Now and compare it with the value of the variable.
If the difference is less than a second, ignore the event.
Otherwise set the variable to the current time and continue with the event code.

But is there any other better solution?
 
Upvote 0

T201016

Active Member
Licensed User
Longtime User
I think that your time based solution is a good solution.

I just did that in this way:

B4X:
Sub MarkersOverlay1_LongClick(Title As String, Description As String, Point As GeoPoint)
    Dim now As Long = DateTime.now

    Try
        If now - Clipboard.Thumbnails.gLastTime < 2000 Then
            ' continue accidental multiple presses of markers:
        Else
            Clipboard.ClearGallery
            Clipboard.ThumbnailsPan.Visible = True
            ProgressDialogShow2("Multiple presses of markers", True)
            DoEvents
        End If

        If Description.Contains("?") Then
            Private words() As String
            words = Regex.Split("?",Description)
            If File.Exists(words(0),words(1)) Then
                DoEvents
                Clipboard.Thumbnails.gThumbnails.Add(words(0)&"?"&words(1)&"?"&Point.Latitude&"?"&Point.Longitude&"?"&Point.Altitude)
                Dim bmp As Bitmap = LoadBitmap(words(0),words(1))
                Clipboard.AddThumbnail(bmp, Clipboard.NumberOfThumbnails)
            End If
            ProgressDialogHide
           
            ...
 

Attachments

  • Screenshot_2017-11-08-17-13-20.png
    Screenshot_2017-11-08-17-13-20.png
    207.4 KB · Views: 355
Upvote 0

T201016

Active Member
Licensed User
Longtime User
I still lack the ability to check when the last use case occurs - in this case - when the last addition of the thumbnail to the gallery will occur.
 
Upvote 0
Top