mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
Merge pull request #6172 from manisandro/master
[Globe] Adapt for API changes
This commit is contained in:
commit
8b682dad1a
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user