D3vilRemix
D3vilRemix

Reputation: 9

how to get static map image from google maps url. Java

I am currently working on a java application in netbeans, which I require to display a map in the JFrame. I need to get a map that I created before so I have the url, but I just need to be an image (jpg or png).

for example this map:

https://www.google.co.ve/maps/dir/8.0969559,-63.5596847/Ciudad+Bol%C3%ADvar/@8.116559,-63.5568846,14z/am=t/data=!4m9!4m8!1m0!1m5!1m1!1s0x8dce862a669e5b7b:0xd96f2f60189fcd57!2m2!1d-63.55!2d8.122!3e0?hl=es

or

https://goo.gl/maps/0EFUd

from that url I get an image to load in my JFrame.   Any idea how to do it?

Upvotes: 0

Views: 2758

Answers (1)

copolii
copolii

Reputation: 14506

I think you're looking for the Google Maps static image API. Based on your link, this is the map:

https://maps.googleapis.com/maps/api/staticmap?center=8.114508,%20-63.556119&size=640x640&scale=2&zoom=14&markers=size%3Dmid%7Ccolor%3Aorange%7Clabel%3AS%7C8.116559%2C-63.5568846

If you want to configure it here's the guide: https://developers.google.com/maps/documentation/staticmaps/?csw=1

I'm not sure how (if at all) you can include the directions on the static maps.

Upvotes: 1

Related Questions