Issue
I would like to start working on a JavaFX desktop app that will work heavily (if all goes well) with the Google Maps APIs. I've been having a more difficult time getting started than I thought I would, and at this point I am just asking that somebody please provide an example of some code that would simply load the map and pin a few locations on it. Any help at all would be so appreciated. The best I've been able to do so far is just load maps.google.com in a WebView, which obviously did not involve the APIs at all and really serves me no purpose right now.
Solution
I am just asking that somebody please provide an example of some code that would simply load the map and pin a few locations on it.
One of the ways you can do this is using a combination of HTML, Javascript and JavaFX. Create a google maps instance in html and javascript then call the URL in your JavaFX program using WebEngine class. WebEngine loads Web pages, creates their document models, applies styles as necessary, and runs JavaScript on pages. After that you'll use WebView to display the google map content like:
final WebEngine webEngine = new WebEngine(getClass().getResource("googlemap.html").toString());
final WebView webView = new WebView(webEngine);
Here's a link with sample codes to get you started.
Answered By - noogui
Answer Checked By - Mary Flores (JavaFixing Volunteer)