Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wattnpapa committed Nov 15, 2016
1 parent 6b8e497 commit 232e922
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions dist/leaflet.nauticscale.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ L.Control.ScaleNautic = L.Control.Scale.extend({

_addScales: function(options, className, container) {
L.Control.Scale.prototype._addScales.call(this, options, className, container);

if (options.nautic) {
this._nScale = L.DomUtil.create('div', className + '-line', container);
L.setOptions(options);
if (this.options.nautic) {
this._nScale = L.DomUtil.create('div', className, container);
}
},

_updateScales: function (options, maxMeters) {
L.Control.Scale.prototype._updateScales.call(this, options, maxMeters);

if (options.nautic && maxMeters) {
_updateScales: function (maxMeters) {
L.Control.Scale.prototype._updateScales.call(this, maxMeters);
if (this.options.nautic && maxMeters) {
this._updateNautic(maxMeters);
}
},
Expand All @@ -29,9 +28,9 @@ L.Control.ScaleNautic = L.Control.Scale.extend({
nauticalMiles = maxNauticalMiles > 0.1 ? Math.round(maxNauticalMiles * 10) / 10 : Math.round(maxNauticalMiles * 100) / 100;
}

scale.style.width = this._getScaleWidth(nauticalMiles / maxNauticalMiles) + 'px';
scale.style.width = Math.round(this.options.maxWidth * (nauticalMiles / maxNauticalMiles)) - 10 + 'px';
scale.innerHTML = nauticalMiles + ' nm';
},
}
});

L.control.scalenautic = function (options) {
Expand Down
4 changes: 2 additions & 2 deletions dist/leaflet.nauticscale.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet.nauticscale",
"version": "1.0.0",
"version": "1.1.0",
"description": "Leaflet Nauticscale",
"publishConfig": {
"registry": "http://registry.npmjs.org/"
Expand Down

0 comments on commit 232e922

Please sign in to comment.