Beispiel #1
0
GlobeGPS::GlobeGPS(QWidget *parent) : MarbleWidget(parent),
    loadedDives(0),
    messageWidget(new KMessageWidget(this)),
    fixZoomTimer(new QTimer(this)),
    currentZoomLevel(0),
    needResetZoom(false),
    editingDiveLocation(false)
{
    // check if Google Sat Maps are installed
    // if not, check if they are in a known location
    MapThemeManager mtm;
    QStringList list = mtm.mapThemeIds();
    QString subsurfaceDataPath;
    QDir marble;
    if (!list.contains("earth/googlesat/googlesat.dgml")) {
        subsurfaceDataPath = getSubsurfaceDataPath("marbledata");
        if (subsurfaceDataPath.size()) {
            MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
        } else {
            subsurfaceDataPath = getSubsurfaceDataPath("data");
            if (subsurfaceDataPath.size())
                MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
        }
    }
    messageWidget->setCloseButtonVisible(false);
    messageWidget->setHidden(true);

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

    setAnimationsEnabled(true);
    Q_FOREACH (AbstractFloatItem *i, floatItems()) {
        i->setVisible(false);
    }
Beispiel #2
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 #3
0
MapBrowserWidget::MapBrowserWidget(QWidget *parent)
  : Marble::MarbleWidget(parent),
    KFormDesigner::FormWidgetInterface(),
    KexiFormDataItemInterface(),
    m_slotMapChanged_enabled(true),
    m_internalReadOnly(false)
{
#ifndef Q_CC_MSVC
#warning this id could be invalid; try to use Marble::MapThemeManager::mapThemes() and get proper Marble::GeoSceneDocument::head()->mapThemeId()
#endif
  //Marble::GeoSceneDocument::head()->mapThemeId()
  setMapThemeId("earth/srtm/srtm.dgml");
  connect( this, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this , SLOT(slotMapChanged()));
}
Beispiel #4
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);
}
Beispiel #5
0
GlobeGPS::GlobeGPS(QWidget *parent) : MarbleWidget(parent),
	loadedDives(0),
	messageWidget(new KMessageWidget(this)),
	fixZoomTimer(new QTimer(this)),
	needResetZoom(false),
	editingDiveLocation(false),
	doubleClick(false)
{
#ifdef MARBLE_SUBSURFACE_BRANCH
	// we need to make sure this gets called after the command line arguments have
	// been processed but before we initialize the rest of Marble
	Marble::MarbleDebug::setEnabled(verbose);
#endif
	currentZoomLevel = -1;
	// check if Google Sat Maps are installed
	// if not, check if they are in a known location
	MapThemeManager mtm;
	QStringList list = mtm.mapThemeIds();
	QString subsurfaceDataPath;
	QDir marble;
	if (!list.contains("earth/googlesat/googlesat.dgml")) {
		subsurfaceDataPath = getSubsurfaceDataPath("marbledata");
		if (subsurfaceDataPath.size()) {
			MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
		} else {
			subsurfaceDataPath = getSubsurfaceDataPath("data");
			if (subsurfaceDataPath.size())
				MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
		}
	}
	messageWidget->setCloseButtonVisible(false);
	messageWidget->setHidden(true);

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

	setAnimationsEnabled(true);
	Q_FOREACH (AbstractFloatItem *i, floatItems()) {
		i->setVisible(false);
	}