Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the sample for the 3d tiles layer #1662

Merged
merged 19 commits into from
Apr 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -20,25 +20,17 @@

#include "Add3DTilesLayer.h"

#include "AnalysisListModel.h"
#include "AnalysisOverlay.h"
#include "AnalysisOverlayListModel.h"
#include "ArcGISTiledElevationSource.h"
#include "Basemap.h"
#include "Camera.h"
#include "ElevationSourceListModel.h"
#include "Layer.h"
#include "LayerListModel.h"
#include "LocationLineOfSight.h"
#include "MapTypes.h"
#include "Ogc3dTilesLayer.h"
#include "Point.h"
#include <PortalItem.h>
#include "Scene.h"
#include "SceneQuickView.h"
#include "SpatialReference.h"
#include "Surface.h"
#include "TransformationCatalog.h"

#include <MapView.h>
#include <QDebug>
@@ -51,19 +43,13 @@

using namespace Esri::ArcGISRuntime;

const QString DATAPATH = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+ "/ArcGIS/Runtime/Data/";

Add3DTilesLayer::Add3DTilesLayer(QObject* parent /* = nullptr */):
QObject(parent),
m_scene(new Scene(BasemapStyle::ArcGISDarkGray, this))
{
// create a new elevation source from Terrain3D REST service
ArcGISTiledElevationSource* elevationSource = new ArcGISTiledElevationSource(
QUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"), this);
// add projection
TransformationCatalog::setProjectionEngineDirectory(DATAPATH + "/pedata");
if (TransformationCatalog::projectionEngineDirectory().isEmpty())
qWarning() << ("Projection Engine Directory not found at: " + DATAPATH + "/pedata");

// add the elevation source to the scene to display elevation
m_scene->baseSurface()->elevationSources()->append(elevationSource);
@@ -101,9 +87,6 @@ void Add3DTilesLayer::setSceneView(SceneQuickView* sceneView)

void Add3DTilesLayer::initialize()
{
// add an Analysis Overlay
m_analysisOverlay = new AnalysisOverlay(this);
m_sceneView->analysisOverlays()->append(m_analysisOverlay);
// set initial viewpoint
setInitialViewpoint();
}
tanneryould marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -22,8 +22,6 @@ namespace Esri::ArcGISRuntime
class Scene;
class SceneQuickView;
class Ogc3dTilesLayer;
class LocationLineOfSight;
class AnalysisOverlay;
}

#include <QObject>
@@ -55,14 +53,8 @@ class Add3DTilesLayer : public QObject
Esri::ArcGISRuntime::Ogc3dTilesLayer* m_ogc3dTilesLayer = nullptr;
void add3DTilesLayer();

// add lineofsight analysis
Esri::ArcGISRuntime::LocationLineOfSight* m_lineOfSight = nullptr;
Esri::ArcGISRuntime::AnalysisOverlay* m_analysisOverlay = nullptr;
bool m_calculating = false;
void createLineOfSight();
void initialize();
void setInitialViewpoint();
void connectSignals();
};

#endif // ADD3DTILESLAYER_H
Loading