Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 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
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 Expand Up @@ -586,7 +594,7 @@
bbox = elem.mapElem.getBBox();

if (elemOptions.size || (elemOptions.width && elemOptions.height)) {
if (elemOptions.type == "image" || elemOptions.type == "svg") {
if (elemOptions.type == "image" || elemOptions.type == "svg") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for this. I don't really understand what happened...

plotOffsetX = (elemOptions.width - bbox.width) / 2;
plotOffsetY = (elemOptions.height - bbox.height) / 2;
} else {
Expand Down Expand Up @@ -941,7 +949,7 @@
if (title) {
current_yCenter += title.getBBox().height;
}
if(legendType == "plot" && (typeof legendOptions.slices[i].type == "undefined" || legendOptions.slices[i].type == "circle")) {
if(legendType == "plot" && (typeof legendOptions.slices[i].type == "undefined" || legendOptions.slices[i].type == "circle")) {
current_yCenter += scale * sliceAttrs[i].r;
} else {
current_yCenter += scale * sliceAttrs[i].height/2;
Expand Down