Getting a Google MAP

Bob Sneidar bobsneidar at iotecdigital.com
Thu Apr 27 18:36:39 EDT 2017


Here is how I get directions in a map:

on mouseUp pMouseBtnNo
   put "https://www.google.com/maps/dir/12150+Mora+Dr,+Santa+Fe+Springs,+CA+90670,+USA/" into theURL
   put the dgHilitedLine of group "dgSites" into theHilitedLine
   put the dgDataOfLine [thehilitedline] of group "dgSites" into aRecordData
   put urlencode(aRecordData["addr1"]) & "+" & \
         urlencode(aRecordData["city"]) & "+" & \
         urlencode(aRecordData["state"]) & "+" & \
         urlencode(aRecordData["zip"]) into theAddress
   set the clipboarddata to \
         aRecordData["addr1"] & space & \
         aRecordData["city"] & space & \
         aRecordData["state"] & space & \
         aRecordData["zip"]
   put theURL & urlencode(theAddress) into theURL
   launch url theURL
end mouseUp

Note I have hardcoded the start location into the URL, but that can be dealt with easy enough. Also I am pullign data from a datagrid, but that also can be sussed out easily enough. This *should* work in a browser object, no? 

Bob S






More information about the use-livecode mailing list