1. Laraina Stevens
  2. Sherlock Holmes
  3. JavaFX
  4. Friday, 20 July 2018
  5.  Subscribe via email
please help me........
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
At first download jar file - Download GMapsFX JAR 2.10.0
and add it into your project Library folder...

Refer the code:



import com.lynden.gmapsfx.GoogleMapView;
import com.lynden.gmapsfx.MapComponentInitializedListener;
import com.lynden.gmapsfx.javascript.object.GoogleMap;
import com.lynden.gmapsfx.javascript.object.LatLong;
import com.lynden.gmapsfx.javascript.object.MapOptions;
import com.lynden.gmapsfx.javascript.object.MapType;
import com.lynden.gmapsfx.javascript.object.Marker;
import com.lynden.gmapsfx.javascript.object.MarkerOptions;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.stage.Stage;


public class MainApp extends Application implements MapComponentInitializedListener {

GoogleMapView mapView;
GoogleMap map;

@Override
public void start(Stage stage) throws Exception {

//Create the JavaFX component and set this as a listener so we know when
//the map has been initialized, at which point we can then begin manipulating it.
mapView = new GoogleMapView();
mapView.addMapInializedListener(this);

Scene scene = new Scene(mapView);

stage.setTitle("JavaFX and Google Maps");
stage.setScene(scene);
stage.show();
}


@Override
public void mapInitialized() {
//Set the initial properties of the map.
MapOptions mapOptions = new MapOptions();

mapOptions.center(new LatLong(47.6097, -122.3331))
.mapType(MapType.ROADMAP)
.overviewMapControl(false)
.panControl(false)
.rotateControl(false)
.scaleControl(false)
.streetViewControl(false)
.zoomControl(false)
.zoom(12);

map = mapView.createMap(mapOptions);

//Add a marker to the map
MarkerOptions markerOptions = new MarkerOptions();

markerOptions.position( new LatLong(47.6, -122.3) )
.visible(Boolean.TRUE)
.title("My Marker");

Marker marker = new Marker( markerOptions );

map.addMarker(marker);

}

public static void main(String[] args) {
launch(args);
}
}

Comment
There are no comments made yet.
  1. more than a month ago
  2. JavaFX
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
The perfect methods on how to set the world map in javafx? Really very useful and getting essential budgets. Great techniques, the rushessay.com prices for all the students, you can follow the blog for wonderful rush essays and more topics.
Comment
There are no comments made yet.
  1. more than a month ago
  2. JavaFX
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Share Location

Sharing your current location while posting a new question allow viewers to identify the location you are located.

Latitude:
Longitude:
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.