Embedded Map view Component onMarkerPress - iPhone

Greetings,
sorry if this question is answered somewhere but i couldn’t find any info.
Can anyone confirm if iOS (iphone 11 os v.14.4 - appgyver preview app latest) can route a lat. long. coordinates on marker press?
I can confirm that it works on android (samsung s6 & s20 os. 7-11) but on iphone it doesn’t do anything.

Also, can anyone share info on how to integrate an airtable base with lat, long, name & photo into Map View so i dont have to manually input markers on map??

Any help appreciated

Hi!

We have a bug with geolocation that is getting fixed in 2.6.X, that’ll probably solve the location issue for you :slight_smile:

As for airtable, there’s a tutorial here.

Hi Mevi,
Thanks for your reply. So, i’ve been watching and reading all kind of tutorials and i managed to (almost) finish my first app on Appgyver. I am a bit familiar with airtable because i have 5 databases up & running with no problem, but i cant find a way to get the map view module to work.
I’m attaching some screencaps to give you a better view.
My main concerns are:

  1. How do i input the variables from database into map view (which field goes where)
  2. How do i get each marker, when pressed, to open google or apple maps on iphone (apple requirement -_-) and route the user to that specific location?

Thanks again!

Uhhhhh I’m not super familiar with the map view but I’ll try:

  1. it looks to me like you have the fields correctly, but if you want this from your database change binding type to formula and there use MAP to map the fields correctly. Here’s an example we have: Screenshot 2021-03-19 at 14.49.54
  2. Not sure, you’ll have to test this, but I think you’re on the right track with the OpenURL. Check correct scheme for apple maps and google maps from the internet, and see what you get from outputs["Receive event"].event of the onMarkerPress and see if you find the relevant parts to open the correct thing there :slight_smile:

Ahh Mevi so sorry but my knowledge is limited and i cant seem to follow.
I have managed to manually input the markers, labels etc (they are 10 in total so no big deal there) but when i press on each marker it opens google maps (working on android atm) but it doesnt route.
If you can please take a look at my screencaps and maybe you can replicate the flow just to make sure that there isn’t a bug.
Data flows and executes correctly but Google Maps doesnt respect the coordinates.

Thanks again

Hi!

Hmh what do you mean by route? Does it show the marker correctly in google maps? How about trying just from a button click to open google maps with some coordinates in the format google maps requires, does that work?

When i place the markers manually (name, lat, long, etc) it shows them correctly on maps module.
When i click an individual pin:

• on android: opens google maps and it shows me current location (most of the time)
• on ios it doesnt do anything. It doesnt even open apple maps or google maps.

Now, i have another button somewhere, where i configured it with geo: xxxxx and when pressed it works like it should on android but on ios still it doesnt do anything.

I dont know if i’m clear enough. If you need id or screenshots please tell me.

Thanks

Hi Mevi,
any news regarding this issue? Have you tried something similar from your end (especially ios)?
I can confirm that it also doesn’t work on a normal apk build.
On the latest build i did, the map was blank (i read somewhere here that it has to do with maps api key?)
Any help deeply appreciated.

I googled a little and I don’t know if you already had this taken into account, but the url for iOS has to be different than for Android. For Android the url for google maps begins geo:// but for iOS it’s comgooglemaps://. Using the correct url, google maps opens correctly from map view to me.

This must be new or I have missed it. Until now I used maps: or http://maps.apple.com/?q=somePlaceName but with no success. I will try your suggestion.
Meanwhile, I’m attaching a screenshot for anyone that has the same problems with me.
It is an error on ios client when tapping the geo:
(It makes sense now Mevi, because the ios use different approach )

Hey Mevi, comgooglemaps:// doesn’t seem to work.
First of all it prompts you to open google maps (running appgyver on ios and not standalone build) and not apple maps which means the app will not pass on app store (I got rejected multiple times before because I HAD to use apple maps although it sucks).
Secondly, although it opens google maps, it doesn’t take you to the correct coordinates.
Am I missing something here?
I’m using comgooglemaps:lat, long and comgooglemaps://lat, long with no success.

Hi! It should be possible to use maps:// as well. This is not an AppGyver related thing at all, so there are a lot of guides on the topic. See about the URL format e.g. here or here. For google maps, there’s similar guides :slight_smile: So your url should be something like maps://?ll=17.313,74.1932

Hey Mevi, so I published my app, on both platforms accepted (with first try on Apple, go figure :grinning_face_with_smiling_eyes: ) and the funny thing is that it works on both platforms using one string: http://maps.apple.com/?q=lat,long
On iphone it opens Apple Maps (what Apple wants to use) and on Android it opens google maps. This is tested. :smiley:

1 Like

Hello,
I hope someone reads this post.
I am rendering the markers with the example you have posted here and it works fine. Now, I would like that when I click on a marker, it shows me the name of the marker in a popup toast, but I can’t figure out the formula. For example, the formula pageVars.mapMarkers[0].label shows me the name of the object at position 0, but not of the marker.
Can you help me how to do it?
Thanks

Any update on this? As far as I can tell there is no way to distinguish between which marker is pressed in the logic editor…

They can be distinguished! If you link e.g. toast to onMarkerPressed event, and make a formula, using the output event of the onMarkerPressed event, you’ll find the data and latitude/longitude of the pressed marker.

Thank you! Without your comment I didn’t know you could access event.data

1 Like

Hi Mevi,

I think I’m not setting my payload right upon seeding my Map pins, because I’m not able to retrieve the data on the onMarkerPress event. Any chance you can point me in the right direction based on the screenshots below?

Hi! Not sure, check what you do get from event.data, by e.g. Using ENCODE_JSON in an alert/debug log/toast. :thinking:

Hi Mevi,

Thanks for your reply. You pointed me in the right direction!

Setting up the alert toast like this I was eventually able to get the data:

So I managed to get what I wanted with this formula:

1 Like