Beispiel #1
0
/**
 * @brief Default constructor
 * @param parent
 */
MarbleMap::MarbleMap(QWidget *parent) :
  MarbleWidget(parent), m_gd_document(NULL),
  m_marble_runner_mgr(NULL), m_current_marker(NULL),
  m_markers_count(0), m_curr_popup_x(0), m_curr_popup_y(0)
{
  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  setMapThemeId("earth/bluemarble/bluemarble.dgml");
  setShowScaleBar(false);
  setShowGrid(false);
  setShowCrosshairs(false);
  setShowPlaces(false);
  setShowCities(false);
  
  MarbleWidgetInputHandler* l_h = inputHandler();
  l_h->setMouseButtonPopupEnabled(Qt::LeftButton, false);
  l_h->setMouseButtonPopupEnabled(Qt::RightButton, false);
  
  connect(l_h, SIGNAL(mouseClickScreenPosition(int,int)), this, SLOT(mouseLeftClick(int, int)));
  connect(l_h, SIGNAL(rmbRequest(int,int)), this, SLOT(mouseRightClick(int, int)));
  
  m_gd_document = new GeoDataDocument();
  model()->treeModel()->addDocument(m_gd_document);
  
  m_marble_runner_mgr = new MarbleRunnerManager(model()->pluginManager());
  m_marble_runner_mgr->setModel(model());
}
Beispiel #2
0
GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0)
{
	// check if Google Sat Maps are installed
	// if not, check if they are in a known location
	MapThemeManager mtm;
	QStringList list = mtm.mapThemeIds();
	QString theme, subsurfaceDataPath;
	QDir marble;
	bool foundGoogleMap = false;
	Q_FOREACH(theme, list)
		if (theme == "earth/googlesat/googlesat.dgml")
			foundGoogleMap = true;
	if (!foundGoogleMap) {
		subsurfaceDataPath = getSubsurfaceDataPath("marbledata");
		if (subsurfaceDataPath != "")
			MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
	}
	messageWidget = new KMessageWidget(this);
	messageWidget->setCloseButtonVisible(false);
	messageWidget->setHidden(true);

	setMapThemeId("earth/googlesat/googlesat.dgml");
	//setMapThemeId("earth/openstreetmap/openstreetmap.dgml");
	setProjection(Marble::Spherical);

	setAnimationsEnabled(true);
	setShowClouds(false);
	setShowBorders(false);
	setShowPlaces(true);
	setShowCrosshairs(false);
	setShowGrid(false);
	setShowOverviewMap(false);
	setShowScaleBar(true);
	setShowCompass(false);
	connect(this, SIGNAL(mouseClickGeoPosition(qreal, qreal, GeoDataCoordinates::Unit)),
			this, SLOT(mouseClicked(qreal, qreal, GeoDataCoordinates::Unit)));

	setMinimumHeight(0);
	setMinimumWidth(0);
	editingDiveCoords = 0;
	fixZoomTimer = new QTimer();
	connect(fixZoomTimer, SIGNAL(timeout()), this, SLOT(fixZoom()));
	fixZoomTimer->setSingleShot(true);
}