Local Tiled Layer not loading

3801
6
Jump to solution
10-17-2014 06:07 AM
BhushanShetty
New Contributor II
Hi all, help, after i installed ArcGIS Runtime Qt 10.2.3 ....There are no Debug Errors. Same sample code as give in ArcGIS Runtime SDK... An application window pops up however there is no basemap shown. FYI: Graphic card used is GeForce 9200.
0 Kudos
1 Solution

Accepted Solutions
BhushanShetty
New Contributor II

* I was expecting it to pick the .tpk file from the qt build folder... Anyways

View solution in original post

0 Kudos
6 Replies
EricBader
Occasional Contributor III

Hello,

Can you share the code that is not working for you? It might help us identify what may be wrong.

Thanks

0 Kudos
BhushanShetty
New Contributor II

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

QString_tiledBaseMApLayer.PNG

Scenario 2

QString_temp.PNG

Scenario 3:

Scenario 3 output:QString_temp_1.PNG

QString_temp_1_output.PNG

0 Kudos
JeanneTrieu
Occasional Contributor

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.

0 Kudos
BhushanShetty
New Contributor II

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...

0 Kudos
BhushanShetty
New Contributor II

* I was expecting it to pick the .tpk file from the qt build folder... Anyways

0 Kudos
BhushanShetty
New Contributor II

And I have installed VS 2012 express edition update 5

0 Kudos