Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: JAVA and Google Maps

  1. #1
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,629
    Thanks
    25
    Thanked 322 Times in 300 Posts

    Default JAVA and Google Maps

    Quick question.

    I am trying to have a Google Maps querying in a program I am making. Does anyone know if it is possible to use the Google Maps API for Flash (Google Maps API for Flash - Google Code), Google Maps for JAVASCRIPT (The Google Maps Javascript API V3 - Google Maps JavaScript API V3 - Google Code), the Google Static Maps API (Google Static Maps API - Google Code), or the Google Maps API Web Services (Google Maps API Web Services - Google Maps API Web Services - Google Code) directly in a JAVA program? And if it is possible, can someone steer me in the correct direction?

    Thanks in advance.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,298
    My Mood
    Hungover
    Thanks
    142
    Thanked 620 Times in 531 Posts

    Default Re: JAVA and Google Maps

    I'm not sure exactly what you're trying to do, so I'm not sure this will help, but it looks promising: Building Maps into Your Swing Application with the JXMapViewer | Java.net
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,298
    My Mood
    Hungover
    Thanks
    142
    Thanked 620 Times in 531 Posts

    Default Re: JAVA and Google Maps

    Did that work for you? Out of my own curiosity, I got it working with OpenStreetMap, and it's pretty cool for how easy it is.

    However, other than having a fancy globe in a JPanel, I'm not sure where to go from there. Did you have any luck with any other mapping APIs?

    I'm pretty curious about this myself, so I would love to hear what you've done.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,629
    Thanks
    25
    Thanked 322 Times in 300 Posts

    Default Re: JAVA and Google Maps

    Quote Originally Posted by KevinWorkman View Post
    Did that work for you? Out of my own curiosity, I got it working with OpenStreetMap, and it's pretty cool for how easy it is.

    However, other than having a fancy globe in a JPanel, I'm not sure where to go from there. Did you have any luck with any other mapping APIs?

    I'm pretty curious about this myself, so I would love to hear what you've done.
    We are still playing around with it. Thanks for the link, it could prove to be very useful. Our current design is using OpenStreetMap but we want to provide alternative maps for users to use.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,298
    My Mood
    Hungover
    Thanks
    142
    Thanked 620 Times in 531 Posts

    Default Re: JAVA and Google Maps

    Quote Originally Posted by aussiemcgr View Post
    We are still playing around with it. Thanks for the link, it could prove to be very useful. Our current design is using OpenStreetMap but we want to provide alternative maps for users to use.
    Yeah, I'd like to be able to switch between different map providers as well (if only for my own curiosity). The example in the link provides a couple examples, but they all seem to be down now. I'd be curious about what you come up with, so I'd love it if you kept me updated!
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,629
    Thanks
    25
    Thanked 322 Times in 300 Posts

    Default Re: JAVA and Google Maps

    I'm just trying to get OpenMaps to work consistently at the moment. Right now I'm fighting with a good way to get the images from the html calls without the program lagging. Things get really bad when I implemented the panning feature. I could use some suggestions for a good way of doing this. Here is the progression of my experience:

    Attempt 1:
    HTML query for each pan movement -> Pros: Straight-forward. Cons: Heavy querying and considerably slowed down program

    Attempt 2:
    2D 3X3 Array of Images for temporary storage -> Pros: Adjacent images can be displayed as newly adjacent images load. This was designed to minimize the runtime HTML querying as much as possible and preempt the user's next desired image. Cons: Map edges became very apparent with image jumping when moving to next saved map. Only had significant performance advantage when moving between 4 adjacent images (2x2 grid)


    Since I didn't get totally what I wanted from the above two, I'm thinking of another way of doing it and I want some suggestions before I actually code this up. Dynamically sized 2D Data Structure to store temporary Map Images for revisiting. I figure this would require some way to "trash" images that were not practical to return to. My thoughts on this would be to use a "decay-style" indicator where, for example, if 5 images have been loaded since X image was last accessed, X image can be trashed. If images are revisited, the decay timer would reset, and not require a new HTML query to load the image.

    This would still have the problem of Map Image edges. Does anyone know of any way to temporarily combine images to allow panning through archived images and effectively cover-up the edges?


    Any thoughts or suggestions are GREATLY appreciated. I've been racking my brain over an efficient way of doing this.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  7. #7
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,298
    My Mood
    Hungover
    Thanks
    142
    Thanked 620 Times in 531 Posts

    Default Re: JAVA and Google Maps

    I take it you're working from something other than what I posted? That's fine as I fully admit I'm out of my depth with this stuff (I'd love to play around with it more, but web stuff doesn't fit into my brain), but it's going to be pretty hard for anybody to give you advice without seeing any code.

    Even with code, I predict that this is more a case of having to try stuff out in your specific environment until you find something you like. With what I posted, I also experience some lag, but I should point out that even Google Earth or any other mapping software contains the same kind of lag. It might be unavoidable.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #8
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,629
    Thanks
    25
    Thanked 322 Times in 300 Posts

    Default Re: JAVA and Google Maps

    Quote Originally Posted by KevinWorkman View Post
    I take it you're working from something other than what I posted? That's fine as I fully admit I'm out of my depth with this stuff (I'd love to play around with it more, but web stuff doesn't fit into my brain), but it's going to be pretty hard for anybody to give you advice without seeing any code.

    Even with code, I predict that this is more a case of having to try stuff out in your specific environment until you find something you like. With what I posted, I also experience some lag, but I should point out that even Google Earth or any other mapping software contains the same kind of lag. It might be unavoidable.
    Ya, well I know that since it is an HTML query so it is logically limited to the speed of your connection and the speed of the online server. My post above is asking for advice for a good way to 1) Minimize lag as much as possible by limiting HTML querying and 2) Providing a nice flow of displaying the images.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

Similar Threads

  1. How to Send emails from Google Mail using JavaMail API
    By JavaPF in forum Java SE API Tutorials
    Replies: 3
    Last Post: February 26th, 2012, 03:21 PM
  2. Google Webservice Problem
    By buckeyeone in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 14th, 2010, 07:37 PM
  3. google search
    By nasi in forum Java Theory & Questions
    Replies: 7
    Last Post: April 2nd, 2010, 03:13 AM
  4. Design question about maps
    By KaleeyJ in forum Java Theory & Questions
    Replies: 1
    Last Post: February 2nd, 2010, 03:17 AM
  5. Convert Maps of String to Map of Maps
    By abhay8nitt in forum Collections and Generics
    Replies: 1
    Last Post: October 27th, 2009, 07:27 AM