POST
|
Hi James , We tried this pseudo code but still we are not able to load two mmpk data for single screen.Go through this code if i am doing any mistak, Please inform. path1 = "/home/Gis/ChartEngine/Arcgis/Runtime/Data/MMpk/India.mmpk";
path2 = "/home/Gis/ChartEngine/Arcgis/Runtime/Data/MMpk/Pak.mmpk";
void CTacticalViewClass::LoadingOfmmpkfile(const QUrl &file,const QUrl &file2) { QString dataPath = file.toString(); QString dataPath2 = file2.toString(); m_mobileMapPackage = new MobileMapPackage(dataPath, this); m_mobileMapPackage1 = new MobileMapPackage(dataPath2, this); connect(m_mobileMapPackage, &MobileMapPackage::doneLoading, this, [this](Error error) { if (error.isEmpty()) { m_mapView->setMap(m_mobileMapPackage->maps().at(0)); m_mobileMapPackage1->load(); } }); connect(m_mobileMapPackage1, &MobileMapPackage::doneLoading, this, [this](Error) { auto* map2 = m_mobileMapPackage1->maps().at(0); qDebug()<<"Operational layer count ------>>"<<m_mobileMapPackage1->maps().at(0)->operationalLayers()->size()<<"map2"<<map2->operationalLayers()->size();//here 3 operational layer is coming QList<Layer*> layersFromMap2; //***** We made changes in for loop because we were getting error in for loop LayerListModel* layerFromMap2; for (int i = 0;i<m_mobileMapPackage1->maps().at(0)->operationalLayers()->size();i++) { layersFromMap2.append(m_mobileMapPackage1->maps().at(0)->operationalLayers()->at(i)); layerFromMap2 = map2->operationalLayers(); layerFromMap2->setParent(this); // re-parent the layers } qDebug()<<"layersFromMap2"<<layersFromMap2.size()<<"layerFromMap2 "<<layerFromMap2->size(); // delete the map delete map2; ////********************** After deletion of map2 ,we are getting operational layers as zero // // add all the layers to the mapView's map auto* operationalLayers = m_mapView->map()->operationalLayers(); for (auto* layer : layersFromMap2) operationalLayers->append(layer); qDebug()<<"total layers "<<operationalLayers->size(); }); m_mobileMapPackage->load();
... View more
02-07-2020
04:46 AM
|
0
|
0
|
961
|
POST
|
Hi James , We tried this pseudo code but still we are not able to load two mmpk data for single screen.Please go through this code if i am doing any mistak void CTacticalViewClass::LoadingOfmmpkfile(const QUrl &file,const QUrl &file2) { QString dataPath = file.toString(); QString dataPath2 = file2.toString(); m_mobileMapPackage = new MobileMapPackage(dataPath, this); m_mobileMapPackage1 = new MobileMapPackage(dataPath2, this); connect(m_mobileMapPackage, &MobileMapPackage::doneLoading, this, [this](Error error) { if (error.isEmpty()) { m_mapView->setMap(m_mobileMapPackage->maps().at(0)); qDebug()<<"m_mapView->map()->operationalLayers()"<<m_mapView->map()->operationalLayers()->size()<<m_mobileMapPackage->maps().at(0)->operationalLayers()->size(); m_mobileMapPackage1->load(); } }); /* * tried but not working completely connect(m_mobileMapPackage1, &MobileMapPackage::doneLoading, this, [this](Error) { auto* map2 = m_mobileMapPackage1->maps().at(0); qDebug()<<"Operational layer count ------>>"<<m_mobileMapPackage1->maps().at(0)->operationalLayers()->size()<<"map2"<<map2->operationalLayers()->size(); QList<Layer*> layersFromMap2; LayerListModel* layerFromMap2; for (int i = 0;i<m_mobileMapPackage1->maps().at(0)->operationalLayers()->size();i++) { qDebug()<<"i - "<<i; layersFromMap2.append(m_mobileMapPackage1->maps().at(0)->operationalLayers()->at(i)); layerFromMap2 = map2->operationalLayers(); layerFromMap2->setParent(this); // re-parent the layers } qDebug()<<"layersFromMap2"<<layersFromMap2.size()<<"layerFromMap2 "<<layerFromMap2->size(); // delete the map delete map2; // // add all the layers to the mapView's map for (int i = 0;i<layersFromMap2.size();i++) { m_mapView->map()->operationalLayers()->append(layersFromMap2.at(i)); qDebug()<<"operationalLayers "<<m_mapView->map()->operationalLayers()->size(); } auto* operationalLayers = m_mapView->map()->operationalLayers(); for (auto* layer : layersFromMap2) operationalLayers->append(layer); qDebug()<<"total layers "<<operationalLayers->size(); });
... View more
02-07-2020
04:38 AM
|
0
|
1
|
961
|
POST
|
Hi , Thank you for reply , I am not able to re-author the data .It will be very appreciable if you can provide some example code ,for loading more than one mmpk file for single mapview.
... View more
02-03-2020
09:59 PM
|
0
|
0
|
961
|
POST
|
Hi , Thank you for reply , I am not able to re-author the data .It will be very appreciable if you can provide some example code ,for loading more than one mmpk file for single mapview.
... View more
02-03-2020
08:03 PM
|
0
|
4
|
961
|
POST
|
Hello, I want to know how we can load more than one mmpk file for a single screen.Right now I am using this c++ in qt Creator 5.12.0 and ARCGIS 100.4 on RHEL 7.6.Go through this code if i am doing any mistake then please correct. path1 = "/home/Gis/ChartEngine/Arcgis/Runtime/Data/MMpk/India.mmpk";
path2 = "/home/Gis/ChartEngine/Arcgis/Runtime/Data/MMpk/Pak.mmpk"; MobileMapPackage * m_mobileMapPackage1 = new MobileMapPackage(path1, this); connect(m_mobileMapPackage1, &MobileMapPackage::doneLoading, this, [this](Error error) { m_mapView->setMap(m_mobileMapPackage1->maps().at(0)); });
MobileMapPackage * m_mobileMapPackage2 = new MobileMapPackage(path1, this);
connect(m_mobileMapPackage2, &MobileMapPackage::doneLoading, this, [this](Error error) { m_mapView->setMap(m_mobileMapPackage2->maps().at(0)); }); m_mobileMapPackage->load(); m_mobileMapPackage2->load(); So when screen is coming , whatever is getting loaded last that one is only getting shown in screen. My project requirement :- I have to show india and pak in a single view by using mmpk file.Aditya PeriAlexandra GajewskiAndrew RossAllen ThompsonRebecca McKinleyJon Fiskness Hilary LeavellHuailin wangArcGIS IdeasException rendering offline FeatureLayerquery on ShapefileFeatureTable
... View more
02-02-2020
07:39 AM
|
0
|
7
|
1120
|
POST
|
hi, I understand what you want to tell.But My confusion is related to database file which will contain tables.I have India.shp , India.shx and India.dbf file.To Know column names which file i will use (India.shp, India.shx or India.dbf) or anyother file will be required .If possible can you give some example of your used shape file and database file.It will be more helpfull. Thanku
... View more
02-02-2020
07:14 AM
|
0
|
0
|
513
|
POST
|
Thanku for reply. I Have taken a look at the labeling sample -arcgis-runtime-samples-qt/ShowLabelsOnLayers.cpp at master · Esri/arcgis-runtime-samples-qt · GitHub . After code change i am not able to get state names and getting some error like this Exception thrown in Feature_source_layer::Feature_source_layer_label_data_source::get_next_feature() - "SQL error or missing database" - "no such column: rte_num1" which file i have to prefer for column name .shp, .shx or .dbf file please check this code void CTacticalViewClass::LoadingOfServiceFeatureFile() { ShapefileFeatureTable* servicefeatureTable = new ShapefileFeatureTable("/home/GIS/Desktop/ChartEngineMainFolder/ChartEngine/ArcGIS/Runtime/Data/shp/India/india_st.shp", this); servicefeatureTable->load(); FeatureLayer* featureLayer = new FeatureLayer(servicefeatureTable, this); connect(featureLayer, &FeatureLayer::doneLoading, [this, featureLayer](Error e) { if (!e.isEmpty()) return; m_mapShapeView->setViewpoint(Viewpoint(featureLayer->fullExtent().center(), 56759600)); }); m_Shapemap->operationalLayers()->append(featureLayer); // Apply labels to the feature layer const QString labelJson = createLabelJson(); LabelDefinition* labelDef = LabelDefinition::fromJson(labelJson, this); featureLayer->labelDefinitions()->append(labelDef); featureLayer->setLabelsEnabled(true); } QString CTacticalViewClass::createLabelJson() const { return QString(QStringLiteral("{\"labelExpressionInfo\":{\"expression\":\"'I - ' + $feature.rte_num1\"},\"labelPlacement\":\"esriServerLinePlacementAboveAlong\",\"where\":\"rte_num1 <> ' '\",\"symbol\": {\"angle\":0,\"backgroundColor\":[0,0,0,0],\"borderLineColor\":[0,0,0,0],\"borderLineSize\":0,\"color\":[0,0,255,255],\"font\": {\"decoration\":\"none\",\"size\":15,\"style\":\"normal\",\"weight\":\"normal\"},\"haloColor\":[255,255,0,255],\"haloSize\":1.5,\"horizontalAlignment\":\"center\",\"kerning\":false,\"type\":\"esriTS\",\"verticalAlignment\":\"middle\",\"xoffset\":0,\"yoffset\":0}}")); }
... View more
01-30-2020
12:11 AM
|
0
|
2
|
513
|
POST
|
Hello, I am new in arcgis .I am trying to load shapefile with state names .I want to load state names from local file not online data .I have .shx,.shp.dbf and .geodatabase files in my system .Please give some solution my code void CTacticalViewClass::LoadingOfServiceFeatureFile() { ServiceFeatureTable* servicefeatureTable = new ServiceFeatureTable(QUrl("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/layers/2"), this); FeatureLayer* featureLayer = new FeatureLayer(servicefeatureTable, this); connect(featureLayer, &FeatureLayer::doneLoading, [this, featureLayer](Error e) { if (!e.isEmpty()) return; m_mapShapeView->setViewpoint(Viewpoint(featureLayer->fullExtent().center(), 56759600)); }); m_Shapemap->operationalLayers()->append(featureLayer); // Apply labels to the feature layer const QString labelJson = createLabelJson(); LabelDefinition* labelDef = LabelDefinition::fromJson(labelJson, this); featureLayer->labelDefinitions()->append(labelDef); featureLayer->setLabelsEnabled(true); m_mapShapeView->setMap(m_Shapemap); } ServiceFeatureTable will contain which kind of local file. Aditya PeriAlexandra GajewskiAllen ThompsonJon FisknessGary ChryslerHuailin wang@
... View more
01-27-2020
05:08 AM
|
0
|
4
|
656
|
POST
|
hi,I am new in Arcgis .I want to know how i can show state names on shape file.Currently i am using following code to load shape file from local system. void CTacticalViewClass::LoadingOfShapeFile(const QUrl& file) { QString dataPath = file.toString();//this contains india.shp ShapefileFeatureTable* featureTable = new ShapefileFeatureTable(dataPath, this); featureTable->load(); layer = new FeatureLayer(featureTable, this); m_Shapemap->operationalLayers()->append(layer); m_mapShapeView->setMap(m_Shapemap); m_mapShapeView->show(); m_mapShapeView->raise(); }
... View more
01-26-2020
11:50 PM
|
0
|
0
|
1726
|
POST
|
How to show state names label on shape file map content in c++ program in qt.
... View more
01-26-2020
07:57 PM
|
0
|
1
|
246
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|