File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -507,15 +507,20 @@ double GlobePlugin::getSelectedElevation()
507
507
508
508
void GlobePlugin::syncExtent ()
509
509
{
510
+ QgsMapCanvas* mapCanvas = mQGisIface ->mapCanvas ();
511
+ QgsMapRenderer* mapRenderer = mapCanvas->mapRenderer ();
512
+ QgsRectangle extent = mapCanvas->extent ();
513
+
510
514
osgEarth::Util::EarthManipulator* manip = dynamic_cast <osgEarth::Util::EarthManipulator*>( mOsgViewer ->getCameraManipulator () );
511
515
// rotate earth to north and perpendicular to camera
512
516
manip->setRotation ( osg::Quat () );
513
517
514
- // get mapCanvas->extent().height() in meters
515
- QgsRectangle extent = mQGisIface ->mapCanvas ()->extent ();
516
518
QgsDistanceArea dist;
517
- dist.setEllipsoidalMode ( true );
518
- // dist.setProjectionsEnabled( true );
519
+
520
+ dist.setSourceCrs ( mapRenderer->destinationCrs ().srsid () );
521
+ dist.setEllipsoidalMode ( mapRenderer->hasCrsTransformEnabled () );
522
+ dist.setEllipsoid ( QgsProject::instance ()->readEntry ( " Measure" , " /Ellipsoid" , GEO_NONE ) );
523
+
519
524
QgsPoint ll = QgsPoint ( extent.xMinimum (), extent.yMinimum () );
520
525
QgsPoint ul = QgsPoint ( extent.xMinimum (), extent.yMaximum () );
521
526
double height = dist.measureLine ( ll, ul );
You can’t perform that action at this time.
0 commit comments