* I was expecting it to pick the .tpk file from the qt build folder... Anyways
Thanks Jeanne for your reply... and yes... you are right about Scenario 3. Since I had placed the file in Build directory also... I was expecting it to pick the .tpk file from the file. Anyways... I have checked during Runtime... OPEN GL version : 2.0 .... Qt installed is 5.1.1 with VS 2012 (Downloaded from http://download.qt-project.org/archive/qt/5.1/5.1.1/qt-windows-opensource-5.1.1-msvc2012-x86-offline.exe )
Hi Bushan,
Scenario 1 and 2 should work. However Scenario 3 will not work since it is a directory not a file path that will be returned.
If you do: qWarning() << temp_1.dirName() you will see that in the application output you will get just the tpk name:
"RasterHillshade.tpk".
My question is: What is the version of Visual Studio are you running? VS 2012?
What is the version of Qt are you using? You will need to run a version of Qt that is above 5.1.1 and it has to be using OpenGL with VS2012.
thanks,
Jen Trieu | Product Eng.
Hello Eric,
First of all.. Thanks for your interest....
Kindly chk the following code snippet
Note: There are 3 Scenarios which I tried. * Scenario 1 and 2 failed during running due Invalid NULL Pointer in Visual Studio file. (I have attached the snapshot of both cases). I believe it is to do something with the type of slash.
* Scenario 3 I tried using QDir and No exception was thrown however no map was loaded into the application.
For easy understanding I have placed Topograpgraphic.tpk in C:/ Drive also.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GIS_App::GIS_App(QWidget *parent)
: QMainWindow(parent)
{
// set to openGL rendering
EsriRuntimeQt::ArcGISRuntime::setRenderEngine(EsriRuntimeQt::RenderEngine::OpenGL);
m_mapGraphicsView = EsriRuntimeQt::MapGraphicsView::create(m_map, this);
setCentralWidget(m_mapGraphicsView);
m_map.setWrapAroundEnabled(true);
// show Esri logo by default
m_map.setEsriLogoVisible(true);
QString path = EsriRuntimeQt::ArcGISRuntime::installDirectory();
path.append("/sdk/samples/data");
QDir dataDir(path); // using QDir to convert to correct file separator
QString pathSampleData = dataDir.path() + QDir::separator();
//// Local Tiled Basemap Layer using: sdk/samples/data/tpks/Topographic.tpk
// senario 1
QString tiledBaseMapLayer = pathSampleData + "tpks" + QDir::separator() + "Topographic.tpk";
// senario 2
QString temp = ("C:/RasterHillshade.tpk");
// scenario 3
QDir temp_1 = ("C:/RasterHillshade.tpk");
m_tiledLayer = EsriRuntimeQt::ArcGISLocalTiledLayer(temp_1.dirName());//
m_map.addLayer(m_tiledLayer);
//// connect to signal that is emitted when the map is ready
//// the mapReady signal is emitted when the Map has obtained a
//// spatial reference from an added layer
connect(&m_map, SIGNAL(mapReady()), this, SLOT(onMapReady()));
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Scenario 1
Scenario 2
Scenario 3:
Scenario 3 output:
Hello,
Can you share the code that is not working for you? It might help us identify what may be wrong.
Thanks
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.