Skip to content

Commit 936454f

Browse files
committed
Merge pull request tombatossals#501 from justinwp/patch-2
Fit bounds if no center attribute.
2 parents 0e9eca7 + 11d5b40 commit 936454f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/directives/maxbounds.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ angular.module("leaflet-directive").directive('maxbounds', function ($log, leafl
2323
];
2424

2525
map.setMaxBounds(bounds);
26-
map.fitBounds(bounds);
26+
if (!attrs.center) {
27+
map.fitBounds(bounds);
28+
}
2729
});
2830
});
2931
}

0 commit comments

Comments
 (0)