PDA

View Full Version : Load time for the maps



Mathan
15th August 2016, 16:17
Dear All,

I am developing an app in Qt 5.7/ESRi ARC GIs Runtime 100.0.0. I want to check the load time of the .tpk/.mmpk files.
I want to apply simple strategy, placed 3 labels obtained the milliseconds when the map start loading, map end loaded and difference between the time.

Since I am not aware about control flow in the qml, the value is wrong.
Code snippets:



import QtQuick 2.3
import QtQuick.Controls 1.2
import Esri.ArcGISRuntime 100.0
import Esri.ArcGISExtras 1.1

ApplicationWindow {
id: appWindow
width: 800
height: 500
title: "LoadTPKV1"

property int intHours
property int intMinutes
property int intSeconds
property int intMilliseconds
property bool internationalTime: true





Text {
id: idtxtPath
x: 14
y: 15
width: 73
height: 29
styleColor: "#b30707"
//text: qsTr(System.userHomePath + "/CarTPKLevel1.tpk")
//text: qsTr(Qt.formatDateTime(new Date().getSeconds()))
//text: appWindow.timeChanged()
// text: Qt.formatDateTime(new Date())
//text: appWindow.timeChanged()

}




MapView {

//anchors.fill: parent

height: 400
width: 800
anchors.bottom:parent


// add a map to the mapview
Map {

Basemap{

ArcGISTiledLayer{

TileCache{

path: System.userHomePath + "/CarTPKLevel1.tpk"

}
/*
onComponentCompleted: {
idtxtPath.text = appWindow.timeChanged()
}
*/


onLoadStatusChanged: {
//End Event

if(loadStatus === Enums.LoadStatusLoaded)
{

idtxtPath.text = appWindow.timeChanged()

}


}

}


}

onComponentCompleted: {
idtxtPath.text = appWindow.timeChanged()


}
}


}




Text {
id: idEndTxt
x: 128
y: 15
width: 93
height: 29
text: ""
styleColor: "#bb0808"

}







function timeChanged() {
var date = new Date;

//intHours = date.getUTCHours()
intMinutes = date.getMinutes();
intSeconds = date.getUTCSeconds();
intMilliseconds = date.getUTCMilliseconds();
return intMilliseconds
}
}//ApplicationWindow

anda_skoa
15th August 2016, 18:42
Hard to tell wihout knowing the API contracts of the component.

If it does not indicate start of loading then it will be difficult to save the time when loading starts.

Since you have obviously tried Component.onCompleted, is it called after the loading is done?

Cheers,
_

Mathan
16th August 2016, 17:30
Thanks for the reply.