I have a data source that I am loading:
dataSource.load(parser.parseFromString(kml, "text.xml"), name).then(function(dataSource){
var enitites = dataSource.entities.values;
for(var i = 0; i < entities.length; i++) {
var entity = entities[i];
console.log(entity.position); // this returns an object that has Cartesian3 info, see below
}
}
The object written to the console is lengthy:
ScaledPositionProperty {_definitionChanged: Event, _value: ConstantPositionProperty, _removeSubscription: function, getValue: function, setValue: function…}_
_definitionChanged: Event
_removeSubscription: function () {
_value: ConstantPositionProperty
_definitionChanged: Event
_referenceFrame: 0
_value: Cartesian3
x: -214875.50110362846
y: -5608068.214255967
z: 3020355.876481625
There is more here, but I think this is all that's necessary to answer the question.
I need to pass the position information to another function but every combination that I have tried does not allow me to get the Cartesian3 data to pass along. Am I missing something obvious?