Open map on current location HERE() and adjust zoom level

There is no way to jump to the current location in a map, like we have in google maps.

3X_e_8_e8fcf532a96077c5d92524ce8abbd14caa8960df.png

I found a workaround, using an Action.

Here is the Expression:

LINKTOVIEW("Your_Map_View")
&"&_currentLat="&(LAT(HERE()))
&"&_currentLng="&(LONG(HERE()))
&"&_zoom=17"

This will open your Map view centered to your location. You can adjust the zoom level as you need it. From 0 to 21.

Nothing else is needed, no User Settings, no Virtual Column.

This action can be placed in a Detail / Deck / Table / Card view. It can not be placed in a map view (which would be awesome).

With LINKTOFILTEREDVIEW() you can jump to a map based on conditions.

27 19 3,783
19 REPLIES 19

With _currentLat= and _currentLng= in XY map view you can jump to a point without selecting the pin.
This maybe helpful when you like to only see one area.
But you have to calculate the XY to a LatLong.
This can be combined also with _zoom=
This expression is working:

LINKTOFILTEREDVIEW(My_Map_View , ANY_CONDITION)
&'&_currentLat='&(LONG([_THISROW].[XY])/100*90-45)
&'&_currentLng='&(LAT([_THISROW].[XY])/100*180-90)
&'&_zoom=2'

Maybe this has never worked right, or maybe AppSheet changed something. The correct expression now should be:

LINKTOFILTEREDVIEW(My_Map_View , ANY_CONDITION)
&'&_currentLat='&((LONG([_THISROW].[XY])/100*90-45)/2)
&'&_currentLng='&(LAT([_THISROW].[XY])/100*90-45)
&'&_zoom=2'

Hi Fabian, the LINKTOVIEW at the top works like a charm. Thank you for that. But the XY related solution with LINKTOFILTEREDVIEW keeps putting me into the middle of the world map. Arbol = tree and Parcela = plot. Here is the expression I used from your example:
LINKTOFILTEREDVIEW(Mapa Parcelas , ([Parcela ID] = [_THISROW].[Parcela ID]))
&โ€™&_currentLat=โ€™&((LONG([_THISROW].[Parcela XY])/10090-45)/2)
&โ€™&_currentLng=โ€™&(LAT([_THISROW].[Parcela XY])/100
90-45)
&โ€™&_zoom=2โ€™

3X_a_b_abcdb24209f0ddea3547ed0657e2804144ee6964.png
3X_2_a_2a60e6a6e0f4abd6425866ce2921972f81c053bd.png

Besides that, I do have one additional issue that I posted in another thread. Maybe you have some advise since you have posted a lot of helpful map related topics. And I think it may be the root cause of the above issue. Some missing references I think between the parent and child table.

I canโ€™t manage to successfully show parent table background maps (plots) with child table XY data (trees) in a parent table view. It does work well the other way around showing trees on their plot from a child table view.

I can only imagine that I may need to add virtual columns to pull data into the parent table. But I am not sure where to start.

Thank you.

Hi @Christian sorry for my late reply.
You canโ€™t mix XY and LatLong. A world map uses the usual geo coordinates with LatLong. XY uses coordinates from 0 to 100.

So in your case you can use this expression:

LINKTOFILTEREDVIEW(Mapa Parcelas , [Parcela ID] = [_THISROW].[Parcela ID])
&'&_currentLat='&LAT([_THISROW].[Parcela XY])
&'&_currentLng='&LONG([_THISROW].[Parcela XY])
&'&_zoom=17'

Please have a look at my sample app โ€œMap & XYโ€ and the Action โ€œView Map around LatLongโ€.
https://www.appsheet.com/portfolio/549987


I will answer your second question in that post

The zoom level is not working with SNAPSHOT().
If you use
<<SNAPSHOT(LINKTOVIEW("YourMapView")&"&_zoom=17")>>
in your workflow attachment, you will get the snapshot, but the zoom level will not be respected.

Yes I have been using Appsheet for 3+ years now and in the past the map views would automatically center on a userโ€™s current location, but now they seem to always start at the first address in the table for some reason.

This is very annoying, is there no solution that works to resolve this bug? The workaround action doesnโ€™t work in map views and so thereโ€™s no real way for me to fit it within my current appโ€ฆ

Do you have Here() expression in your latlong fields as initial value?

My table only uses the phys addresses, no latlong fields are available

I suggest you take this matter up with support@appsheet.com. This may be a bug.

Yea, I did open a case and now theyโ€™re telling me that this was never the way Appsheet worked (centering on the map) though my experience tells me otherwise and Iโ€™ve seen others comment in the forums with the same experience as me, as far back as Sept '20, noting that the behavior has changedโ€ฆ

From support:

โ€œAppSheet never supported a โ€˜center locationโ€™ feature in Map view, the default behavior is to load all the locations and put them in the map.
However, when these pins are more than 200, AppSheet limit the view to the first 200 and this might generate the false idea that AppSheet is centering the map.โ€

What that tells me is that the behavior youโ€™d experienced in the past was not intentional by AppSheetโ€“it just happened to work that way. Since it wasnโ€™t intentional, they felt no obligation to keep it. I donโ€™t necessarily agree, but thatโ€™s probably the thinking.

From my point of view it is essential to keep the zoom and the place where I am working all the time, or at least to have a Here() button on the map.

After months of development and with the application at 90% Iโ€™m about to lose a client because the user experience with the map is horrible because the map is not being displayed.
Please review this, itโ€™s very important.

It would also be great if the map itself serves as a filter and only the items shown on the map are shown in the list.

Hi @Mariano_Sanz_Gil , Appsheet newbie here but does the OP @Fabian 's solution not work for your use case?

Sorry I just skimmed through the thread but got confused as I thought thatโ€™s why he posted the solution since it was a workaround. Iโ€™m about to give it a shot but not sure if it no longer works.

Thanks!

Hi Fabian,

I tried but it does not zoom to my location, it only open a new view that kinds of "save" the zoom. This because when i zoom in that new view, exit it and then press the bottom again it open the view in the exactly same zoom as i left it. Any idea of why this is happening?

Hi @MRosende I cannot reproduce the problem you describe. To me it's working on Windows and on Android. Maybe you can post some screenshots or a video?

Thank you for the video @MRosende that's really strange. I double checked it, but I can't find any reason why it's not working.
Is it working on mobile phone?

@Fabian_Weller I know right, super weird. No, is not, android or iphone same result. Well if you find out any other way to doit please let me know.

Thank you!

LINKTOVIEW("Your_Map_View")
&"&_currentLat="&(LAT(HERE()))
&"&_currentLng="&(LONG(HERE()))
&"&_zoom=17"

 This worked flawlessly on my Android!!  For anyone else who might be referencing this, make sure you have a Map View created under UX > Views. Then in Behavior > create a New Action.  In the code above, replace "Your_Map_View" with your view name that you named your Map View. 

Top Labels in this Space