Make it so getMousePosition does not report incorrect position when borders are used in containing elements, by replacing the pagePosition method with a new one and attaching map events to the internal viewport div instead of the user provided map div. r=erilem,tschaub (closes #2247)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-11-05 12:44:38 +00:00
parent e40bb1f10d
commit a59266325b
6 changed files with 261 additions and 38 deletions

View File

@@ -513,7 +513,7 @@ OpenLayers.Map = OpenLayers.Class({
this.viewPortDiv.appendChild(this.layerContainerDiv);
this.events = new OpenLayers.Events(this,
this.div,
this.viewPortDiv,
this.EVENT_TYPES,
this.fallThrough,
{includeXY: true});
@@ -610,7 +610,6 @@ OpenLayers.Map = OpenLayers.Class({
render: function(div) {
this.div = OpenLayers.Util.getElement(div);
OpenLayers.Element.addClass(this.div, 'olMap');
this.events.attachToElement(this.div);
this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
this.div.appendChild(this.viewPortDiv);
this.updateSize();