Browse files

path bringToFront and bringToBack

  • Loading branch information...
1 parent 58ec820 commit ed3176f18f77ac15f9c06f310f43d4d354c1b4ff @mourner mourner committed Jun 26, 2012
Showing with 29 additions and 3 deletions.
  1. +14 −1 dist/leaflet-src.js
  2. +1 −1 dist/leaflet.js
  3. +14 −1 src/layer/vector/Path.SVG.js
View
15 dist/leaflet-src.js
@@ -3114,6 +3114,19 @@ L.Path = L.Path.extend({
SVG: L.Browser.svg
},
+ bringToFront: function () {
+ if (this._container) {
+ this._map._pathRoot.appendChild(this._container);
+ }
+ },
+
+ bringToBack: function () {
+ if (this._container) {
+ var root = this._map._pathRoot;
+ root.insertBefore(this._container, root.firstChild);
+ }
+ },
+
getPathString: function () {
// form path string here
},
@@ -3239,7 +3252,7 @@ L.Map.include({
},
_animatePathZoom: function (opt) {
- // TODO refactor into something more manageble
+ // TODO refactor into something more manageable
var centerOffset = this._getNewTopLeftPoint(opt.center).subtract(this._getTopLeftPoint()),
scale = Math.pow(2, opt.zoom - this._zoom),
offset = centerOffset.divideBy(1 - 1 / scale),
View
2 dist/leaflet.js
1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
15 src/layer/vector/Path.SVG.js
@@ -7,6 +7,19 @@ L.Path = L.Path.extend({
SVG: L.Browser.svg
},
+ bringToFront: function () {
+ if (this._container) {
+ this._map._pathRoot.appendChild(this._container);
+ }
+ },
+
+ bringToBack: function () {
+ if (this._container) {
+ var root = this._map._pathRoot;
+ root.insertBefore(this._container, root.firstChild);
+ }
+ },
+
getPathString: function () {
// form path string here
},
@@ -132,7 +145,7 @@ L.Map.include({
},
_animatePathZoom: function (opt) {
- // TODO refactor into something more manageble
+ // TODO refactor into something more manageable
var centerOffset = this._getNewTopLeftPoint(opt.center).subtract(this._getTopLeftPoint()),
scale = Math.pow(2, opt.zoom - this._zoom),
offset = centerOffset.divideBy(1 - 1 / scale),

0 comments on commit ed3176f

Please sign in to comment.