Skip to content

Commit 854cb8c

Browse files
committed
collect LineStrings for un dataset
1 parent 8b5de73 commit 854cb8c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/lib/geo_location_utils.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ function locationToFeature(locationmode, location, features) {
6363
for(i = 0; i < filteredFeatures.length; i++) {
6464
f = filteredFeatures[i];
6565
if(f.id === locationId) return f;
66+
if(
67+
f.properties &&
68+
f.properties.iso3cd === locationId
69+
) {
70+
// TODO: we may need to collect all the polygons instead?
71+
return f;
72+
}
6673
}
6774

6875
loggers.log([
@@ -77,7 +84,7 @@ function locationToFeature(locationmode, location, features) {
7784
function feature2polygons(feature) {
7885
var geometry = feature.geometry;
7986
var coords = geometry.coordinates;
80-
var loc = feature.id;
87+
var loc = feature.properties.iso3cd || feature.id;
8188

8289
var polygons = [];
8390
var appendPolygon, j, k, m;
@@ -173,6 +180,9 @@ function feature2polygons(feature) {
173180
appendPolygon(coords[j]);
174181
}
175182
break;
183+
case 'LineString':
184+
appendPolygon(coords);
185+
break;
176186
}
177187

178188
return polygons;

src/plots/geo/layout_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {
3333
// no other scopes are allowed for 'albers usa' projection
3434
if(isAlbersUsa) scope = geoLayoutOut.scope = 'usa';
3535

36-
var isScoped = geoLayoutOut._isScoped = (scope !== 'world');
36+
var isScoped = geoLayoutOut._isScoped = (scope !== 'world' && scope !== 'un');
3737
var isSatellite = geoLayoutOut._isSatellite = projType === 'satellite';
3838
var isConic = geoLayoutOut._isConic = projType.indexOf('conic') !== -1 || projType === 'albers';
3939
var isClipped = geoLayoutOut._isClipped = !!constants.lonaxisSpan[projType];

0 commit comments

Comments
 (0)