propertyValueType query
Posted: March 10th, 2005, 9:44 am
If I do a straight query using propertyValueType on an object's property I get numbers:
1 : 4818
2 : 4819
3 : 4821
4 : 4820
5 : 4822
6 : 4812
7 : 4817
8 : 4823
9 : 4824
10 : 4814
11 : 4813
12 : 4816
13 : 4815
...so unless I explicitly compare ie:
prop.propertyValueType==PropertyValueType.TwoD_SPATIAL
...it's tricky to get the type as something instantly understandable.
I've in the process of writing a little function to return a string, but the numbers are NOT in the same order as the types are listed in the help. I've got 8 out of the 13 pegged, but exact numbers for:
NO_VALUE
TwoD_SPATIAL
CUSTOM_VALUE
MARKER
MASK_INDEX
...are still eluding me. Either I'm not sure of the exact syntax to return the type (mask index, marker) or I don't understand how the property is implimented (custom, no value, 2D spatial).
Any ideas to nail these last few!?
Cheers,
Dave
ps - I'm using this code to test (indented lines have been completed to the best of my knowledge):
1 : 4818
2 : 4819
3 : 4821
4 : 4820
5 : 4822
6 : 4812
7 : 4817
8 : 4823
9 : 4824
10 : 4814
11 : 4813
12 : 4816
13 : 4815
...so unless I explicitly compare ie:
prop.propertyValueType==PropertyValueType.TwoD_SPATIAL
...it's tricky to get the type as something instantly understandable.
I've in the process of writing a little function to return a string, but the numbers are NOT in the same order as the types are listed in the help. I've got 8 out of the 13 pegged, but exact numbers for:
NO_VALUE
TwoD_SPATIAL
CUSTOM_VALUE
MARKER
MASK_INDEX
...are still eluding me. Either I'm not sure of the exact syntax to return the type (mask index, marker) or I don't understand how the property is implimented (custom, no value, 2D spatial).
Any ideas to nail these last few!?
Cheers,
Dave
ps - I'm using this code to test (indented lines have been completed to the best of my knowledge):
Code: Select all
function propertyValueTypeString(prop){
var str="????"
if(prop!=null){
switch(prop.propertyValueType){
case 4812: str="NO_VALUE"; break;
case 4813: str="ThreeD_SPATIAL"; break;
case 4814: str="ThreeD"; break;
case 4820: str="TwoD_SPATIAL"; break;
case 4815: str="TwoD"; break;
case 4817: str="OneD"; break;
case 4818: str="COLOR"; break;
case 4816: str="CUSTOM_VALUE"; break;
case 4822: str="MARKER"; break;
case 4821: str="LAYER_INDEX"; break;
case 4819: str="MASK_INDEX"; break;
case 4823: str="SHAPE"; break;
case 4824: str="TEXT_DOCUMENT"; break;
}
alert([prop.name,String(prop.propertyValueType),str])
//return str
}
else{
alert('Null value...')
//return undefined
}
}