Skip to content

Commit

Permalink
Catch null layer in focus map
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Aug 2, 2013
1 parent 22a0cae commit ae31ccd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ fillTools.select('.swatch').trigger('click');
var updates = d3.dispatch('update_map', 'update_editor', 'update_refresh', 'focus_layer');

updates.on('focus_layer', function(layer) {
if (!layer) return;
if ('getBounds' in layer && layer.getBounds().isValid()) {
layer.openPopup();
map.fitBounds(layer.getBounds());
Expand Down

0 comments on commit ae31ccd

Please sign in to comment.