POST
|
... and I think the issue in your original code block is with this segment of the code: QVariantMap att = graphic->attributes()->attributesMap();
att[QLatin1String("height")] = 1000000; the QVariantMap is not returned by reference - therefore you need to call graphic->attributes()->setAttributesMap(att); to apply the height attribute to your graphics.
... View more
06-02-2017
07:18 AM
|
1
|
0
|
1077
|
POST
|
Hi Norbert, Here's a snippet of our ExtrudeGraphics sample re-written for widgets UI. In theory it is possible to copy the toolkit etc. into your Qt kit and run those samples without running the PostInstaller but it is not recommended. Does this code work for you? Untitled10::Untitled10(QWidget *parent /*=nullptr*/): QMainWindow(parent), m_sceneView(nullptr) { // Create a scene using the topographic BaseMap Scene* scene = new Scene(Basemap::topographic(this), this); // create a new elevation source from Terrain3D rest service ArcGISTiledElevationSource* elevationSource = new ArcGISTiledElevationSource( QUrl("http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"), this); // add the elevation source to the scene to display elevation scene->baseSurface()->elevationSources()->append(elevationSource); // Create a scene view, and pass in the scene m_sceneView = new SceneGraphicsView(scene, this); // set the sceneView as the central widget setCentralWidget(m_sceneView); // create a camera Camera camera(28.4, 83.9, 10010.0, 10.0, 80.0, 300.0); // set the viewpoint m_sceneView->setViewpointCameraAndWait(camera); // graphics location double lon = camera.location().x() - 0.03; double lat = camera.location().y() + 0.2; GraphicsOverlay* graphicsOverlay = new GraphicsOverlay(this); // set renderer with extrusion property SimpleRenderer* renderer = new SimpleRenderer(this); RendererSceneProperties props = renderer->sceneProperties(); props.setExtrusionMode(ExtrusionMode::BaseHeight); props.setExtrusionExpression("[height]"); renderer->setSceneProperties(props); SimpleFillSymbol* sfs = new SimpleFillSymbol(SimpleFillSymbolStyle::Solid, QColor("red"), this); renderer->setSymbol(sfs); graphicsOverlay->setRenderer(renderer); // setup graphic locations QList<Point> pointsList; for (auto i = 0; i <= 100; i++) { Point point(i / 10 * (0.01 * 2) + lon, i % 10 * (0.01 * 2) + lat, m_sceneView->spatialReference()); pointsList.append(point); } foreach (auto point, pointsList) { // create a random z value int randNum = rand() % 6 + 1; double z = 1000 * randNum; // create a list of points QList<Point> points; points << Point(point.x(), point.y(), z) << Point(point.x() + 0.01, point.y(), z) << Point(point.x() + 0.01, point.y() + 0.01, z) << Point(point.x(), point.y() + 0.01, z); // create a new graphic Graphic* graphic = new Graphic(createPolygonFromPoints(points), this); // add a height attribute to the graphic using the attribute list model // the extrusion will be applied to this attribute. See the expression above graphic->attributes()->insertAttribute("height", z); // add the graphic to the graphic overlay graphicsOverlay->graphics()->append(graphic); } m_sceneView->graphicsOverlays()->append(graphicsOverlay); } // helper to create polygon from points Esri::ArcGISRuntime::Polygon Untitled10::createPolygonFromPoints(QList<Point> points) { Esri::ArcGISRuntime::Polygon polygon; if (points.length() == 0) return polygon; // create a polygon builder PolygonBuilder* pb = new PolygonBuilder(m_sceneView->spatialReference(), this); foreach (auto point, points) { // add each point to the builder object pb->addPoint(point); } return polygon = pb->toGeometry(); }
... View more
06-02-2017
07:07 AM
|
0
|
0
|
1077
|
POST
|
Hi Norbert, I think the attribute you use in your extrusion expression needs to be in brackets - e.g. props.setExtrusionExpression(QLatin1String("[height]")); If you haven't already taken a look at our "ExtrudeGraphics" sample that might help give you some ideas as well (arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/Scenes/ExtrudeGraphics at master · Esri/arcgis-runtime-samples-q… ). The sample is written with a QtQuick UI but the C++ business logic should be essentially the same. Please let me know if you are still having issues. Thanks, Luke
... View more
06-02-2017
06:12 AM
|
1
|
9
|
1077
|
POST
|
Hi Mike, You can use the type returned by ellipseGeodesic (in this case a Polygon) as the geometry for a Graphic and then add the graphic to the GraphicsOverlay. To symbolise the graphic in the overlay you can either set a Symbol directly or set a Renderer using a symbol for the entire overlay. If you take a look at these two samples from our github repository you should see some examples of different approaches to displaying graphics: - arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Renderer at v.next · Esri/arcgis-runti… - arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Marker_Symbol at v.next · Esri/arcgis-… this sample shows the use of symbols in a scene: arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/Scenes/Symbols at v.next · Esri/arcgis-runtime-samples-qt · GitH… I hope that helps, Luke
... View more
04-19-2017
06:02 AM
|
0
|
1
|
576
|
POST
|
Hi Norbert, It is probably a good idea to log a bug with support for this issue as well - that way they will be aware of the problem if anyone else reports and so on. Thanks, Luke
... View more
03-29-2017
07:20 AM
|
0
|
0
|
1376
|
POST
|
Hi Norbert - I just finished reproducing the problem using a simpler block of code (based on one of our samples) and with our latest version. I've already logged a bug with this repro case: I will confirm with Lucas whether you should also log a support bug and get back to you. Thanks, Luke
... View more
03-29-2017
04:03 AM
|
0
|
1
|
1376
|
POST
|
Hi Norbert, I have built your code and can reproduce the behaviour you describe: using overload 1 and clicking on all 3 symbols I get the topomost graphic e.g. the advanced symbol: identifyResults.size= 1 [[[ iResult= Esri::ArcGISRuntime::IdentifyGraphicsOverlayResult(0x266776516b0) (#Graphics within result= 1 ) ]]] retrieved AttrVal= "" using overload 2 and clicking on all 3 symbols I get just the simple marker symbols: identifyResults.size= 1 [[[ iResult= Esri::ArcGISRuntime::IdentifyGraphicsOverlayResult(0x266774181f0) (#Graphics within result= 2 ) ]]] SimpleMarkerSymbol retrieved AttrVal= "drawPictureMarker:r=10" SimpleMarkerSymbol retrieved AttrVal= "drawPictureMarker:r=20" I will see if I can come up with a simpler repro using our latest version and log a bug. Thanks for reporting this! Luke
... View more
03-29-2017
02:46 AM
|
2
|
3
|
1376
|
POST
|
Thanks Norbert - that does sound like a possible bug. I'll try and reproduce with your example code and log a bug.
... View more
03-28-2017
08:12 AM
|
0
|
5
|
1376
|
POST
|
Hi Norbert - thanks for posting your question. Do you have any example code you could share? One other thing which might be worth double-checking is that your are connecting to the correct signal for the task you have started. E.g MapQuickView has 2 signals: identifyGraphicsOverlayCompleted
identifyGraphicsOverlaysCompleted corresponding to the 2 tasks: identifyGraphicsOverlay
identifyGraphicsOverlays Note the "s" at the end of "GraphicsOverlay" for the 2nd signal (this has caught me out before). It might also be worth connecting to the errorOccurred signal if you haven't already done so. Thanks, Luke
... View more
03-28-2017
02:50 AM
|
0
|
8
|
1376
|
POST
|
Hi Jonathon, You ought to be able to access the LegendInfoListModel directly without needing to wire it up to a ListView. Then, in javascript, you could iterate over the rows in the model and access the data for the symbolUrl directly. I believe that the first time you access this role for a row in the model, it will trigger an operation to retrieve the image so you will need to check for the url to be updated once this has been completed.
... View more
03-17-2017
11:11 AM
|
0
|
0
|
520
|
POST
|
Hi Pim, You are correct that the `Settings` type cannot be created in the declarative way you show in your code. It also does not support declaring your own properties by name (e.g. 'userName' or 'loggeduser'). Instead, you can access the System objects settings and then call `setValue` or `getValue` as shown in my example code below: Button {
text: "set"
onClicked : {
System.settings.setValue("test_settings", "hello")
}
} Button {
text: "set"
onClicked : {
console.log(System.settings.value("test_settings"))
}
} I am not familiar with the Settings type in AppStudio - but if the above code is working, it is possible this is using a different type? For example the Settings type provided by qt-labs has a more declarative interface like the one you show: Settings QML Type | Qt Quick 5.8 I hope that helps, Luke
... View more
03-15-2017
04:35 AM
|
0
|
0
|
603
|
POST
|
Hi Torben, I am able to reproduce the behaviour you are describing - I will investigate this a bit further to see what we would expect to happen in this situation. In the meantime, you can try this workaround: essentially, you need to load the 2 ArcGISTiledLayers before using them for the basemap/map. You also need to ensure that your tpks are in the same Spatial Reference. Here is some example code that fixes the problem for me - basically, we call load on the 2 layers and when both are loaded we call the setMap function. I've added a GraphicsOverlay to the map so you can see where the 2 tpks are located. TileCache * tileCache2 = new TileCache( "<path>//tpk1.tpk", this); m_lyr2 = new ArcGISTiledLayer( tileCache2, this ); m_lyr2->load(); TileCache * tileCache = new TileCache( "<path>//tpk2.tpk", this); m_lyr1 = new ArcGISTiledLayer( tileCache, this ); m_lyr1->load(); connect(m_lyr1, &ArcGISTiledLayer::doneLoading, this, [this](Error error) { if (m_lyr1->loadStatus() != LoadStatus::Loaded) return; qDebug() << "m_lyr1 loaded"; qDebug() << m_lyr1->spatialReference().wkid(); if (m_lyr2->loadStatus() == LoadStatus::Loaded) setMap();
}); connect(m_lyr2, &ArcGISTiledLayer::doneLoading, this, [this](Error error)
{ if (m_lyr2->loadStatus() != LoadStatus::Loaded)
return; qDebug() << "m_lyr2 loaded"; qDebug() << m_lyr2->spatialReference().wkid(); if (m_lyr1->loadStatus() == LoadStatus::Loaded) setMap(); }); ... void ExampleCode::setMap() { if (m_map) return; Basemap* bm = new Esri::ArcGISRuntime::Basemap( this ); bm->baseLayers()->append(m_lyr2); bm->baseLayers()->append(m_lyr1); m_map = new Map(m_lyr1->spatialReference(), this); m_map->setBasemap(bm); m_mapView->setMap(m_map); GraphicsOverlay* gO = new GraphicsOverlay(this); SimpleMarkerSymbol* sym = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, Qt::red, 5, this); Graphic* g1 = new Graphic(m_lyr1->fullExtent().center(), sym, this); Graphic* g2 = new Graphic(m_lyr2->fullExtent().center(), sym, this); gO->graphics()->append(g1); gO->graphics()->append(g2); m_mapView->graphicsOverlays()->append(gO); } I hoe that's helpful, Luke
... View more
03-13-2017
06:23 AM
|
3
|
1
|
490
|
POST
|
Hi Mauricio, I tested your code on my windows machine with Qt 5.6.2 and 5.8 and the map displayed in each case. Sometimes when the map is not displaying this indicates an issue with OpenSSL - see Install and set up on Windows—ArcGIS Runtime SDK for Qt | ArcGIS for Developers Do you have already have this set up? Thanks, Luke
... View more
03-10-2017
08:11 AM
|
0
|
1
|
1160
|
POST
|
Hi Michael, This line looks wrong to me: // add the overlay to the mapview m_sceneView->graphicsOverlays()->append(LOS);
In your code I think that LOS is your UniqueValueRenderer* rather than a graphics overlay.
... View more
03-10-2017
07:57 AM
|
1
|
2
|
1030
|
POST
|
Hi Torben - thank you for sending me through the data. I think that the problem is that your data does not include information on the coordinate system: when you load it in a Map with no reference it ends up being displayed in Spatial Reference "0" (which as you say is not valid). In the Runtime SDK we do not support on-the-fly projection of raster data so when you try and load it into a map with a defined system (e.g. WGS84) it cannot be displayed. For tiff files such as this one, there are a number of ways in which coordinate and projection information can be supplied. The .tfw file provides the coordinates you use in your envelope - for the coordinate system information I believe this is usually either encoded into the header of the .tif file itself or provided in a separate .aux file. Unfortunately I do not know of a straight-forward way to apply either of these approaches. If you have access to ArcMap you can use a tool such as "Define Projection" to specify the system for your file - I tried that and was able to successfully load your raster draped over another basemap in the correct location. I hope that is helpful - I will do a little bit more research into the problem and let you know if I find a work-around. Thanks, Luke
... View more
03-09-2017
07:59 AM
|
0
|
1
|
935
|
Title | Kudos | Posted |
---|---|---|
1 | 05-04-2018 04:22 AM | |
1 | 11-02-2022 06:25 AM | |
1 | 07-12-2022 05:35 AM | |
4 | 10-21-2021 01:58 AM | |
1 | 07-12-2021 01:09 AM |
Online Status |
Offline
|
Date Last Visited |
03-25-2024
03:44 PM
|