Google maps GMapsFX显示空白地图
我收到两条错误消息:Google maps GMapsFX显示空白地图,google-maps,javafx,Google Maps,Javafx,我收到两条错误消息: ERROR com.lynden.gmapsfx.GoogleMapView - Error: User data directory [null (C:\Users\Admin\AppData\Roaming\application.Main\webview)] is already in use 及 我在Eclipse上使用JAVAFX11库,我已经编辑了我的运行配置以添加javafx.web模块。 我认为当我创建一个GoogleMapView对象时会出现问题,但我不
ERROR com.lynden.gmapsfx.GoogleMapView - Error: User data directory [null (C:\Users\Admin\AppData\Roaming\application.Main\webview)] is already in use
及
我在Eclipse上使用JAVAFX11库,我已经编辑了我的运行配置以添加javafx.web模块。
我认为当我创建一个GoogleMapView对象时会出现问题,但我不知道如何解决!谢谢你给任何能帮助我的人的建议
这是我的控制器类:
package controllers;
import java.net.URL;
import java.util.ResourceBundle;
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.MapTypeIdEnum;
import com.lynden.gmapsfx.service.geocoding.GeocodingService;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
public class GMaps_Controller implements Initializable, MapComponentInitializedListener{
@FXML
private GoogleMapView gmapView;
@FXML
private TextField nomeField;
@FXML
private TextField capField;
@FXML
private TextField addressField;
@FXML
private Button findAddress;
@FXML
private Button findCap;
@FXML
private Button findNome;
private GoogleMap map;
private GeocodingService geocodingService;
private StringProperty address = new SimpleStringProperty();
@FXML
void findAddressPushed(ActionEvent event) {
}
@FXML
void findCapPushed(ActionEvent event) {
}
@FXML
void findNomePushed(ActionEvent event) {
}
@Override
public void initialize(URL location, ResourceBundle resources) {
gmapView.addMapInializedListener(this);
address.bind(addressField.textProperty());
}
@Override
public void mapInitialized() {
geocodingService = new GeocodingService();
MapOptions mapOptions = new MapOptions();
mapOptions.center(new LatLong(41.8919300, 12.5113300))
.mapType(MapTypeIdEnum.ROADMAP)
.overviewMapControl(false)
.panControl(false)
.rotateControl(false)
.scaleControl(false)
.streetViewControl(false)
.zoomControl(false)
.zoom(12);
map = gmapView.createMap(mapOptions);
}
}
package controllers;
import java.net.URL;
import java.util.ResourceBundle;
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.MapTypeIdEnum;
import com.lynden.gmapsfx.service.geocoding.GeocodingService;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
public class GMaps_Controller implements Initializable, MapComponentInitializedListener{
@FXML
private GoogleMapView gmapView;
@FXML
private TextField nomeField;
@FXML
private TextField capField;
@FXML
private TextField addressField;
@FXML
private Button findAddress;
@FXML
private Button findCap;
@FXML
private Button findNome;
private GoogleMap map;
private GeocodingService geocodingService;
private StringProperty address = new SimpleStringProperty();
@FXML
void findAddressPushed(ActionEvent event) {
}
@FXML
void findCapPushed(ActionEvent event) {
}
@FXML
void findNomePushed(ActionEvent event) {
}
@Override
public void initialize(URL location, ResourceBundle resources) {
gmapView.addMapInializedListener(this);
address.bind(addressField.textProperty());
}
@Override
public void mapInitialized() {
geocodingService = new GeocodingService();
MapOptions mapOptions = new MapOptions();
mapOptions.center(new LatLong(41.8919300, 12.5113300))
.mapType(MapTypeIdEnum.ROADMAP)
.overviewMapControl(false)
.panControl(false)
.rotateControl(false)
.scaleControl(false)
.streetViewControl(false)
.zoomControl(false)
.zoom(12);
map = gmapView.createMap(mapOptions);
}
}