Getting a Google MAP

William Prothero waprothero at gmail.com
Thu Apr 27 19:43:22 EDT 2017


Hmm, I must have spoken too soon. This actually works!

on mouseUp

    put mapURL() into tURL

    put URL tURL into x

    put x into image "myGMap"

end mouseUp


function mapURL

		put "https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=AIzaSyCO423QzwaEEBmiw4XjPKzz4Tcg_5bjHv4" into retURL

		return retURL

end mapURL



> On Apr 27, 2017, at 3:36 PM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 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
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list