This topic contains 1 reply, has 2 voices, and was last updated by  admin 5 years, 5 months ago.

  • Author
    Posts
  • #75223

    Evan Ellis
    Participant

    Hello,

    I am using a server installation with client side scripting. I saw on one of your previous posts that said with client side scripting I would somehow have to convert the address that I have into latitude and longitude to use google maps with address pins. I entered in my API and the maps part works, but would you be able to shed some light on how I would go about getting the latitude/longitude from an address using client side scripting? When I selected products for the API, I selected maps/routes, and left places blank. Let me know if you need more information.

    I have the addresses in the following format if thats important:

    12345 street, city, ST 12345

    I am using FMP17/FMS17 on an OSX machine.

  • #75224

    admin
    Keymaster

    Hi Evan –

    You are correct. In our starter file “soSIMPLE Calendar.fmp12,” we have a script called “Update Lat Lng”. We run this script every time we update an event (from the Action script) and check if the location has changed. If the location has changed we get a new lat lng using Google Maps api.

    The Update Lat Lng script sets lat/lng using a Set field from URL script step. The URL includes the full address to be mapped.

    You need add the API key from Google to that URL in the form &key=<api key>.

    The API key from Google must have rights to the Google Geoquery API.

    In our example file, the final url looks like this:

    Substitute ( “https://maps.googleapis.com/maps/api/geocode/xml?key=<your google key>&address=” & calendar_data::Location ; ” ” ; “+” )

     

You must be logged in to reply to this topic.