fmpGoogleMap ( address ; city ; state ; zip ; country )
Webviewer address display using Google Maps
Average rating: 4.7 (22 votes) Log in to vote
Robert Jackson RJ Plus Consulting http://rjplusconsulting.tk |
[
~address = Contacts::Work Address 1;
~city = Contacts::Work City;
~state = Contacts::Work State;
~zip = Contacts::Work Postal Code;
~country = Contacts::Work Country;
~result =
"https://www.google.com/maps/place/" &
Case ( IsEmpty (~address) ; "" ; Substitute (~address;" ";"+") )& "+" &
Case ( IsEmpty (~city ); "" ; Substitute (~city;" ";"+") )& "+" &
Case ( IsEmpty ( ~state) ; "" ; Substitute (~state;" ";"+") )& "+" &
Case ( IsEmpty (~zip) ; "" ; Substitute (~zip;" ";"+") )& "+" &
Case ( IsEmpty ( ~country) ; "" ; Substitute (~country; " " ; "+") )
];
~result
)
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
// fmpGooglemap ( address ; city ; state ; zip ; country )
// Aims:
// display FileMaker address using Google Maps
// avoid using Google API
// avoid using iFrame
// author Robert Jackson (Scotland)
Let (
[
~address = address;
~city = city;
~state = state;
~zip = zip;
~country = country;
~result =
"https://www.google.com/maps/place/" &
Case ( IsEmpty (~address) ; "" ; Substitute (~address;" ";"+") ) & "+" &
Case ( IsEmpty (~city ); "" ; Substitute (~city;" ";"+") ) & "+" &
Case ( IsEmpty ( ~state) ; "" ; Substitute (~state;" ";"+") ) & "+" &
Case ( IsEmpty (~zip) ; "" ; Substitute (~zip;" ";"+") ) & "+" &
Case ( IsEmpty ( ~country) ; "" ; Substitute (~country;"";"+" ) )
];
~result
)
Comments
Tim Anderson, Tim Anderson Group Jun 12, 2015 |
||
Thanks Robert! | ||
Robert Jackson, Scotland Jun 12, 2015 |
||
tidied up code | ||
comment, VR Jun 15, 2015 |
||
What is the difference between: Case ( IsEmpty (~address) ; "" ; Substitute (~address;" ";"+") ) and: Substitute (~address;" ";"+") |
||
Vyke, Washington DC Jul 6, 2015 |
||
If you just do Substitute(~address;" ";"+"), then, if the address is empty, you will get a +, which will screw up the calc. |
||
Michael Leiser, BYA Jun 15, 2023 |
||
Doesn't work. Shows the map for a second and then gives an error about updating my browsers. They are updated. This happened recently for any google map function. I even got an API but don't know where to use it. | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.