Skip to content

Commit 1a17b4f

Browse files
committed
feat: handle maxscale default in scaleExtent
1 parent c66f7cc commit 1a17b4f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/components/modebar/buttons.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ function handleGeo(gd, ev) {
551551
var minscale = geoLayout.projection.minscale;
552552
var maxscale = geoLayout.projection.maxscale;
553553

554-
if(maxscale < 0) maxscale = Infinity;
554+
if(maxscale === -1) maxscale = Infinity;
555555
var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;
556556

557557
// make sure the scale is within the min/max bounds

src/plots/geo/geo.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,10 @@ function getProjection(geoLayout) {
749749

750750
// https://github.com/d3/d3-zoom/blob/master/README.md#zoom_scaleExtent
751751
projection.scaleExtent = function () {
752-
var minscale = projLayout.minscale * 100;
753-
var maxscale = projLayout.maxscale * 100;
754-
return [minscale, maxscale];
752+
var minscale = projLayout.minscale;
753+
var maxscale = projLayout.maxscale;
754+
if (maxscale === -1) maxscale = Infinity;
755+
return [100 * minscale, 100 * maxscale];
755756
};
756757

757758
if (geoLayout._isSatellite) {

0 commit comments

Comments
 (0)