|
POST
|
Andy, This looks like a bug. The statusChanged signal does exist, but for some reason it isn't in the doc and it is firing only when initializing, not once it is initialized. I'm also seeing that it works on ArcGISDynamicMapServiceLayer but not ArcGISTiledLayer, so I'm not sure if it is a bug with the layer base class or just with the tiled layer. I have filed a bug to get both the API and doc fixed up. This is pretty hard to workaround as it is not notifying us when its status changed. The only thing I can think of is to write a short loop to check the status (the status property does work, it is the signal that is not notifying us). The below code seems to work, however, it is definitely not ideal, as you ideally wouldn't have to write a loop like this whenever you want to switch out a basemap. See line 110 below. You can tweak the number of attempts and wait time to your liking. Again, this isn't an ideal workaround, but you can use it as a base so you aren't completely stuck for the logic you are using.
// Copyright 2015 ESRI
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
//
// See the Sample code usage restrictions document for further information.
//
import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
import ArcGIS.Extras 1.0
ApplicationWindow {
id: appWindow
width: 800
height: 600
title: "Test"
property ArcGISTiledMapServiceLayer baseLayerToInsert
Map {
id: appMap
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
}
Button {
anchors {
top: parent.top
right: parent.right
margins: 10
}
text: "Layer 1"
onClicked: addLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer")
}
Button {
anchors {
top: parent.top
left: parent.left
margins: 10
}
text: "Layer 2"
onClicked: addLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer")
}
Button {
anchors {
bottom: parent.bottom
right: parent.right
margins: 10
}
text: "Layer 3"
onClicked: addLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer")
}
Button {
anchors {
bottom: parent.bottom
left: parent.left
margins: 10
}
text: "Layer 4"
onClicked: addLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer")
}
function addLayer(url) {
baseLayerToInsert = ArcGISRuntime.createObject("ArcGISTiledMapServiceLayer");
baseLayerToInsert.url = url;
appMap.insertLayer(baseLayerToInsert, 0);
appMap.removeLayerByIndex(1);
console.log(baseLayerToInsert.status)
var attempts = 0;
while (baseLayerToInsert.status !== Enums.LayerStatusInitialized && attempts < 10) {
System.wait(500);
++attempts;
}
console.log(baseLayerToInsert.status, " === ", Enums.LayerStatusInitialized);
}
}
... View more
08-24-2015
10:10 AM
|
1
|
2
|
1239
|
|
POST
|
Here is probably the best way to do it. Basically place the mouse area over top of the map, but don't accept any of the mouse events so that they actually get propagated to the map. What happens right now is the mouse area intercepts all of the mouse signals, and accepts them, which results in them not going through to the map. It's a few lines of code, but if you actually just create signal handlers for each mouse signal on the MouseArea, then don't accept the mouse, it looks like it will actually get sent down to the map. If this works for you, please mark this as the correct answer as it is more straight forward than the previous suggestion. Thanks! import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
property bool mouseAreaEnabled: true
Map {
id: map
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
MouseArea {
id: ma
anchors.fill: parent
hoverEnabled: true
onClicked: {
mouse.accepted = false;
}
onDoubleClicked: {
mouse.accepted = false;
}
onPositionChanged: {
console.log("mouse position changed", mouse.x)
mouse.accepted = false;
}
onPressAndHold: {
mouse.accepted = false;
}
onPressed: {
mouse.accepted = false;
}
onReleased: {
mouse.accepted = false;
}
}
}
}
... View more
08-17-2015
02:01 PM
|
1
|
1
|
5761
|
|
POST
|
You cannot do this currently with our 10.2.6 release. At our Quartz release, we are aiming to have support for editing and viewing shapefiles. I don't believe we will have the ability to actually create the shapefile in our API, but you will be able to consume and edit an existing one. Thanks, Luke
... View more
08-17-2015
12:09 PM
|
1
|
0
|
1131
|
|
POST
|
Ok. If detecting mouse position without hovering, then you should be fine to just use mousePositionChanged. Take the following example and touch the screen and move around the map. It should pan and display screen coordinates. import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
property bool mouseAreaEnabled: true
Map {
id: map
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
onMousePositionChanged: {
console.log("changed (from map signal)", mouse.x, mouse.y)
}
}
}
If you need to have hovering built in, then the MouseArea limitation is a known limit at this time. You could probably hack something together like the below example that will basically change the anchors of the mouse area so that some of the time you use the mouse area to get screen coordinates, but other times you remove the mouse area and use the map signals. import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
property bool mouseAreaEnabled: true
Map {
id: map
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
onMousePositionChanged: {
console.log("changed (from map signal)")
}
}
Rectangle {
id: myRect
color: "transparent"
states: [
State {
name: "Map"
AnchorChanges {
target: myRect
anchors.top: top
anchors.left: undefined
anchors.right: undefined
anchors.bottom: undefined
}
PropertyChanges {
target: myRect
height: .1
}
},
State {
name: "MouseArea"
AnchorChanges {
target: myRect
anchors.top: map.top
anchors.left: map.left
anchors.right: map.right
anchors.bottom: map.bottom
}
}
]
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onMouseXChanged: {
console.log("changed (from mouse area)");
}
}
}
Button {
property bool mouseAreaEnabled: true
anchors {
left: parent.left
top: parent.top
margins: 15
}
text: "toggle"
onClicked: {
if (!mouseAreaEnabled) {
myRect.state = "Map";
mouseAreaEnabled = true;
} else if (mouseAreaEnabled) {
myRect.state = "MouseArea";
mouseAreaEnabled = false;
}
}
}
}
... View more
08-17-2015
11:01 AM
|
0
|
3
|
5761
|
|
POST
|
Hi Anjolette, Can you provide a few more details? Are you making an app that will run on desktops, mobile devices, or both? Also, are you looking to display the screen coordinates of the mouse with just hovering and not clicking? We have several MouseEvent signals on the map that will let you know when the mouse is clicked, released, etc ArcGIS Runtime SDK for Qt QML API: Map Class Reference . We also have a mousePositionChanged signal that will let you know the screen coordinates of the mouse. The only caveat is that if you are using a desktop that has a mouse (as opposed to a touch mobile device), you need to actually press and hold the mouse to get the coordinates. On a touch screen, there isn't really a concept of hovering, so this isn't an issue here. As far as using the MouseArea over top of a Map, this is currently a known issue. Putting a mouse area over the map stops all mouse events from propagating to the map. Please see this in the release notes: Release notes for ArcGIS Runtime SDK 10.2.6 for Qt—ArcGIS Runtime SDK for Qt | ArcGIS for Developers Thanks, Luke
... View more
08-17-2015
09:43 AM
|
0
|
5
|
5761
|
|
POST
|
If you can find a way to create a GPK that takes in a point, and from that point, you extract the elevation from a raster, then this is the route you should take. Otherwise, the best thing will be to use the native line of sight analysis tool, which will be coming in an upcoming release. Thanks, Luke
... View more
08-17-2015
09:03 AM
|
0
|
0
|
2004
|
|
POST
|
KK- Please see the PositionDisplay API Reference- ArcGIS Runtime SDK for Qt QML API: PositionDisplay Class Reference It has a property on it called mapPoint, and that returns a Point object of your current location. For example: import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
import QtPositioning 5.3
ApplicationWindow {
id: appWindow
width: 800
height: 600
title: "d"
Map {
id: map
anchors.fill: parent
focus: true
positionDisplay {
positionSource: PositionSource {
id: ps
}
}
onStatusChanged: {
if (status === Enums.MapStatusReady) {
ps.active = true;
}
}
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
}
Button {
anchors {
left: parent.left
top: parent.top
margins: 10
}
text: "get point"
onClicked: {
var point = map.positionDisplay.mapPoint;
console.log("x", point.x, "y", point.y, "wkid", point.spatialReference.wkid)
}
}
}
... View more
08-14-2015
08:39 AM
|
1
|
0
|
2801
|
|
POST
|
Image Services require ArcGIS Server, so that won't be an option for you. Once you convert to TPK, it will just be tiles that don't necessarily remember specific information or values in your original raster data, so you won't be running analysis against this. If any of the Spatial Analyst tools in ArcMap suit your need, you can create your own GPK and use local server to execute the GPK in your Runtime App. Here is a list of supported GP tools in Runtime Local Server geoprocessing tools support—ArcGIS Runtime SDK for Qt | ArcGIS for Developers Like I said, our Quartz release will have native capabilities to read raster files, which will not require local server. Quartz release will also have some new spatial analysis tools built directly into the API, and line of sight is one of them. This will also not require local server and will run completely client side. This will ideally be the workflow you use once it is released, but for now, you can consider displaying rasters through local server and running your analysis with a GPK through local server. Thanks, Luke
... View more
08-14-2015
08:31 AM
|
0
|
2
|
2004
|
|
POST
|
We found one issue that I would like to add here. It is with the 5.5 kit for the iOS Simulator only, and devices themselves are not affected. During the build, the linker will fail with errors similar to the following Undefined symbols for architecture i386: "QProcess::waitForFinished(int)", referenced from: EsriRuntimeQt::Local_server_impl::on_shutdown_server() in libEsriRuntimeQt_iphonesimulator.a(libArcGISQTRT-sim-release.o) This is due to some removal of QProcess at 5.5 on iOS. Workarounds include: 1) Use the 5.4 kit that we provide if you want to use the simulator 2) Create a dummy QProcess class to satisfy the linker. Please note that this is safe to do, however, it is not something that can be supported by Esri tech support or anything like that. Here is one example of how to do this. Add QProcess_ios.h to the project: #ifndef QProcess_ios_H
#define QProcess_ios_H
#include <QObject>
#include <QIODevice>
typedef struct _PROCESS_INFORMATION *Q_PID;
class QProcess {
enum ProcessChannelMode {};
enum ProcessState {};
QProcess(QObject*);
~QProcess();
bool waitForStarted(int);
bool waitForReadyRead(int);
bool waitForFinished(int);
void setWorkingDirectory(const QString&);
void setProcessChannelMode(ProcessChannelMode);
void close();
void start(const QString&, const QStringList&, QIODevice::OpenMode);
bool canReadLine() const;
Q_PID pid() const;
QProcess::ProcessState state() const;
int exitCode() const;
};
#endif // QProcess_ios_H
Along with QProcess_ios.cpp: #include "QProcess_ios.h"
QProcess::QProcess(QObject*) { }
QProcess::~QProcess() { }
bool QProcess::waitForStarted(int) { return false; }
bool QProcess::waitForReadyRead(int) { return false; }
bool QProcess::waitForFinished(int) { return false; }
void QProcess::setWorkingDirectory(const QString&) { }
void QProcess::setProcessChannelMode(ProcessChannelMode) { }
void QProcess::close() { }
void QProcess::start(const QString&, const QStringList&, QIODevice::OpenMode) { }
bool QProcess::canReadLine() const { return false; }
Q_PID QProcess::pid() const { return Q_PID(); }
QProcess::ProcessState QProcess::state() const { return (QProcess::ProcessState)0; }
int QProcess::exitCode() const { return 0; }
And in the .pro file, add this: iphonesimulator: {
HEADERS += QProcess_ios.h
SOURCES += QProcess_ios.cpp
} Hope this helps. Thanks, Luke
... View more
08-13-2015
06:00 PM
|
0
|
0
|
2163
|
|
POST
|
Hey Andy, You are right. This isn't supported in the runtime geodatabase, and isn't planned for the upcoming Quartz release. You would need to use Local Server with a GPK to do this. Java has an example of how this would be done Geometric network trace | ArcGIS for Developers If this is something you would like to see, I suggest submitting an enhancement on the ideas page (http://ideas.arcgis.com). This will allow others to vote on the idea so we can gauge the interest in the idea. Thanks, Luke
... View more
08-13-2015
11:22 AM
|
0
|
1
|
1520
|
|
POST
|
You have a few options at this point. 1) Use Local Server and C++. There is a Raster local server sample in the C++ Sample Viewer that shows how to do this. It looks like dted is a supported raster format for local server - Local Server raster support—ArcGIS Runtime SDK for Java | ArcGIS for Developers 2) Publish your raster data as image services and consume with the image service layer. 3) Convert your raster to TPK in ArcMap. Then consume the tile package in either your QML or C++ app. Note - With the release of the next generation of Runtime SDKs, we will be getting support for native reading of raster files, which will not require local server. This will be your eventual solution that you should use for reading local raster files. This will first come in Beta 2 of the Quartz Release, which for Qt, will be around Q1 of 2016. Thanks, Luke
... View more
08-13-2015
09:14 AM
|
0
|
4
|
2004
|
|
POST
|
Kishore- The current plan is to have beta 1 out in December. Please note that this will not yet have shapefile support. Beta 2 will follow a few months later in 2016. Beta 2 will have support for shapefiles. Final release should be a few months after that. Thanks, Luke
... View more
08-12-2015
08:51 AM
|
1
|
0
|
1611
|
|
POST
|
Hi Bhargav, We will be adding native support for shapefiles in an upcoming release, so that you can natively read them without using local server. I believe this will give you the granularity you are looking for. Check out the Android API Ref for a sneak peak & more details, as we should eventually have similar support in Qt ShapefileFeatureTable | ArcGIS Android 10.2.6 API ShapefileFeature | ArcGIS Android 10.2.6 API Thanks, Luke
... View more
08-11-2015
11:41 AM
|
1
|
2
|
1611
|
|
POST
|
Paul- Did you ever get a bug logged for this with support? If so, please include the bug info so anyone else hitting the issue can track it. Thanks! Luke
... View more
08-11-2015
11:32 AM
|
0
|
1
|
1314
|
|
POST
|
Nikita- My apologies for missing this question. My guess is that you were running this over remote desktop on Windows, which isn't support at 10.2.5. If you install 10.2.6, we support remote desktop on Windows, as we have moved from OpenGL to ANGLE. Please try installing 10.2.6 and see if you are successful. Thanks, Luke
... View more
08-11-2015
11:25 AM
|
0
|
0
|
828
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 05-27-2026 09:52 AM | |
| 1 | 11-24-2025 10:45 AM | |
| 1 | 07-30-2025 08:26 AM | |
| 1 | 05-15-2025 07:35 AM | |
| 2 | 11-26-2024 01:27 PM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|