Skip to content

Commit

Permalink
Allow to update legend
Browse files Browse the repository at this point in the history
The event `update` is extended to allow the modification of the legend (area or plot).
  • Loading branch information
Indigo744 committed Oct 30, 2015
1 parent f855c21 commit 1911494
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/jquery.mapael.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,14 @@
Mapael.updateElem(elemOptions, links[id], $tooltip, animDuration);
}

// Update legends
$.merge(legends, Mapael.createLegends($self, options, "area", areas, 1));
if (options.map.width) {
$.merge(legends, Mapael.createLegends($self, options, "plot", plots, (options.map.width / mapConf.width)));
} else {
$.merge(legends, Mapael.createLegends($self, options, "plot", plots, ($container.width() / mapConf.width)));
}

if(typeof opt != "undefined")
opt.afterUpdate && opt.afterUpdate($self, paper, areas, plots, options);
});
Expand Down

0 comments on commit 1911494

Please sign in to comment.