File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,9 @@ var styles = {
106106} ;
107107
108108var styleFunction = function ( feature , resolution ) {
109- return styles [ feature . getGeometry ( ) . getType ( ) ] ;
109+ var geo = feature . getGeometry ( ) ;
110+ // always assign a style to prevent feature skipping
111+ return geo ? styles [ geo . getType ( ) ] : styles [ 'Point' ] ;
110112} ;
111113
112114var vectorSource = new ol . source . GeoJSON (
@@ -120,6 +122,13 @@ var vectorSource = new ol.source.GeoJSON(
120122 }
121123 } ,
122124 'features' : [
125+ {
126+ 'type' : 'Feature' ,
127+ 'geometry' : null ,
128+ 'properties' : {
129+ 'type' : 'without geometry as allowed in spec' ,
130+ }
131+ } ,
123132 {
124133 'type' : 'Feature' ,
125134 'geometry' : {
Original file line number Diff line number Diff line change @@ -1089,6 +1089,11 @@ goog.require('olcs.core.OlLayerPrimitive');
10891089 olcs . core . olFeatureToCesium = function ( feature , style , context , opt_geom ) {
10901090 var geom = opt_geom || feature . getGeometry ( ) ;
10911091 var proj = context . projection ;
1092+ if ( ! geom ) {
1093+ // Ol3 features may not have a geometry
1094+ // See http://geojson.org/geojson-spec.html#feature-objects
1095+ return null ;
1096+ }
10921097
10931098 var id = function ( object ) {
10941099 object . olFeature = feature ;
You can’t perform that action at this time.
0 commit comments