0

I want to develop a java application using google maps that let the user add navigate using a map and add waypoints, and also I want to retrieve the latitude and longitude information from those waypoints, my question is if it is possible, I have been reading about many API's or external jars for doing this but recently I find out this Google Maps Services Java and don't know if it is enough to let me do that work, so, anyone know if it is possible with this new API? or should I use an external work? thank you.

gabo
  • 1
  • 2
  • http://stackoverflow.com/questions/19701105/embed-google-maps-in-java-desktop-application This post will help you :) – Shivangi Nigam Feb 17 '15 at 07:45
  • Hi, I already had read that post, is why I'm searching official alternatives, and not use only static maps – gabo Feb 17 '15 at 19:12

1 Answers1

1

I know this answer is coming a year later, but try using the JxBrowser library. I've found it to be the best library from what is already out there.

https://sites.google.com/a/teamdev.com/jxbrowser-support/home

They only give you a free 30 day trial with the license for their library, however I've personally found it to be very helpful. Once you download all the JAR files and import them into your project (I used Eclipse, but you can use whatever), import the following code:

package com.mycompany.myproduct;

import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;

import javax.swing.*;
import java.awt.*;

public class BrowserSample {
   public static void main(String[] args) {
    Browser browser = new Browser();
    BrowserView browserView = new BrowserView(browser);

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.add(browserView, BorderLayout.CENTER);
    frame.setSize(700, 500);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);

    browser.loadURL("http://maps.google.com");
    }
}

Once you run this, you'll get a default view of Google Maps as you would if you were to go to the actual web link in Chrome or Safari.

Connor Bailey
  • 69
  • 1
  • 13