|
POST
|
Darn. Would the fix be in a 200.1.1 or in a 200.3+ delivery?
... View more
09-22-2023
03:42 AM
|
0
|
2
|
668
|
|
POST
|
Most of my samples are modified derivations of an older copy of the FeatureLayerShapefile sample from your github. I added a button in the top left that when clicked toggles the status of what it sends to setAttributionTextVisible. This toggle works on 200.0 but not on 200.1. The errorOccurred signal is not getting triggered also for the mapGraphicsView . main.cpp // Copyright 2017 Esri.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <QApplication>
#include <QMessageBox>
#include "FeatureLayerShapefile.h"
#define STRINGIZE(x) #x
#define QUOTE(x) STRINGIZE(x)
int main(int argc, char *argv[])
{
QApplication application(argc, argv);
#ifdef Q_OS_WIN
// Force usage of OpenGL ES through ANGLE on Windows
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
#endif
FeatureLayerShapefile applicationWindow;
applicationWindow.setMinimumWidth(800);
applicationWindow.setMinimumHeight(600);
applicationWindow.show();
return application.exec();
} FeatureLayerShapefile.h // [WriteFile Name=FeatureLayerShapefile, Category=Layers]
// [Legal]
// Copyright 2017 Esri.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// [Legal]
#ifndef FEATURELAYERSHAPEFILE_H
#define FEATURELAYERSHAPEFILE_H
namespace Esri
{
namespace ArcGISRuntime
{
class Map;
class MapGraphicsView;
class FeatureCollectionTable;
class FeatureCollection;
class FeatureCollectionLayer;
class Feature;
class UniqueValueRenderer;
class FeatureQueryResult;
} // namespace ArcGISRuntime
} // namespace Esri
class QPushButton;
#include <QWidget>
#include <Error.h>
class FeatureLayerShapefile : public QWidget
{
Q_OBJECT
public:
explicit FeatureLayerShapefile(QWidget *parent = nullptr);
~FeatureLayerShapefile() = default;
public slots:
void button1Pressed();
void errorOccurred(Esri::ArcGISRuntime::Error error);
private:
Esri::ArcGISRuntime::Map *m_map = nullptr;
Esri::ArcGISRuntime::MapGraphicsView *m_mapView = nullptr;
QPushButton *m_button = nullptr;
void createAndAddShapefileLayer();
};
#endif // FEATURELAYERSHAPEFILE_H FeatureLayerShapefile.cpp // [WriteFile Name=FeatureLayerShapefile, Category=Layers]
// [Legal]
// Copyright 2017 Esri.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// [Legal]
#include "FeatureLayerShapefile.h"
#include "Map.h"
#include "MapGraphicsView.h"
#include "ShapefileFeatureTable.h"
#include "FeatureLayer.h"
#include "Envelope.h"
#include "LayerListModel.h"
#include "Error.h"
#include "TaskWatcher.h"
#include <QFileInfo>
#include <iostream>
#include <QVBoxLayout>
#include <QPushButton>
using namespace std;
using namespace Esri::ArcGISRuntime;
FeatureLayerShapefile::FeatureLayerShapefile(QWidget *parent /* = nullptr */)
: QWidget(parent)
{
// Create a map using the Imagery with labels basemap
m_map = new Map(this);
// Create a map view, and pass in the map
m_mapView = new MapGraphicsView(m_map, this);
// Create the button to display the input dialog
m_button = new QPushButton("Do Something", this);
m_button->setStyleSheet("QPushbutton#text {color: black;}");
connect(m_button,
&QPushButton::clicked,
this,
&FeatureLayerShapefile::button1Pressed);
// Set up the UI
QVBoxLayout *vBoxLayout = new QVBoxLayout();
vBoxLayout->addWidget(m_mapView);
setLayout(vBoxLayout);
// Create and add the shapefile to the map
createAndAddShapefileLayer();
}
void FeatureLayerShapefile::createAndAddShapefileLayer()
{
// TODO download and update the path in this file
// from
// https://github.com/Esri/arcgis-runtime-samples-data/tree/master/shapefiles
QString dataPath = "../shapefiles/world-continents.shp";
// Create the ShapefileFeatureTable
ShapefileFeatureTable *featureTable =
new ShapefileFeatureTable(dataPath, this);
// Create the feature layer from the ShapefileFeatureTable
FeatureLayer *layer = new FeatureLayer(featureTable, this);
connect(layer,
&FeatureLayer::doneLoading,
this,
[this, layer](Error loadError)
{
cout << __LINE__ << " " << loadError.message().toStdString()
<< endl;
if (!loadError.isEmpty())
return;
// If the layer was loaded successfully, set the map extent to the
// full extent of the layer
m_mapView->setViewpointGeometry(layer->fullExtent());
});
connect(layer,
&FeatureLayer::errorOccurred,
this,
[this, layer](Error loadError)
{
cout << __LINE__ << " " << loadError.message().toStdString()
<< " " << loadError.additionalMessage().toStdString()
<< endl;
});
connect(featureTable,
&ShapefileFeatureTable::errorOccurred,
this,
[this, layer](Error loadError) {
cout << __LINE__ << " " << loadError.message().toStdString()
<< endl;
});
connect(m_mapView,
&MapGraphicsView::errorOccurred,
this,
[this, layer](Error loadError) {
cout << __LINE__ << " " << loadError.message().toStdString()
<< endl;
});
layer->load();
// Add the shapefile layer to the map
m_map->operationalLayers()->clear();
m_map->operationalLayers()->append(layer);
}
void FeatureLayerShapefile::errorOccurred(Esri::ArcGISRuntime::Error error)
{
printf("FeatureLayerShapefile::onErrorOccurred errorType = %d, domain = %d, "
"extendedErrorType = %d, %s %s\n",
(int)error.errorType(),
(int)error.domain(),
(int)error.extendedErrorType(),
error.message().toStdString().c_str(),
error.additionalMessage().toStdString().c_str());
}
void FeatureLayerShapefile::button1Pressed()
{
static bool shown = false;
shown = !shown;
cout << "button1Pressed shown = " << shown << endl;
m_mapView->setAttributionTextVisible(shown);
m_mapView->update();
}
... View more
09-19-2023
12:03 PM
|
0
|
4
|
2237
|
|
POST
|
I can put something together here in a day or two once I get my environment back to 200.0 temporarily and confirm it works there and then that it does not work on 200.1
... View more
09-18-2023
10:16 AM
|
0
|
0
|
2255
|
|
POST
|
Calling update explicitly does not seem to fix this for me. I fiddled with my code to temporarily backdoor one of my other toggles to try switching attribution text off and on once everything was up and running (thinking I was calling too early before some async loadable became available) but adding the update call does not seem to be having any effect.
... View more
09-15-2023
05:13 AM
|
0
|
0
|
2288
|
|
POST
|
linux/ubuntu 22.04. I censored out our key info but I can send it in a direct message or email if you like. // Before initializing ArcGIS Runtime, set the
// ArcGIS Runtime license.
QStringList extensions = QStringList();
extensions.append(QString(
"runtimeanalysis,1000,[key info removed],none,[key info removed]"));
Esri::ArcGISRuntime::LicenseResult result =
Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::setLicense(
QString("runtimestandard,1000,[key info removed],none,[key info removed]"),
extensions);
printf("LicenseResult created with status of: %d\n",
(int)result.licenseStatus());
for( const auto& extension : result.extensionsStatus().toStdMap())
{
printf("LicenseResult extension %s created with status of: %d\n",
extension.first.toStdString().c_str(),
(int)extension.second);
}
printf("License expiration date: %s\n",
Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::license()->expiry().toString().toStdString().c_str());
printf("License isPermanent: %d\n",
Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::license()->isPermanent());
printf("License licenseLevel: %d\n",
(int)Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::license()->licenseLevel());
// Use this code to check for licensing errors
if (Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::initialize() == false)
{
application.quit();
return 1;
} And here is the output of those printf statements LicenseResult created with status of: 3
LicenseResult extension runtimeanalysis created with status of: 3
License expiration date: Sun Aug 17 07:12:55 292278994
License isPermanent: 1
License licenseLevel: 3
... View more
09-15-2023
04:02 AM
|
0
|
0
|
2289
|
|
POST
|
And further experimentation with calling it with true, then false does not seem to do anything. If I call isAttributionTextVisible that is returning false.
... View more
09-14-2023
08:33 AM
|
0
|
0
|
2358
|
|
POST
|
Thanks Mike, good luck with my more complicated question from today
... View more
09-14-2023
08:19 AM
|
0
|
0
|
1047
|
|
POST
|
I just updated my setup to 200.1 (200.2 requires new Qt version my setup cant update to yet) and even though I am calling "mapGraphicsView->setAttributionTextVisible(false);" the "Powered by Esri" bar still shows up on my map. I checked my license and my extensions and they both have a licenseStatus of 3/Valid.
... View more
09-14-2023
07:19 AM
|
0
|
12
|
3074
|
|
POST
|
https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-licenseresult.html#:~:text=obtained%20from%20the-,extentionStatus,-()%20function. "extention" should be "extension"
... View more
09-14-2023
06:23 AM
|
0
|
3
|
1069
|
|
POST
|
I am guessing from your question that you have a mainly offline workflow since you mentioned using a mobile map package? Are you using vector tiles as a basemap? I think in some of the conference demos Esri like to show they can do neat stuff with vector styles, I just dont know if the runtime Qt/maps Qt allows you to change the style with the data underlying not changing. reference: https://www.youtube.com/watch?v=COf8isFlebE
... View more
04-04-2023
04:31 AM
|
0
|
1
|
2195
|
|
POST
|
Visual Studio versus QtCreator, they just abstract away a lot of the setup magic to get code working. Code is Code and if the setup is correct and works on one you should be able to copy/paste snippets from one to the other and it should work. Confirm your assumptions that the buttons are wired up for the start and stop sketching functions by putting a qdebug/cout/print statement right at the beginning of it saying you made it there. Calling sketchEditor->start returns a bool value whether it started successfully or not, print that out. Why is your work inheriting from MapView? Is that the pattern your professor gave to you or is that how Visual Studio makes new projects? Welcome to the wide world of debugging, this is what makes or breaks a good software developer. For reward, if I help fix your problem, then accept it as a solution. I just realized yesterday that this subforum has a widget that shows who has the most accepted solutions for the past month and I am currently doing better than the Esri employees and want to brag about that when I see them at FedGIS next week and at devsummit in a month lol.
... View more
02-03-2023
04:35 AM
|
2
|
2
|
1636
|
|
POST
|
code examples from the Esri github tend to be better than the announcements pages in my opinion https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/SketchOnMap/SketchOnMap.cpp From what it looks to me in your code is that you need to have the sketchEditor be a class level variable and add a stopSketching function wired into a second button with lines 6 and 7 from your code snippet moved to it. // in your header file, initialize as nullptr so that you can protect against out of order button clicking
Esri::ArcGISRuntime::SketchEditor* sketchEditor = nullptr;
// in your implementation file
void AppView::startSketching()
{
if (sketchEditor == nullptr)
{
sketchEditor = new SketchEditor(this);
setSketchEditor(sketchEditor);
}
sketchEditor->start(SketchCreationMode::Polygon);
}
void AppView::stopSketching()
{
if (sketchEditor == nullptr)
{
return;// TODO log an error before return
}
Geometry sketchGeometry = sketchEditor->geometry();// TODO do something with the geometry?
sketchEditor->stop();
}
... View more
02-02-2023
05:39 AM
|
2
|
4
|
1655
|
|
POST
|
The user in your docker container may not have permission to use the display, try calling "xhost +" before the postinstall to enable that. Our dockerfiles do not call the postinstaller script though so you may be able to get away with not calling it and still be able to compile and run stuff. And to answer your next question for when you get there, once you have runtime Qt installed and a software piece compiling in docker, and you want to run it in docker, use xvfb(X Virtual Frame Buffer) to get the displayless docker to pretend that it has a display. "/usr/bin/xvfb-run --auto-servernum $your_executable"
... View more
01-30-2023
04:56 AM
|
0
|
0
|
1439
|
|
POST
|
I just had a look at our silent installer for 100.14 where we modified a copy of the Setup script to set and export an IATEMPDIR=$Esri_Install_Directory inside the append_to_install_dir function. Then calling that with "./Setup.modified -s" gets the silent install to work for us. I think your attempt to call install.bin manually didnt work right since you didnt provide a -f "$Esri_Silent_Property_File" argument to it for writing the esri properties file to a specific location that is used later when compiling the sample.
... View more
01-25-2023
04:54 AM
|
0
|
0
|
1369
|
|
POST
|
I figured out I can just iterate through all the graphics in my overlay and for each of them have a new polylineBuilder that will make new parts and points with a scaled Z factor and then call setGeometry on each of them.
... View more
01-10-2023
11:24 AM
|
1
|
0
|
1394
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-28-2025 05:13 AM | |
| 1 | 03-03-2025 04:51 AM | |
| 3 | 07-24-2024 04:54 AM | |
| 1 | 04-15-2024 04:42 AM | |
| 1 | 06-03-2024 05:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-28-2025
05:07 AM
|