Skip to content

Commit d2d264c

Browse files
committed
Use camelCase notation for variable
1 parent 4dc923e commit d2d264c

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

js/jquery.mapael.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@
471471
* Init zoom and panning for the map
472472
* @param mapWidth
473473
* @param mapHeight
474-
* @param zoom_options
474+
* @param zoomOptions
475475
*/
476476
initZoom: function(mapWidth, mapHeight, zoomOptions) {
477477
var self = this;
@@ -1214,7 +1214,7 @@
12141214
drawLegend: function (legendOptions, legendType, elems, scale, legendIndex) {
12151215
var self = this;
12161216
var $legend = {}
1217-
, legend_paper = {}
1217+
, legendPaper = {}
12181218
, width = 0
12191219
, height = 0
12201220
, title = null
@@ -1229,12 +1229,12 @@
12291229
, length = 0;
12301230

12311231
$legend = $("." + legendOptions.cssClass, self.$container).empty();
1232-
legend_paper = new Raphael($legend.get(0));
1232+
legendPaper = new Raphael($legend.get(0));
12331233
height = width = 0;
12341234

12351235
// Set the title of the legend
12361236
if(legendOptions.title && legendOptions.title !== "") {
1237-
title = legend_paper.text(legendOptions.marginLeftTitle, 0, legendOptions.title).attr(legendOptions.titleAttrs);
1237+
title = legendPaper.text(legendOptions.marginLeftTitle, 0, legendOptions.title).attr(legendOptions.titleAttrs);
12381238
title.attr({y : 0.5 * title.getBBox().height});
12391239

12401240
width = legendOptions.marginLeftTitle + title.getBBox().width;
@@ -1243,7 +1243,7 @@
12431243

12441244
// Calculate attrs (and width, height and r (radius)) for legend elements, and yCenter for horizontal legends
12451245
for(i = 0, length = legendOptions.slices.length; i < length; ++i) {
1246-
var current_yCenter = 0;
1246+
var yCenterCurrent = 0;
12471247

12481248
// Check if size is defined. If not, take defaultPlot size
12491249
if (legendOptions.slices[i].size === undefined)
@@ -1280,18 +1280,18 @@
12801280
}
12811281

12821282
// Compute yCenter for this legend slice
1283-
current_yCenter = legendOptions.marginBottomTitle;
1283+
yCenterCurrent = legendOptions.marginBottomTitle;
12841284
// Add title height if it exists
12851285
if (title) {
1286-
current_yCenter += title.getBBox().height;
1286+
yCenterCurrent += title.getBBox().height;
12871287
}
12881288
if(legendType == "plot" && (legendOptions.slices[i].type === undefined || legendOptions.slices[i].type == "circle")) {
1289-
current_yCenter += scale * sliceAttrs[i].r;
1289+
yCenterCurrent += scale * sliceAttrs[i].r;
12901290
} else {
1291-
current_yCenter += scale * sliceAttrs[i].height/2;
1291+
yCenterCurrent += scale * sliceAttrs[i].height/2;
12921292
}
12931293
// Update yCenter if current larger
1294-
yCenter = Math.max(yCenter, current_yCenter);
1294+
yCenter = Math.max(yCenter, yCenterCurrent);
12951295
}
12961296

12971297
if (legendOptions.mode == "horizontal") {
@@ -1310,7 +1310,7 @@
13101310
y = height;
13111311
}
13121312

1313-
elem = legend_paper.rect(x, y, scale * (sliceAttrs[i].width), scale * (sliceAttrs[i].height));
1313+
elem = legendPaper.rect(x, y, scale * (sliceAttrs[i].width), scale * (sliceAttrs[i].height));
13141314
} else if(legendOptions.slices[i].type == "square") {
13151315
if (legendOptions.mode == "horizontal") {
13161316
x = width + legendOptions.marginLeft;
@@ -1320,7 +1320,7 @@
13201320
y = height;
13211321
}
13221322

1323-
elem = legend_paper.rect(x, y, scale * (sliceAttrs[i].width), scale * (sliceAttrs[i].height));
1323+
elem = legendPaper.rect(x, y, scale * (sliceAttrs[i].width), scale * (sliceAttrs[i].height));
13241324

13251325
} else if(legendOptions.slices[i].type == "image" || legendOptions.slices[i].type == "svg") {
13261326
if (legendOptions.mode == "horizontal") {
@@ -1332,10 +1332,10 @@
13321332
}
13331333

13341334
if (legendOptions.slices[i].type == "image") {
1335-
elem = legend_paper.image(
1335+
elem = legendPaper.image(
13361336
legendOptions.slices[i].url, x, y, scale * sliceAttrs[i].width, scale * sliceAttrs[i].height);
13371337
} else {
1338-
elem = legend_paper.path(legendOptions.slices[i].path);
1338+
elem = legendPaper.path(legendOptions.slices[i].path);
13391339
elem.transform("m"+((scale*legendOptions.slices[i].width) / elem.getBBox().width)+",0,0,"+((scale*legendOptions.slices[i].height) / elem.getBBox().height)+","+x+","+y);
13401340
}
13411341
} else {
@@ -1346,7 +1346,7 @@
13461346
x = legendOptions.marginLeft + scale * (sliceAttrs[i].r);
13471347
y = height + scale * (sliceAttrs[i].r);
13481348
}
1349-
elem = legend_paper.circle(x, y, scale * (sliceAttrs[i].r));
1349+
elem = legendPaper.circle(x, y, scale * (sliceAttrs[i].r));
13501350
}
13511351

13521352
// Set attrs to the element drawn above
@@ -1365,20 +1365,20 @@
13651365
y = height + (elemBBox.height / 2);
13661366
}
13671367

1368-
label = legend_paper.text(x, y, legendOptions.slices[i].label).attr(legendOptions.labelAttrs);
1368+
label = legendPaper.text(x, y, legendOptions.slices[i].label).attr(legendOptions.labelAttrs);
13691369

13701370
// Update the width and height for the paper
13711371
if (legendOptions.mode == "horizontal") {
1372-
var current_height = legendOptions.marginBottom + elemBBox.height;
1372+
var currentHeight = legendOptions.marginBottom + elemBBox.height;
13731373
width += legendOptions.marginLeft + elemBBox.width + legendOptions.marginLeftLabel + label.getBBox().width;
13741374
if(legendOptions.slices[i].type != "image" && legendType != "area") {
1375-
current_height += legendOptions.marginBottomTitle;
1375+
currentHeight += legendOptions.marginBottomTitle;
13761376
}
13771377
// Add title height if it exists
13781378
if (title) {
1379-
current_height += title.getBBox().height;
1379+
currentHeight += title.getBBox().height;
13801380
}
1381-
height = Math.max(height, current_height);
1381+
height = Math.max(height, currentHeight);
13821382
} else {
13831383
width = Math.max(width, legendOptions.marginLeft + elemBBox.width + legendOptions.marginLeftLabel + label.getBBox().width);
13841384
height += legendOptions.marginBottom + elemBBox.height;
@@ -1406,8 +1406,8 @@
14061406
if (Raphael.type != "SVG" && legendOptions.VMLWidth)
14071407
width = legendOptions.VMLWidth;
14081408

1409-
legend_paper.setSize(width, height);
1410-
return legend_paper;
1409+
legendPaper.setSize(width, height);
1410+
return legendPaper;
14111411
},
14121412

14131413
/*
@@ -1724,7 +1724,7 @@
17241724
* @param w map defined width
17251725
* @param h map defined height
17261726
* @param duration defined length of time for animation
1727-
* @param easying_function defined Raphael supported easing_formula to use
1727+
* @param easingFunction defined Raphael supported easing_formula to use
17281728
* @param callback method when animated action is complete
17291729
*/
17301730
animateViewBox: function (x, y, w, h, duration, easingFunction ) {
@@ -1739,7 +1739,7 @@
17391739
, dh = h - ch
17401740
, interval = 25
17411741
, steps = duration / interval
1742-
, current_step = 0
1742+
, currentStep = 0
17431743
, easingFormula;
17441744

17451745
easingFunction = easingFunction || "linear";
@@ -1748,12 +1748,12 @@
17481748
clearInterval(self.animationIntervalID);
17491749

17501750
self.animationIntervalID = setInterval(function() {
1751-
var ratio = current_step / steps;
1751+
var ratio = currentStep / steps;
17521752
self.paper.setViewBox(cx + dx * easingFormula(ratio),
17531753
cy + dy * easingFormula(ratio),
17541754
cw + dw * easingFormula(ratio),
17551755
ch + dh * easingFormula(ratio), false);
1756-
if (current_step++ >= steps) {
1756+
if (currentStep++ >= steps) {
17571757
clearInterval(self.animationIntervalID);
17581758
clearTimeout(self.zoomTO);
17591759
self.zoomTO = setTimeout(function(){self.$map.trigger("afterZoom", {x1 : x, y1 : y, x2 : (x+w), y2 : (y+h)});}, 150);

0 commit comments

Comments
 (0)