Skip to content
Permalink
Browse files

[Globe] Adapt for API changes

  • Loading branch information
manisandro committed Jan 25, 2018
1 parent 34c2d32 commit 0d1ef01850fc3a86204ef001128befad53b1941f
Showing with 6 additions and 8 deletions.
  1. +6 −7 src/plugins/globe/globe_plugin.cpp
  2. +0 −1 src/plugins/globe/qgsglobetilesource.cpp
@@ -26,7 +26,6 @@
#include "featuresource/qgsglobefeatureoptions.h"

#include <qgisinterface.h>
#include <qgscrscache.h>
#include <qgslogger.h>
#include <qgsapplication.h>
#include <qgsmapcanvas.h>
@@ -637,7 +636,7 @@ QgsRectangle GlobePlugin::getQGISLayerExtent() const
void GlobePlugin::showCurrentCoordinates( const osgEarth::GeoPoint &geoPoint )
{
osg::Vec3d pos = geoPoint.vec3d();
emit xyCoordinates( QgsCoordinateTransformCache::instance()->transform( GEO_EPSG_CRS_AUTHID, mQGisIface->mapCanvas()->mapSettings().destinationCrs().authid() ).transform( QgsPointXY( pos.x(), pos.y() ) ) );
emit xyCoordinates( QgsCoordinateTransform( QgsCoordinateReferenceSystem( GEO_EPSG_CRS_AUTHID ), mQGisIface->mapCanvas()->mapSettings().destinationCrs(), QgsProject::instance()->transformContext() ).transform( QgsPointXY( pos.x(), pos.y() ) ) );
}

void GlobePlugin::setSelectedCoordinates( const osg::Vec3d &coords )
@@ -666,11 +665,11 @@ void GlobePlugin::syncExtent()
if ( mapSettings.destinationCrs().authid().compare( QString( "EPSG:%1" ).arg( epsgGlobe ), Qt::CaseInsensitive ) != 0 )
{
QgsCoordinateReferenceSystem srcCRS( mapSettings.destinationCrs() );
extent = QgsCoordinateTransform( srcCRS, globeCrs ).transformBoundingBox( extent );
extent = QgsCoordinateTransform( srcCRS, globeCrs, QgsProject::instance()->transformContext() ).transformBoundingBox( extent );
}

QgsDistanceArea dist;
dist.setSourceCrs( globeCrs );
dist.setSourceCrs( globeCrs, QgsProject::instance()->transformContext() );
dist.setEllipsoid( "WGS84" );

QgsPointXY ll = QgsPointXY( extent.xMinimum(), extent.yMinimum() );
@@ -958,7 +957,7 @@ void GlobePlugin::updateLayers()
else
{
drapedLayers.append( mapLayer );
QgsRectangle extent = QgsCoordinateTransformCache::instance()->transform( mapLayer->crs().authid(), GEO_EPSG_CRS_AUTHID ).transform( mapLayer->extent() );
QgsRectangle extent = QgsCoordinateTransform( mapLayer->crs(), QgsCoordinateReferenceSystem( GEO_EPSG_CRS_AUTHID ), QgsProject::instance()->transformContext() ).transform( mapLayer->extent() );
mLayerExtents.insert( mapLayer->id(), extent );
}
}
@@ -1032,7 +1031,7 @@ void GlobePlugin::layerChanged( QgsMapLayer *mapLayer )
}
}
mTileSource->setLayers( layers );
QgsRectangle extent = QgsCoordinateTransformCache::instance()->transform( mapLayer->crs().authid(), GEO_EPSG_CRS_AUTHID ).transform( mapLayer->extent() );
QgsRectangle extent = QgsCoordinateTransform( mapLayer->crs(), QgsCoordinateReferenceSystem( GEO_EPSG_CRS_AUTHID ), QgsProject::instance()->transformContext() ).transform( mapLayer->extent() );
mLayerExtents.insert( mapLayer->id(), extent );
}
// Remove any model layer of that layer, in case one existed
@@ -1041,7 +1040,7 @@ void GlobePlugin::layerChanged( QgsMapLayer *mapLayer )
#else
mMapNode->getMap()->removeModelLayer( mMapNode->getMap()->getModelLayerByName( mapLayer->id().toStdString() ) );
#endif
QgsRectangle layerExtent = QgsCoordinateTransformCache::instance()->transform( mapLayer->crs().authid(), GEO_EPSG_CRS_AUTHID ).transform( mapLayer->extent() );
QgsRectangle layerExtent = QgsCoordinateTransform( mapLayer->crs(), QgsCoordinateReferenceSystem( GEO_EPSG_CRS_AUTHID ), QgsProject::instance()->transformContext() ).transform( mapLayer->extent() );
QgsRectangle dirtyExtent = layerExtent;
if ( mLayerExtents.contains( mapLayer->id() ) )
{
@@ -18,7 +18,6 @@
#include <osgEarth/Registry>
#include <osgEarth/ImageUtils>

#include "qgscrscache.h"
#include "qgsglobetilesource.h"
#include "qgscoordinatetransform.h"
#include "qgslogger.h"

0 comments on commit 0d1ef01

Please sign in to comment.
You can’t perform that action at this time.