Creating Google Maps Screen

Ask Google Maps.

If you can do it in Google Maps, then you break down the syntax and parameters used in the URL, or possibly their Form submission fields.

Once you have that done, we can go from there to possibly integrate it into the Automation.

it can be done in Google maps as it allows you to enter multiple post code/address. in below example i have three.

Ok @morshed1, now copy and paste the URL into a code block here to see if we can discern the parameters used. Like this, but make sure you get the entire URL…

https://maps.google.com/maps?saddr=YOURADDRESS&daddr={ENTITY DATA:Customer:Address}&hl=en

Shouldn’t make any difference. The Custom Data Field could be called “fluffythecat” if you so desired. This should work:

https://maps.google.com/maps?saddr=YOURADDRESS&daddr={ENTITY DATA:Customer:Direccion}&hl=en

If it does not work, you probably have a typo somewhere. You can also try restarting SambaPOS to clear the cache.

i have all my database address named (DIRECCION) in the custom field and the googlemaps doesn’t find the address , how to fix it?

It may be case-sensitive - try:

https://maps.google.com/maps?saddr=YOURADDRESS&daddr={ENTITY DATA:Customer:DIRECCION}&hl=en

I have tried and doesn’t work for me , but only works if i change the custom fields name to address but my database of the Direccion dissapear.thanks.

https://www.google.co.il/maps/dir/Ein+Netafim+St+101,+Eilat/Bnei+Yisra'el+St+6,+Eilat/Ein+Mor+St,+Eilat/@29.5469874,34.9295613,16z/data=!3m1!4b1!4m20!4m19!1m5!1m1!1s0x1500723c5b2eba95:0x2a153f0c5c403207!2m2!1d34.9363215!2d29.5439091!1m5!1m1!1s0x15007215ec997195:0x47a9fc4ed1ccd485!2m2!1d34.932836!2d29.5498777!1m5!1m1!1s0x1500723e4b963b4f:0xe09768ed992cf4fe!2m2!1d34.9316047!2d29.5478344!3e0?hl=en

@QMcKay We can learn from that? What parameters??

LOL, that looks a little scary.

I can see 3 locations in there, with addresses, and a Latitude,Longitude, which might be your starting point? So we have this:

Ein+Netafim+St+101,+Eilat
Bnei+Yisra'el+St+6,+Eilat
Ein+Mor+St,+Eilat
@29.5469874,34.9295613,16z

Everything after that (i.e. /data=...) doesn’t seem to be a requirement.

In your case, I assume you need to format your URL in SambaPOS as:

https://www.google.co.il/maps/dir/ADDRESS1/ADDRESS2/ADDRESS3/@LATITUDE,LONGITUDE,16z

Or maybe the addresses are in the reverse order:

https://www.google.co.il/maps/dir/ADDRESS3/ADDRESS2/ADDRESS1/@LATITUDE,LONGITUDE,16z

@QMcKay Thank you so much
It looks right, but when I mark several Tickets Sambapos separates addresses with a comma
For example ADDRESS1, ADDRESS2, ADDRESS3
And I need separated this way ADDRESS1 / ADDRESS2 / ADDRESS3
What to do?

You can use the replace() function.

[:CommandValue] R:[='[:CommandValue]'.replace(',','/')]

Specifically, this part:

[='[:CommandValue]'.replace(',','/')]

But you will need to do more about it, since the addresses contain commas as well. You could build the URL 1 piece at a time using a Loop Values Action, and an Update Program Setting Action to store the separated addresses.

I don’t know what is going to happen with this, since your addresses contain commas, and the list that is sent inside [:CommandValue] is comma-separated, but this is the basic theory:

This is using Ticket Ids, but the idea is the same. Look what happens as it builds the Address List (AL) while it loops through values…

2 Likes

@QMcKay
Thank you very much for Your genius mind it works great

https://www.google.co.il/maps/dir/YOURADDRESS/[='[:CommandValue]'.replace(',','/')]/@LATITUDE,LONGITUDE,16z

Dear @QMcKay
Now I need to calculate the distance between two points,How can I read the distance from Google Maps And place it in ticket Tag?
Thank you so much

what is typo means?how can i transfer all my data in direccion to address?

Typo means you typed something incorrectly. You spelled something wrong. Or you use miXeD cASe when you should not have, because something might be case-sensitive.

A Typo can be difficult to spot. This is incorrect - in fact, there are 3 Typos below:

{Setting;AddresList}

This is correct:

{SETTING:AddressList}

It is impossibe to tell why it is not working for you without seeing some screenshots of your setup.

Consider this:

https://maps.google.com/maps?saddr=Aşkabat Cd. No 30/A Bahçelievler Ankara&daddr={ENTITY DATA:Customer:Address}&hl=en

Now take the part having to do with the Address:

{ENTITY DATA:Customer:Address}

Did you rename your Customer Entity to something else, like Cliente? If so, then change it here:

{ENTITY DATA:Cliente:Address}

And you say you changed Address to DIRECCION ? Ok, change that too…

{ENTITY DATA:Cliente:DIRECCION}

See, there are a number of reasons this might not work for you. It could be a problem in your Entity setup, yours Actions, your Rules - it could be you’re running an older version of SambaPOS…

1 Like

I begin setup in Sambapos V3 in spanish then udgrade to V4 , do you think this might be the problem?thanks

It should not be a problem but you must understand that V4 will be in English and there is no option for Spanish. If its just setting names that you typed in Spanish then you should be ok.

1 Like

I think it already did a lot more than expected :slight_smile: What you need to access here is google maps api (web service). On next release we’ll give access to web services via our scripting system so you’ll be able to create custom printer template tags that prints the response of a web service. We already tested displaying weather forecast data and it worked fine.

btw. @QMcKay that was an amazing idea and great implementation. From now on I’ll ask your idea before rejecting our private client’s requests because something similar recently asked and I never thought that is already possible, lol.

…also I’ve checked displaying recent order locations on map and I think we’ll be able to implement that. The problem is we need to know lot/long of addresses as we can mark locations on map via coordinates. Google has an address to geolocation converter api (via Geocoding Service https://developers.google.com/maps/documentation/javascript/geocoding). After releasing V5 I’ll pay some more attention.

3 Likes

i have try with field named address and it works , but all my address data is in field named Direccion, nad doesn’t work.i don’t know why ,i replaced field name address to direccion and doesn’t work.how can i change the field name to address with all the address data in direccion:?thanks