[Mapbender-commits] r5829 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Mar 24 09:43:42 EDT 2010
Author: christoph
Date: 2010-03-24 09:43:40 -0400 (Wed, 24 Mar 2010)
New Revision: 5829
Modified:
trunk/mapbender/http/javascripts/map_obj.js
Log:
map position revisited...
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2010-03-23 13:01:05 UTC (rev 5828)
+++ trunk/mapbender/http/javascripts/map_obj.js 2010-03-24 13:43:40 UTC (rev 5829)
@@ -172,6 +172,15 @@
});
};
+ // using the normalized jQuery event
+ this.getPos = function (e) {
+ var dom = this.getDomElement();
+ return new Mapbender.Point(
+ e.pageX - parseInt(dom.style.left, 10),
+ e.pageY - parseInt(dom.style.top, 10)
+ );
+ };
+
this.getMousePosition = function (event) {
var pageX, pageY, offsetX, offsetY;
var e = event || window.event;
@@ -214,6 +223,7 @@
document.getElementById(e) :
(document.all ? document.all[e] : null)
) : target;
+ t = this.getDomElement();
while (t) {
if ($(t).eq(0).attr("id") === this.getDomElement().id && typeof t.offsetLeft !== "undefined") {
x += t.offsetLeft;
@@ -229,6 +239,7 @@
document.getElementById(e) :
(document.all ? document.all[e] : null)
) : target;
+ t = this.getDomElement();
while (t) {
if ($(t).eq(0).attr("id") === this.getDomElement().id && typeof t.offsetTop !== "undefined") {
y += t.offsetTop;
@@ -723,6 +734,10 @@
return this.epsg;
};
+ this.getSrs = function(){
+ return this.epsg;
+ };
+
/**
* Return the map URL of the WMS at index i
* @param {Object} currentWmsIndex
More information about the Mapbender_commits
mailing list