title: Google Maps API routing for a Java desktop application
body: <p>I want to have a map integrated into my Java desktop application where I can set an origin and destination and show the route on the map.</p>
  
  <p>I have signed up to Google Maps API and have received a key, this provided me with the json data of the route but that is not what I need. How would I apply this data to a map in my Java application? 
  It does not have to be Googles map, as long as it is a map with the route.</p>
  
  <p>I have tried using the Google Maps Embed API, but this must only be used in an iFrame. Instead of the map loading the following text is displayed "The Google Maps Embed API must be used in an iframe.". However if I wrap this in an iFrame and open in a browser I get the desired results.</p>
  
  <p>Any advise would be useful.</p>
  
  <p><strong>Code below</strong></p>
  
  <pre><code> @Override
  public void initialize(URL location, ResourceBundle resources) {
      WebEngine browser = mapView.getEngine();
      mapView.getEngine().load(mapPathBuilder("London","Luton"));
  }
  
  public String mapPathBuilder(String from, String to){
      String url = "https://www.google.com/maps/embed/v1/directions?key=";
      String googleAPI = "****************";
      String origin = "&amp;origin=";
      String destination = "&amp;destination=";
      String result = url+googleAPI+origin+from+destination+to;
      return result;
  }
  </code></pre>