@@ -1704,21 +1704,21 @@ defineSuite([
1704
1704
expect ( label . eyeOffset ) . toBeUndefined ( ) ;
1705
1705
expect ( label . pixelOffsetScaleByDistance ) . toBeUndefined ( ) ;
1706
1706
1707
- expect ( label . text ) . toBeUndefined ( ) ;
1708
- expect ( label . fillColor ) . toBeUndefined ( ) ;
1709
- expect ( label . outlineColor ) . toBeUndefined ( ) ;
1710
- expect ( label . outlineWidth ) . toBeUndefined ( ) ;
1711
- expect ( label . show ) . toBeUndefined ( ) ;
1712
- expect ( label . scale ) . toBeUndefined ( ) ;
1713
- expect ( label . verticalOrigin ) . toBeUndefined ( ) ;
1714
- expect ( label . eyeOffset ) . toBeUndefined ( ) ;
1715
- expect ( label . pixelOffsetScaleByDistance ) . toBeUndefined ( ) ;
1707
+ expect ( label . text ) . toBeUndefined ( ) ;
1708
+ expect ( label . fillColor ) . toBeUndefined ( ) ;
1709
+ expect ( label . outlineColor ) . toBeUndefined ( ) ;
1710
+ expect ( label . outlineWidth ) . toBeUndefined ( ) ;
1711
+ expect ( label . show ) . toBeUndefined ( ) ;
1712
+ expect ( label . scale ) . toBeUndefined ( ) ;
1713
+ expect ( label . verticalOrigin ) . toBeUndefined ( ) ;
1714
+ expect ( label . eyeOffset ) . toBeUndefined ( ) ;
1715
+ expect ( label . pixelOffsetScaleByDistance ) . toBeUndefined ( ) ;
1716
1716
1717
- expect ( label . font . getValue ( ) ) . toEqual ( '16px sans-serif' ) ;
1718
- expect ( label . style . getValue ( ) ) . toEqual ( LabelStyle . FILL_AND_OUTLINE ) ;
1719
- expect ( label . horizontalOrigin . getValue ( ) ) . toEqual ( HorizontalOrigin . LEFT ) ;
1720
- expect ( label . pixelOffset . getValue ( ) ) . toEqual ( new Cartesian2 ( 17 , 0 ) ) ;
1721
- expect ( label . translucencyByDistance . getValue ( ) ) . toEqual ( new NearFarScalar ( 3000000 , 1.0 , 5000000 , 0.0 ) ) ;
1717
+ expect ( label . font . getValue ( ) ) . toEqual ( '16px sans-serif' ) ;
1718
+ expect ( label . style . getValue ( ) ) . toEqual ( LabelStyle . FILL_AND_OUTLINE ) ;
1719
+ expect ( label . horizontalOrigin . getValue ( ) ) . toEqual ( HorizontalOrigin . LEFT ) ;
1720
+ expect ( label . pixelOffset . getValue ( ) ) . toEqual ( new Cartesian2 ( 17 , 0 ) ) ;
1721
+ expect ( label . translucencyByDistance . getValue ( ) ) . toEqual ( new NearFarScalar ( 3000000 , 1.0 , 5000000 , 0.0 ) ) ;
1722
1722
} ) ;
1723
1723
} ) ;
1724
1724
@@ -1961,7 +1961,7 @@ defineSuite([
1961
1961
return KmlDataSource . load ( parser . parseFromString ( kml , "text/xml" ) ) . then ( function ( dataSource ) {
1962
1962
var entities = dataSource . entities . values ;
1963
1963
expect ( entities . length ) . toEqual ( 1 ) ;
1964
- expect ( entities [ 0 ] . position ) . toBeUndefined ( ) ;
1964
+ expect ( entities [ 0 ] . position . getValue ( Iso8601 . MINIMUM_VALUE ) ) . toEqual ( Cartesian3 . fromDegrees ( 0 , 0 , 0 ) ) ;
1965
1965
expect ( entities [ 0 ] . polyline ) . toBeUndefined ( ) ;
1966
1966
} ) ;
1967
1967
} ) ;
@@ -1970,14 +1970,31 @@ defineSuite([
1970
1970
var kml = '<?xml version="1.0" encoding="UTF-8"?>\
1971
1971
<Placemark>\
1972
1972
<Point>\
1973
+ <altitudeMode>absolute</altitudeMode>\
1973
1974
<coordinates>1,2,3,4</coordinates>\
1974
1975
</Point>\
1975
1976
</Placemark>' ;
1976
1977
1977
1978
return KmlDataSource . load ( parser . parseFromString ( kml , "text/xml" ) ) . then ( function ( dataSource ) {
1978
1979
var entities = dataSource . entities . values ;
1979
1980
expect ( entities . length ) . toEqual ( 1 ) ;
1980
- expect ( entities [ 0 ] . position ) . toBeUndefined ( ) ;
1981
+ expect ( entities [ 0 ] . position . getValue ( Iso8601 . MINIMUM_VALUE ) ) . toEqual ( Cartesian3 . fromDegrees ( 1 , 2 , 3 ) ) ;
1982
+ expect ( entities [ 0 ] . polyline ) . toBeUndefined ( ) ;
1983
+ } ) ;
1984
+ } ) ;
1985
+
1986
+ it ( 'Geometry Point: handles empty coordinates' , function ( ) {
1987
+ var kml = '<?xml version="1.0" encoding="UTF-8"?>\
1988
+ <Placemark>\
1989
+ <Point>\
1990
+ <coordinates></coordinates>\
1991
+ </Point>\
1992
+ </Placemark>' ;
1993
+
1994
+ return KmlDataSource . load ( parser . parseFromString ( kml , "text/xml" ) ) . then ( function ( dataSource ) {
1995
+ var entities = dataSource . entities . values ;
1996
+ expect ( entities . length ) . toEqual ( 1 ) ;
1997
+ expect ( entities [ 0 ] . position . getValue ( Iso8601 . MINIMUM_VALUE ) ) . toEqual ( Cartesian3 . fromDegrees ( 0 , 0 , 0 ) ) ;
1981
1998
expect ( entities [ 0 ] . polyline ) . toBeUndefined ( ) ;
1982
1999
} ) ;
1983
2000
} ) ;
@@ -2133,6 +2150,25 @@ defineSuite([
2133
2150
} ) ;
2134
2151
} ) ;
2135
2152
2153
+ it ( 'Geometry Polygon: handles empty coordinates' , function ( ) {
2154
+ var kml = '<?xml version="1.0" encoding="UTF-8"?>\
2155
+ <Placemark>\
2156
+ <Polygon>\
2157
+ <outerBoundaryIs>\
2158
+ <LinearRing>\
2159
+ <coordinates>\
2160
+ </coordinates>\
2161
+ </LinearRing>\
2162
+ </outerBoundaryIs>\
2163
+ </Polygon>\
2164
+ </Placemark>' ;
2165
+
2166
+ return KmlDataSource . load ( parser . parseFromString ( kml , "text/xml" ) ) . then ( function ( dataSource ) {
2167
+ var entity = dataSource . entities . values [ 0 ] ;
2168
+ expect ( entity . polygon . hierarchy ) . toBeUndefined ( ) ;
2169
+ } ) ;
2170
+ } ) ;
2171
+
2136
2172
it ( 'Geometry Polygon: without holes' , function ( ) {
2137
2173
var kml = '<?xml version="1.0" encoding="UTF-8"?>\
2138
2174
<Placemark>\
@@ -2851,4 +2887,4 @@ defineSuite([
2851
2887
expect ( entity . label . text . getValue ( ) ) . toBe ( 'bob' ) ;
2852
2888
} ) ;
2853
2889
} ) ;
2854
- } ) ;
2890
+ } ) ;
0 commit comments