|
POST
|
Hi Anat, You should be able to remove the "onLoadStatusChanged" block from your code. As the RasterLayer is the only layer in the basemap/map the app should automatically start at this extent. You may find that the app is starting at a scale beyond the drawing scale of the raster - so try zooming in to see if it appears.
... View more
09-05-2017
03:41 AM
|
1
|
0
|
3940
|
|
POST
|
Hi Marc, could you post an example of the code you are using to edit the features in your geodatabase? You might find this sample (arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/EditData/EditAndSyncFeatures at master · Esri/arcgis-runtime-sam… ) a useful reference for editing data in the local geodatabase (although you could ignore the sync code). This example make a call to updateFeature (FeatureTable Class | ArcGIS for Developers ) in order to change the position of a feature in the geodatabse. The approach should still be the same for your use-case of changing attributes rather than updating positions - but let me know if that is not working for you. Thanks, Luke
... View more
09-04-2017
06:48 AM
|
0
|
1
|
669
|
|
POST
|
Hi George, you can use the CompositeSymbol type (CompositeSymbol Class | ArcGIS for Developers ) to combine together two or more Symbols. The code below shows how you could combine a TextSymbol with your existing crossSymbol and use them as a CompositeSymbol which gets its position (geometry) updated every time the user clicks on the map. TextSymbol* textSymbol = new TextSymbol("hello", Qt::blue, 12, HorizontalAlignment::Left, VerticalAlignment::Bottom, this); textSymbol->setOffsetX(2); textSymbol->setOffsetY(2); SimpleMarkerSymbol* crossSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Cross, QColor("red"), 12, this); CompositeSymbol* compositeSymbol = new CompositeSymbol(QList<Symbol*>{textSymbol, crossSymbol}, this); Point point(-110.828140, 44.460458, SpatialReference::wgs84()); Graphic* graphic = new Graphic(point, compositeSymbol, this); GraphicsOverlay* overlay = new GraphicsOverlay(this); overlay->graphics()->append(graphic); m_mapView->graphicsOverlays()->append(overlay); connect(m_mapView, &MapQuickView::mouseClicked, this, [graphic, this](QMouseEvent& mouseEvent) { Point newPos = m_mapView->screenToLocation(mouseEvent.x(), mouseEvent.y()); graphic->setGeometry(newPos); }); This approach would let you apply a label to the market symbol you are already using. I hope that helps, Luke
... View more
09-04-2017
06:34 AM
|
0
|
0
|
804
|
|
POST
|
Hi Anat, If you want to load your raster data without an online baseman a good option is to use the raster itself as a layer for a local basemap. If you change your code to declare the raster as one of the baseLayers of a new Basemap (Basemap QML Type | ArcGIS for Developers ) it should load the map at the extent of your data. Map { id: map Basemap { RasterLayer { Raster { path: rasterFilePath } } } } Because "baseLayers" is a default property of Basemap, declaring a layer (in this case RasterLayer) as a child item will automatically add it to the list of base layers. When you load a .tif file the .tfw should be automatically read for position information - assuming the names match and they are in the same directory. If your raster in your example code is shown in the correct place then I think the .tfw has been loaded successfully. I hope that helps - any questions, let me know. Luke
... View more
09-04-2017
06:18 AM
|
0
|
0
|
3940
|
|
POST
|
Hi Nicholas, To change the behaviour of double-click you could derive your own view type from MapQuickView (or MapGraphicsView) and override this protected method: virtual void mouseDoubleClickEvent(QMouseEvent *event); This would let you simply ignore double-clicks on the view - if you need double-clicks to do something else you may be able to add that here as well. You should make sure that your implementation still calls through to the event on the base QuickItem like so: QQuickItem::mouseDoubleClickEvent(event);
and then depending on what you want to happen you may want to accept or ignore the event. It is also possible to derive your view type from MapView (rather than MapQuickView) but this would require implementing a lot more of the interface - see MapView Class | ArcGIS for Developers . Hopefully that is helpful. Luke
... View more
09-01-2017
07:11 AM
|
2
|
0
|
642
|
|
POST
|
Hi George, thanks for trying out the API (I'd recommend you check out version 100.1 when you have time as well). From the SimpleRenderer sample the addPoint code looks something like this // create graphic Graphic* graphic = new Graphic(point, this); // add graphic to Graphic Overlay m_graphicsOverlay->graphics()->append(graphic); Here, the Graphic* object is added to a GraphicListModel* by calling the append function. I think you have 2 options to update the positions: 1 - keep track of the Graphics that you added and call setGeometry (Graphic Class | ArcGIS for Developers) with your new Point as the geometry that you pass in. One way of doing this might be to keep a separate structure which maps your points names to the Graphic - e.g. QMap<QString,Graphic*> where the key would be "oldFaithfulPoint" etc. and the value would be the Graphic* object you appended to the model. 2 - remove all of the graphics from the list model and re-add them for your new positions. You can call clear (GraphicListModel Class | ArcGIS for Developers ) on the list model to remove the graphics. Since these Graphic* objects were created with "this" as their parent QObject (presumably your app) you will also need to delete these pointers in some way to free the memory. An alternative is to give them a parent QObject* which you delete and then recreate whenever you clear the model. I hope that helps, Luke
... View more
09-01-2017
03:23 AM
|
0
|
1
|
1581
|
|
POST
|
Hi Norbert, for this you would need to make use of the surfacePlacement methods on LayerSceneProperties. For example, the code below places a picture marker symbol at a height of 1000m above Edinburgh: PictureMarkerSymbol* pms = new PictureMarkerSymbol(myImageUrl, this); Graphic* g = new Graphic(Point(-3.1883, 55.9533, 1000., SpatialReference::wgs84()), pms, this); overlay->graphics()->append(g); LayerSceneProperties sceneProps = overlay->sceneProperties(); sceneProps.setSurfacePlacement(SurfacePlacement::Relative); overlay->setSceneProperties(sceneProps); Note that the sceneProps are returned by value not by reference so you need to set them back onto the overlay. Hope that helps, Luke
... View more
08-31-2017
06:56 AM
|
1
|
1
|
684
|
|
POST
|
Hi Nicholas, thanks for getting in touch. The GeodesicEllipseParameters class is actually defined in the header of GeometryEngine.h (along with a number of other types used by this class). If you are already including GeometryEngine you should be able to remove the line "#include <GeodesicEllipseParameters>" and it ought to work. Please let me know if you have any issues. Thanks, Luke
... View more
08-30-2017
07:22 AM
|
0
|
1
|
592
|
|
POST
|
Hi - you are correct there is no "ID" obtained when adding a Graphic in Qt 100.1. Which version of the API are you using? For C++, I think you could probably store this as a QMap<QString, Graphic*>> where the key is a label/ID that you assign to help keep track of the graphic. You would also need to take care to keep your map in step with the `GraphicListModel` - e.g. remove the graphic from both structures at the same time and so on. Note that the model does not assume ownership of the `Graphic` when it is added. In theory, you could use the index at which you added the `Graphic` into the `GraphicListModel` but this is not guaranteed to be stable since the model also supports inserts and so on. I hope that helps, Luke
... View more
08-25-2017
04:17 AM
|
0
|
1
|
850
|
|
POST
|
Hi Norbert, I've just done a small test using polygons with ExtrusionMode::AbsoluteHeight and the height attribute set to be different by 0.5 metres. It seems to be working ok for me (see screenshot). I'm also printing out the attributes map to check the heights are being set correctly for each polygon qDebug() << graphic->attributes()->attributesMap();
which gives me the output:
QMap(("height", QVariant(double, 10.5)))
QMap(("height", QVariant(double, 11)))
QMap(("height", QVariant(double, 11.5)))
QMap(("height", QVariant(double, 12)))
Would you be able to share a simple example form your code? Thanks, Luke
... View more
08-23-2017
03:39 AM
|
2
|
2
|
1939
|
|
POST
|
Hi Marc, if you know that you want to use the connection just once it would be a good idea to disconnect it afterwards. A simple way to do this is to store the return type of the original connection and then pass this to a call to disconnect (QObject Class | Qt Core 5.9 ) once the work is done. It is still good practice to make sure that you are not creating multiple copies of the same connection so I would recommend moving those calls to a place where they will only be executed once - e.g. where the layers are first set up.
... View more
08-22-2017
02:33 AM
|
1
|
1
|
907
|
|
POST
|
Hi Marc, I think this line is the problem: connect(_mapView, &MapQuickView::identifyLayerCompleted, this, &Myclass::clickedSlot);
It looks like this is being called every time you receive the QMouseEvent form your mouseClickedSlot - that means you will be getting a new connection each time. If possible you should move the connection to the c'tor of the class (or immediately after the MapQuickView is created - possibly in the component completed method?) so that this only happens once. I think you may also want to clear the _identifyTasks container each time you enter the mouseClickedSlot or this will continue to grow? I hope that helps, Luke
... View more
08-22-2017
02:18 AM
|
2
|
3
|
907
|
|
POST
|
Hi Marc, If you are searching for features you may be able to use the queryFeatures method FeatureTable Class | ArcGIS for Developers for each of the layers. This method accepts a QueryParameters Class | ArcGIS for Developers which allows you to set a geometry to query. So, your workflow would be something like: 1 - get the position at which the user clicked 2 - use the buffer method of GeometryEngine Class | ArcGIS for Developers to define your search area 3 - pass the Polygon returned by the buffer operation to a QueryParameters 4 - pass the QueryParameters to start a queryFeatures task for each layer you are interested in One issue with that approach is that the buffer will be constructed using an absolute distance rather than a number of pixels. If that's an issue you would need to find some way of mapping 200 pixels to a distance for the current map scale etc. You could do something like: 1 - take the users point in screen-space 2 - shift it by 200 along the x-axis 3 - get the map location of that point 4 - then use distance method on GeometryEngine Class | ArcGIS for Developers to work out the distance between the 2 points (this is what the buffer radius should be). I hope that helps - please let me know how you get on. Thanks, Luke
... View more
08-17-2017
06:58 AM
|
2
|
1
|
1242
|
|
POST
|
Hi Nicholas - the template currently is not set up to provide you with an Application Window (please let me know if you think that is something important to include). However, you can set your template up to use an ApplicationWindow with just a few changes: in main.cpp you will need to: 1. #include <QQmlApplicationEngine>
2. replace QQuickView view;
with
QQmlApplicationEngine engine;
3. replace any occurrences of
view.engine()->
with
engine.
4. remove any other references to
view
In your main.qml file, wrap the existing root item in an ApplicationWindow:
ApplicationWindow { visible: true Test_application_window { width: 800 height: 600 // Create MapQuickView here, and create its Map etc. in C++ code MapView { anchors.fill: parent objectName: "mapView" // set focus to enable keyboard navigation focus: true } } } Don't forget to set the visible property of the ApplicationWindow to true as this will be false by default. Once you have done that you should be able to use your QQuickItem created by the template as before and add a ToolBar etc. to the parent window. I hope that helps you get going. Luke
... View more
08-17-2017
06:44 AM
|
1
|
1
|
1596
|
| 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 |
10-23-2024
09:16 AM
|