POST
|
Hey @TasawarAhmad , There are a couple problems I am seeing. Starting with MainMenu.qml: QML Button has no buttonText or imagePath properties that I am aware of, Qt Qml Button doc . Also you have defined the function fun() in button which I assume you want to be executed when the button is pressed but given how it's currently written it does nothing. You would need to either move that logic into the :onClicked signal handler or just move that function call there(e.g. onClicked: fun() ). The last problem being the qml file your are trying to add needs to have the `M` on .../qml/map.qml capitalized to .../qml/Map.qml. This is based on your post indicating the name of that file is Map.qml right below the MainMenu.qml code block above. The primary problem with your Map.qml is that there will be naming conflicts between your QML object name Map and import Esri.ArcGISRuntime which contains a Map type. My suggestion would be just to rename your QML file something else in this case. With those changes I was able to make your code work locally. Let me know if you have any other questions. Happy coding! Jared
... View more
05-17-2023
11:30 AM
|
0
|
2
|
800
|
POST
|
Hello @NothernCoder , I am not exactly sure if this is what you are looking for but we have the GeometryEngine class which performs lots of geometric operations. The two I think might suit your use case are the following: GeometryEngine::convexHull A convex hull is a geometry whose vertices are the smallest set of vertices needed to surround the input geometry. One way to visualize this is as a rubber band stretched around a polygon that has some concave sides. documentation: convexHull doc link GeometryEngine::unionOf Which will return the union of two geometries. Both input geometries must be of the same geometry type and share the same spatial reference. documentation: unionOf doc link Both of these function are overloaded as well to take a list of geometries as the input if you want more than 2. The only obvious exclusion from these suggestions that I can immediately recognize is in a situation of combining two geometries that would be disjoint. I am not sure of a viable use case for such a situation though. In any case I will ask internally just to be sure. Also you can search ArcGIS Maps SDK for Qt Sample Viewer at www.arcgis.com and download our sample app. It contains examples for bothGeometryEngine::unionOf and GeometryEngine::convexHull for a better visual examples of each.
... View more
02-06-2023
03:43 PM
|
1
|
1
|
489
|
POST
|
@KanjaSousuke Thank you for the additional information! I just want to double check that you intended to put Qt: 5.15.2 not Qt: 1.15.2. Also could you provide a screenshot of what you are experiencing? "But, It's hard to get a clear view of the map." isn't quite descriptive enough without a visual representation as it could be a lot of different things. - Jared
... View more
07-19-2021
12:11 PM
|
0
|
1
|
952
|
POST
|
Hello @KanjaSousuke , Is this in relation to ArcGIS Runtime SDK for Qt? If so which version are you using? Also could you possibly provide a screenshot of what you are seeing? Does an empty template with changing the Basemap to BasemapTopographic sufficiently reproduce what you are seeing? Also have you tried using Enums.BasemapStyleArcGISTopographic(BasemapStyle::ArcGISTopographic)? Regards, Jared
... View more
07-15-2021
09:23 AM
|
0
|
3
|
974
|
POST
|
@JayantaPoddar Where did you locate this information? A link to official Esri documentation would be appreciated. Kind Regards, Jared
... View more
07-06-2021
03:34 PM
|
0
|
1
|
944
|
POST
|
@johnmarker Just for reference, the minimum required Qt framework for 100.7 is 5.12.6 which can be found here.
... View more
07-06-2021
03:20 PM
|
0
|
0
|
1436
|
POST
|
Hello @johnmarker , The primary problem is that your polyline_builder only ever contains one point when added as a graphic since it is destructed once Display_a_map::createPolyline goes out of scope. If you make a it a member variable of your class Display_a_map, then you would be able to add subsequent clicks to the builder and then the polyline should show as it has more than one point. Also might I suggest to pass the clickPoint as a parameter to createPoint and createPolyline rather then creating the point, breaking into parts(x and y), then creating the point again. E.g.: void createPolyline(GraphicsOverlay* overlay, const Point& clickedPoint) {...} Sincerely, Jared
... View more
06-11-2021
12:41 PM
|
0
|
1
|
1263
|
POST
|
@johnmarker That is a great question. I don't have a specific answer as to why that decision was made but it does demonstrate that the geometry is reprojected on the fly. The problem in your case is that Point returned from: m_mapView->screenToLocation(event.x(), event.y()); is in the spatial reference of your map which is web mercator and not wgs84. I can definitely see how this might be misleading though. I am currently fielding some input from other members of the runtime team to see if there is anything else I can add to this. Sincerely, Jared
... View more
06-10-2021
02:29 PM
|
0
|
3
|
1293
|
POST
|
Hello @johnmarker , No notifier is necessary in this situation as your m_mapView is bound to your MapQuickView in QML which will automatically update once a graphic is added to your overlay which you already appended to your m_mapView (this assumes you are using the tutorial code/default template for Qt Quick C++ provided by the sdk install). ArcGIS basemaps are mostly Web Mercator and not WGS84 so I am guessing this is an unintended projection issue. You could specify the spatial reference of the Point "dume_beach" e.g. const Point dume_beach(pointX, pointY, SpatialReference::webMercator()); but this is not needed because the point will honor the spatial reference from your basemap once added to the overlay. So the following would work just as well in your case: const Point dume_beach(pointX, pointY); Sincerely, Jared
... View more
06-10-2021
12:30 PM
|
1
|
5
|
1302
|
POST
|
Hello again @FatmaAkdemir , In that case you can use "mousePressed" with "RightButton" to catch the mouse events and "QMenu::exec" to open a context menu. Or if you don't want to use a menu, you could use "QPushButton" instead. Documentation for C++: https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html https://doc.qt.io/qt-5/qmenu.html#exec-1 https://doc.qt.io/qt-5/qpushbutton.html Sincerely, Jared
... View more
06-02-2021
08:51 AM
|
0
|
0
|
927
|
POST
|
@FatmaAkdemir I forgot to mention we have a sample that demonstrates all the different SurfacePlacement modes and is interactive to help show how they are different, Surface placement sample.
... View more
06-02-2021
08:41 AM
|
1
|
0
|
885
|
POST
|
@FatmaAkdemir Ah I can see how this could cause some confusion in your situation. SurfacePlacement::Drapped does as you might think and drapes the symbol/graphic onto the surface itself. SurfacePlacement::Absolute is placed at the elevation specified in meters above sea level. It is also possible for that to go below the surface which if not anticipated could lead to unexpected behavior as well. Happy to hear you solved the issue!
... View more
06-02-2021
08:39 AM
|
0
|
0
|
887
|
POST
|
Hello @FatmaAkdemir, Yes using a combination of the MapView and QtQuick.Controls you definitely could. You would need to listen for the MapView.onMouseClicked signal and then use mouse.x and mouse.y then use those to update the x and y of the QtQuick.Controls ComboBox(drop down menu) which can take a ListModel(list of items in that menu) then you can listen for the ComboBox.onActivated(int index) signal for the selection from that list and use the index to know which model from that list was selected and do whatever following action you would like. Here is an example: import QtQuick 2.6
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2
import Esri.ArcGISRuntime 100.11
ApplicationWindow {
id: appWindow
width: 800
height: 600
title: "Example"
property var myExModel : ["apple", "pie", "cherry", "pie"]
// add a mapView component
MapView {
anchors.fill: parent
// set focus to enable keyboard navigation
focus: true
// add a map to the mapview
Map {
// add the ArcGISStreets basemap to the map
initBasemapStyle: Enums.BasemapStyleArcGISStreets
}
onMouseClicked: {
myComboBox.x = mouse.x;
myComboBox.y = mouse.y;
myComboBox.visible = true;
}
}
ComboBox {
id: myComboBox
model: myExModel
visible: false
onActivated: {
myDialog.text = myExModel[index];
visible = false;
myDialog.open();
}
}
MessageDialog {
id: myDialog
}
} Hope you find this helpful! Sincerely, Jared
... View more
05-28-2021
11:47 AM
|
1
|
2
|
959
|
POST
|
Hello @FatmaAkdemir , It seems like you are running into the max scale on the layer and once that is exceeded the layer no longer displays . For service layers, this is defined by the service, Layer::maxScale. Here is a related sample as well, min-max scale sample. Let me know if I am on the right track. Sincerely, Jared
... View more
05-28-2021
09:36 AM
|
0
|
2
|
917
|
POST
|
Hello @KanjaSousuke , When I click near a point that I have already placed, can I read the information about that point? Yes. GeoView.identifyGraphicsOverlay will identify the topmost graphic which you can then use to obtain the graphic identified which has attributes, geometry, symbol, and a few other properties which you can see here, https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-graphic.html. Below I wrote a quick little example to show the functionality you seek to implement. It looks for two clicks on the map. For the first two it creates two points from those clicks. Then on all subsequent clicks it does an identifyGraphicsOverlay operation to locate the graphic you clicked near. It creates a new point using the Long and Lat from the identified graphic and add 100000 to it just to show you can update it's location. You could also take another mouse click and update it's location that way. We have many samples that illustrate similar behavior but the one that comes to mind right now is "Edit features with feature-linked annotation", https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/EditData/EditFeaturesWithFeatureLinkedAnnotation/README.md. import QtQuick 2.6
import QtQuick.Controls 2.2
import Esri.ArcGISRuntime 100.11
ApplicationWindow {
id: appWindow
width: 800
height: 600
title: "RelocateGraphic"
// add a mapView component
MapView {
id: mapView
anchors.fill: parent
// set focus to enable keyboard navigation
focus: true
// add a map to the mapview
Map {
// add the ArcGISStreets basemap to the map
initBasemapStyle: Enums.BasemapStyleArcGISStreets
}
onMouseClicked: {
let clickPoint = screenToLocation(mouse.x, mouse.y);
if (pointA.geometry == null) {
pointA.geometry = clickPoint;
} else if (pointB.geometry == null) {
pointB.geometry = clickPoint;
setViewpointGeometryAndPadding(overlay.extent, 100 /*padding in device independent pixels (DIPS)*/);
} else {
identifyGraphicsOverlay(overlay, mouse.x, mouse.y, 5 /*tolerance*/, false /*returnPopupsOnly*/);
}
}
onIdentifyGraphicsOverlayStatusChanged: {
if (identifyGraphicsOverlayStatus != Enums.TaskStatusCompleted)
return;
const result = identifyGraphicsOverlayResult;
print("longitude: " + result.graphics[0].geometry.x);
print("latitude: " + result.graphics[0].geometry.y);
print("Add 100000 to long and lat respectively and update");
let geom = result.graphics[0].geometry;
// Point is immutable which requires us to create a new one
// then assign it to the graphic we want to update.
let newPoint = ArcGISRuntimeEnvironment.createObject("Point", {
x: geom.x + 100000,
y: geom.y + 100000,
spatialReference: geom.spatialReference
});
result.graphics[0].geometry = newPoint;
print("new longitude: " + result.graphics[0].geometry.x);
print("new latitude: " + result.graphics[0].geometry.y);
}
GraphicsOverlay {
id: overlay
Graphic {
id: pointA
SimpleMarkerSymbol {
color: "red"
size: 15
style: Enums.SimpleMarkerSymbolStyleCircle
}
}
Graphic {
id: pointB
SimpleMarkerSymbol {
color: "blue"
size: 15
style: Enums.SimpleMarkerSymbolStyleCross
}
}
}
}
} I hope you find this helpful. Let me know if you have any other questions. Sincerely, Jared
... View more
05-17-2021
12:58 PM
|
0
|
1
|
874
|
Title | Kudos | Posted |
---|---|---|
1 | 02-06-2023 03:43 PM | |
1 | 06-10-2021 12:30 PM | |
1 | 06-02-2021 08:41 AM | |
1 | 05-28-2021 11:47 AM | |
1 | 03-01-2021 09:01 AM |
Online Status |
Offline
|
Date Last Visited |
06-09-2023
09:34 PM
|