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
-
Hi, this could be realized with an http call and the google maps API.
-
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") -
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"); -
Blackie, thanks! I think this should get me started at the least. I appreciate your time and response!
Take care
-
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.
-
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/
-
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/
-
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 -
Hi can you explian what to replace in order to make it work
like API key??
-
Hi, have a look here:
https://developers.google.com/maps/documentation/javascript/get-api-keyIt seems like you'll gona need a payed subscription in order to get an api key.
Steven.
-
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
- 5 yrs agoLast active
- 11Replies
- 4149Views