Open list In different Screen

Hi,

I need some help, I’m building an app what lets you see beach conditions and I have a beach list on one screen and a map with some generated markers on another screen but I’m unsure how to get the specific beach marker clicked on screen2 to open that beach profile in screen1.

Either pass the list around through TinyDB or consolidate multiple screens into stacked Arrangements on the same Screen, one visible at a time.

would it work even though my beach list is made like this?

I can't tell from looking at your blocks.

What happens when you run it?

Since global variables are not shared across screens, you would need to drop the selected beach name from Screen2 into a TinyDB tag, for example 'SCREEN2BEACH', close Screen2, and retrieve that tag/value in the Screen1 When Other Screen Closed event.

The marker has a click event that you can use.

Here I have static markers ( created at design time ), if you have dynamic created markers, populate the lstMarkers as you create them.

It is probably handy to create a list-of-list/dictionary in which each element contains all data of a single beach ( loaded form a file, for example ): lat, lon, name, description, link..

P.S.

As @ABG already said, easier to use virtual screens

1 Like

You can read coordinates of where the user clicked the screen with the map (via the canvas). Then compare these to the list of the locations. Then display the one where the x and y (or lat and long) are at minimums. This will give you the nearest of the locations. Or else you can use sprites that send you to the list item (Sprite1 Location1, etc) - but this will work only when the sprite is touched exactly. It is convenient to keep the locations in a database as this makes a search fast and easy. Also easy to add or delete POIs this way. For maps of many and dense POIs you will use a minimum distance rather than minimums of x and y. Avoiding lat and long and using x and y allows you to avoid using cos lat in calculation of this distances - simply use the Pythagorean distance (Euclidian distance).