Results 1 to 3 of 3
- 11-14-2010, 05:42 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 2
- Rep Power
- 0
google maps static api on java se
I need some help in using google maps static api.
it involves connecting to a url link, and the link then sends the map as an image to the application.
i am having trouble in connecting with the GET service to fetch the image.
also the image fetched will be a byte array, then how to convert in into an image to be displayed .?
there is a program for the job in J2ME, but i need it as a desktop application.
Google Maps API in Java ME - Forum Nokia Wiki is the link to the program in J2ME.
- 11-14-2010, 07:44 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
note:
"use of static maps outside of the browser is not allowed. (Google Maps API Premier users are waived of this requirement.)" --> Google Static Maps API - Google Code
You could use the ImageIO class:
Java Code:public static void main(String[] args) throws Exception{ JFrame frame = new JFrame(); JPanel panel = new JPanel(); BufferedImage image = ImageIO.read(new URL("http://maps.google.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&sensor=false")); JLabel label = new JLabel(new ImageIcon(image)); panel.add(label); frame.add(panel); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); }
- 11-14-2010, 10:09 PM #3
Member
- Join Date
- Nov 2010
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
How to create a google like drop down in java using a jcombobox
By charithdula in forum AWT / SwingReplies: 1Last Post: 11-14-2010, 08:44 AM -
Error: svn: mergeinfo for 'oldpath/someclass.java' maps to an empty revision range
By maskellp in forum IntelliJ IDEAReplies: 0Last Post: 07-12-2010, 11:57 AM -
how to use google finance api java
By theseven in forum New To JavaReplies: 1Last Post: 02-13-2010, 02:45 PM -
Java application using google calendar
By nikolas8 in forum Java AppletsReplies: 3Last Post: 03-20-2009, 12:49 AM -
Google Maps API
By mew in forum New To JavaReplies: 0Last Post: 12-26-2007, 10:28 AM


LinkBack URL
About LinkBacks

Bookmarks