From 1edac972bf06ee79971288b9e242e0eecad54630 Mon Sep 17 00:00:00 2001 From: Jake McGuire Date: Thu, 3 Dec 2015 14:40:29 -0800 Subject: [PATCH] Bugfix: Define optional 'properties' property if not present GeoJSON Point features require and properties, but is optional. The current method assumes that will exist and errors on the assignment if is not present. This fix initializes as an empty object if not present so the assignment on the next line should always work. --- WebGLLayer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/WebGLLayer.js b/WebGLLayer.js index b63e765..5388c7f 100644 --- a/WebGLLayer.js +++ b/WebGLLayer.js @@ -469,6 +469,7 @@ WebGLLayer.prototype.loadPointData = function(feature, geometry){ this.features_.points.floats.push(xy[1]); this.features_.points.floats.push(WebGLLayer.packColor(this.features_.points.defaultColor)); + if (!feature.hasOwnProperty('properties')) feature.properties = {}; feature.properties.index = this.features_.points.count++; this.features_.points.changed = true;