Hi, i installed ArcGIS Runtime Qt 10.2.3. Local server failed to start when i test the first sample. It seems the ArcGISRuntime::installDirectory() returns null because the path returned is not right. When i set the install path by using setInstallDirectory function, the local server works. However, the window popped up shows nothing.
Code:
QString mypath="/home/wu/arcgis/runtime_sdk/qt10.2.3";
EsriRuntimeQt::ArcGISRuntime::setInstallDirectory(mypath);
EsriRuntimeQt::ArcGISRuntime::setRenderEngine(EsriRuntimeQt::RenderEngine::OpenGL);
m_mapGraphicsView = EsriRuntimeQt::MapGraphicsView::create(m_map, this);
setCentralWidget(m_mapGraphicsView);
m_map.setWrapAroundEnabled(false);
// 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();
QString dataPath = pathSampleData + "mpks" + QDir::separator() + "USCitiesStates.mpk";
m_localMapService = EsriRuntimeQt::LocalMapService(dataPath);
// connect to signal that is emitted when the service is created successfully
connect(&m_localMapService, SIGNAL(serviceCreationSuccess(const QString&, const QString&)), this, SLOT(onLocalServiceCreationSuccess(const QString&, const QString&)));
// connect to signal that is emitted when the service failed
connect(&m_localMapService, SIGNAL(serviceCreationFailure(const QString&)), this, SLOT(onLocalServiceCreationFailure(const QString&)));
// start the service and the Local Server
m_localMapService.start();
Hi Jone:
Can you share which platform you are running on? Linux? Windows?
Hi Bader, i run on Red Hat Enterprise Linux 6 64bit. Another question is that the map browse is not very fluent when i used the tpk file(about 10M). Is the ArcGis server is necessary if i need to add a more large map file(100M for example)? My computer is 8G memory and i7 processor.
The size of the tpk should not have an effect on performance. You should be ok there.
Still not sure what issue your Local Server is having.
Try this.
Open it, look for any errors in that file, and post them here. Lets see what they indicate.
Thanks
Hi Bader, I have solved the problem after i installed ArcGis Runtime for Qt again.
But another question is that the map loads not very fluent when i used the sample(both tpk and mpk files). I also have tried to connect to ArcGIS Server 10.1(in LAN) to access the tpk file(Topographic.tpk in sample, It's fast when i used browser to access it). It still works not very well. Is there any way to optimize the loading methods? I used the code the sample provides:
m_tiledServiceLayer=EsriRuntimeQt::ArcGISTiledMapServiceLayer('http://xxxxx');
m_map.addLayer(m_tiledServiceLayer);
Thank you very much!