0

Map image with location field?

Is there a way to automatically insert a screenshot of the map with a location field. I would like to be able to print with a picture of the map next to the location field. 

11 replies

null
    • Alexander_Koenig
    • 5 yrs ago
    • Reported - view

    Hi, this could be realized with an http call and the google maps API.

    • blackie
    • 5 yrs ago
    • Reported - view

    I was wondering how to do this. I used importFile().

     

    let myID := this;
    importFile(myID, "https://maps.googleapis.com/maps/api/staticmap?center=" + latitude(Location) + "," + longitude(Location) + "&zoom=13&size=600x300&maptype=roadmap
    &key=YOUR_API_KEY", "my.png");
    Image := file(myID, "my.png")

    • blackie
    • 5 yrs ago
    • Reported - view

    I updated my code so it is one line. It isn't really automatic, it won't work in a trigger.

     

    Image := importFile(this, "https://maps.googleapis.com/maps/api/staticmap?center=" + latitude(Location) + "," + longitude(Location) +"&markers=color:red%7Clabel:X%7C"+latitude(Location) +","+longitude(Location)+ "&zoom=17&size=400x300&maptype=roadmap
    &key=YOUR_API_KEY", "map.png");

    • centralcoasttv805
    • 5 yrs ago
    • Reported - view

    Blackie, thanks! I think this should get me started at the least. I appreciate your time and response!

    Take care

    • Wireditpro
    • 4 yrs ago
    • Reported - view

    I have been desperately seeking a way to import the distance information between to points on a google map using location fields as the current location and the other as the destination.  I am working a project for a friend that works for a food delivery service that wants something quick and easy to record mileage for each trip.

    • blackie
    • 4 yrs ago
    • Reported - view

    should be able to do it with the google distance matrix. I can take a stab at it later, as I think I can also use the code for a delivery service app I am working on.

    https://developers.google.com/maps/documentation/distance-matrix/

    • blackie
    • 4 yrs ago
    • Reported - view

    should be able to do it with the google distance matrix. I can take a stab at it later, as I think I can also use the code for a delivery service app I am working on.

    https://developers.google.com/maps/documentation/distance-matrix/

    • blackie
    • 4 yrs ago
    • Reported - view

    I was able to do it with button code.

     

    let response := http("GET", "https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=" + latitude(Location1) + "," + longitude(Location1) + "&destinations=" + latitude(Location2) + "," + longitude(Location2) + "&key=YourAPIkey");
    if response.error then
    alert(text(response.error))
    else
    distance := text(response.result.rows.'0'.elements.'0'.distance.text)
    end

    • Ppc
    • titanium_fish
    • 4 yrs ago
    • Reported - view

    Hi can you explian what to replace in order to make it work 

    like API key?? 

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Hi, have a look here:
    https://developers.google.com/maps/documentation/javascript/get-api-key

    It seems like you'll gona need a payed subscription in order to get an api key.

    Steven.

    • blackie
    • 4 yrs ago
    • Reported - view

    The account is free, so is the API key. 

    I use it for development and have never had to pay anything. 

    But you do need a billing account.

Content aside

  • 4 yrs agoLast active
  • 11Replies
  • 4118Views