Skip to content

Commit 03a6b84

Browse files
committed
fix empty
1 parent 1a60af5 commit 03a6b84

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/traces/scattergeo/plot.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ function plot(gd, geo, calcData) {
1818
var gTraces = Lib.makeTraceGroups(scatterLayer, calcData, 'trace scattergeo');
1919

2020
function removeBADNUM(d, node) {
21-
if(d.lonlat[0] === BADNUM) {
21+
if(
22+
d.lonlat &&
23+
d.lonlat[0] === BADNUM
24+
) {
2225
d3.select(node).remove();
2326
}
2427
}
@@ -98,12 +101,13 @@ function calcGeoJSON(calcTrace, fullLayout) {
98101
lonArray = [bboxGeojson[0], bboxGeojson[2]];
99102
latArray = [bboxGeojson[1], bboxGeojson[3]];
100103
} else {
101-
lonArray = new Array(len);
102-
latArray = new Array(len);
104+
lonArray = [];
105+
latArray = [];
103106
for(i = 0; i < len; i++) {
104107
calcPt = calcTrace[i];
105-
lonArray[i] = calcPt.lonlat[0];
106-
latArray[i] = calcPt.lonlat[1];
108+
if(!calcPt.lonlat) continue;
109+
lonArray.push(calcPt.lonlat[0]);
110+
latArray.push(calcPt.lonlat[1]);
107111
}
108112

109113
opts.ppad = calcMarkerSize(trace, len);

0 commit comments

Comments
 (0)