added relative root url for Leaflet

This commit is contained in:
DennisSchiefer
2012-04-26 12:48:01 +01:00
parent 560ce74d06
commit a0ceee732e
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -19,6 +19,12 @@ or see http://www.gnu.org/licenses/agpl.txt.
// [assorted bugfixes to Leaflet functions we use]
// find relative leaflet URL
var i = 0;
while( L.ROOT_URL[i] == document.URL[i] ) { i++; }
L.RELATIVE_ROOT_URL = L.ROOT_URL.slice(i);
// return closest point on segment or distance to that point
L.LineUtil._sqClosestPointOnSegment = function (p, p1, p2, sqDist) {
var x = p1.x,