Alrightโฆ This is about showing the current location on the map.
Iโve been trying to solve this for a few days now in a replicated prototype of my live version.
I have a data table that feeds into a slice.
This slice is the data set for the map view.
There is currently one location column, โlocation,โ that shows all of the pins on the map that match the condition of the slice.
So, normally, about 20 different pins show on the map.
Additionally, a โView Map (Location)โ button that shows up on the map, on the bottom right.
When this button is clicked, a bouncing red pin shows that, when moved, feeds into a form, that will eventually populate more pins.
When this button is clicked inline, it shows the current pinโs zoomed location on the map.
This โView Map (Location)โ button on the map only shows if the data set is editable and if the main source of the map view is โLocation.โ
This button is necessary.
Now, the staff has suggested creating a virtual column with the โHere()โ formula and use this instead of the โLocationโ column for the map view.
There are several issues.
If the โLocationโ column is replaced with โHere()โ virtual column, the โView Map (Location)โ system-generated action disappears. This action cannot be replicated. Even if I create the exact copy, it does not appear on the map the same way as it did before.
If the โHere()โ virtual column is toggled to show, the current pins are repopulated as plain green pins in a close cluster. The pins are not in their designated locations and it looks very wrong.
If the โHere()โ virtual column is toggled to not-show, the weird green pins donโt show, but none of the other pins from โLocationโ show either.
If โHere()โ is the main column and โLocationโ is the secondary column, the โView Map (Location)โ action is still not shown, the map is zoomed out just like it was when it was only โLocationโ as the main column, and the purpose of โHere()โ virtual column is pointless.
Same if โLocationโ is the main column and โHere()โ virtual column is secondary, just the โView Map (Location)โ action is viewable, but the start view of the map is STILL not the userโs current location.
If there is no โHere()โ virtual column, the initial value of โHere()โ for the โLocationโ column doesnโt affect anything. The map still begins showing all the pins on the map instead of the userโs current location.
If the app formula for the โLocationโ column is edited in ANY way, the โView Map (Location)โ action disappears.
โฆ
Iโve tried many, many things.
Here is my suggested solutionโฆ
Please stop giving advice to add a virtual column with the โHere()โ formula, it only works if there are no other pins on the map.
Currently, the โAddโ and โView Map (Location)โ actions, system-generated, seem to be the only ones that are allowed to show on the bottom right of the map view. We should have the option to add our own actions to this place as well.
The action I suggest is some sort of LINKTOVIEW or CONCATENATE button that people can click (inline, prominent, overlay, and map bottom right) that will take a person to their current location.
When completing a form, in the location input, thereโs a bouncing red pin and in the upper-right of the small map box, thereโs a small map pinโฆ This map pin, when clicked, takes a person directly to their current locationโฆ Why canโt this type of button be recreated anywhere else in the app?
The DEFAULT view of a map view should NOT be the view of all the pins. This means that if pins exist in Africa and Japan, the CURRENT default view shows both Japan and Africa at once. This is very annoying for people who only care about dropping a pin in their current location (20~50km) map range.
Itโs either a new required & necessary feature or somehow use the current formulas to link directly to a personโs current view. I know a feature might take a few days or so to roll out, but in the meantime, would really appreciate the correct formula to link
Actions should be allowed to be shown in the navigation bar or menu as well.
So we can have the option of replacing the map view in the navigation bar and replacing it with an action that leads to a map view starting at the userโs current location.
This is such a complicated issue, but I really hope to receive a solution soon.
Thank you.
Alright, Iโve created a viable & smooth solution with what we have now.
Based on the principles of geofencing.
Whatโs needed:
ใปAbility to change USERSETTINGS() in the Data category, User Settings is right of the Slices tab.
Remember, your slice needs to feed into your map view.
20km radius from the userโs current location is close enough a solution to the HERE() problem I mentioned above.
More filters can be created & selected from the User Settings and placed into the Slice.
For my app, I localize the language according to the user, which adds another level of complication.
In the future, I plan to add several other languages so this app can become global.
Thank you for providing such an easy to use and editable platform for us and my NPO.
This is a really useful trick that I hope the staff can pin when you replicate & verify it.
@Adam please take a look!
This is a good solution and beats trying to geofence using 4 coordinates. However, I have a little bit of a wrinkle/challenge I would like to throw out there.
If I have a table full of locations with latlong (and Iโm talking 200,000 locations), how can I identify which location is closest using HERE(). Essentially I want to confirm that the USER is nearby a location (or inside) when they submit the form. Or even preselect a small list of locations using HERE() from the larger list.
The process would goโฆ
Thoughts?
One way could be to add 4 columns for each location - LatNearMin, LatNearMax, LongNearMin and LongNearMax and filter location based on lat and long of HERE().
You could try:
TOP(
ORDERBY(
locations-table[key-column],
DISTANCE([latlong-column], HERE()),
FALSE
),
5
)
Replace locations-table
with the name of the โtable full of locationsโ; key-column
with the name of the key column of that table; and latlong-column
with the name of the column in that table with the locationsโ LatLong values.
DISTANCE([latlong-column], HERE())
computes the distance between the userโs current location (HERE()
) and the location described by a given row.
ORDERBY(locations-table[key-column], ...)
orders the rows of the locations table by distance from here (per (2)) in ascending (closest to furthest) order (per FALSE
).
TOP(..., 5)
gives the first 5 rows from the list generated by (3), which should be the 5 closest.
See also:
This describes DISTANCE():
This is gonna take some time for 200000 locations but hopefully not too prohibitive.
Manโฆ 200,000 rows. The table better be sparse - likeโฆ only the lat and long, maybe an ID. 200k rows is a lot for a mobile device, or even a PC, to handle. Hosting this on a SQL will help; any cloud-based spreadsheet will run REEEEAAAAALLLLLYYY slow.
Iโve found that 30k records is the trouble point for Google sheets;
One of my long-time clients is a tele-health company; weโve been fighting the good-fight on data-bloat for the past two years. We collect data points like weights, med tracking, etc. and you can see how records would stack up quickly.
On one respect, you want all the data there for the best possible analysis; but on the other, you canโt include everything because then the app wouldnโt be workable. Weโve had to come up with informed data-schema updates, where we took into consideration HOW people were working with the app and made changes to how we were storing certain parts.
You might need to consider ways of splitting your location table into smaller ones (by state, region, etc.), then make use of the partitioning feature in Tables:
Thank you for the heads up on data bloat. You are absolutely right that this would bog down any machine. I can and will breakup the reference coordinates by state using the partitioning option. Thanks again for the reply. When/if I get it up and running Iโll circle back.
Hi Ricardo,
thanks for the proper advice and I tried Here() and what you said is perfectly correct. So I decided to try your way. Now I am stuck at step 3. I am confused with โif itโs already [some column] = โthis valueโ just change it to AND([some column] = โthis valueโ, [NEARBY] < USERSETTINGS(DISTANCE)) โฆ IGNORE THE ERRORโ. I have recorded a video to show what I have done and not done. Please take a look and advice next.
Hi @Ricardo_Gonzalez Here is a workaround:
User | Count |
---|---|
16 | |
11 | |
9 | |
8 | |
4 |