Skip to content

Geo improvements: fitbounds, 'geojson-id' locationmode and 'featureidkey' #4419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 20, 2019
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@plotly/d3-sankey": "0.7.2",
"@plotly/d3-sankey-circular": "0.33.1",
"@turf/area": "^6.0.1",
"@turf/bbox": "^6.0.1",
"@turf/centroid": "^6.0.2",
"alpha-shape": "^1.0.0",
"canvas-fit": "^1.5.0",
Expand Down
10 changes: 6 additions & 4 deletions src/components/modebar/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function handleDrag3d(gd, ev) {
var button = ev.currentTarget;
var attr = button.getAttribute('data-attr');
var val = button.getAttribute('data-val') || true;
var sceneIds = gd._fullLayout._subplots.gl3d;
var sceneIds = gd._fullLayout._subplots.gl3d || [];
var layoutUpdate = {};

var parts = attr.split('.');
Expand Down Expand Up @@ -468,7 +468,7 @@ function handleGeo(gd, ev) {
var attr = button.getAttribute('data-attr');
var val = button.getAttribute('data-val') || true;
var fullLayout = gd._fullLayout;
var geoIds = fullLayout._subplots.geo;
var geoIds = fullLayout._subplots.geo || [];

for(var i = 0; i < geoIds.length; i++) {
var id = geoIds[i];
Expand All @@ -479,10 +479,12 @@ function handleGeo(gd, ev) {
var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;

Registry.call('_guiRelayout', gd, id + '.projection.scale', newScale);
} else if(attr === 'reset') {
resetView(gd, 'geo');
}
}

if(attr === 'reset') {
resetView(gd, 'geo');
}
}

modeBarButtons.hoverClosestGl2d = {
Expand Down
Loading