Change position to absolute, and round pixel values. This puts markers back in their place.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@196 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-19 21:36:56 +00:00
parent 3470045a93
commit 9685524e26
2 changed files with 3 additions and 2 deletions

View File

@@ -51,8 +51,8 @@ OpenLayers.Layer.Marker.prototype =
var resolution = this.map.getResolution();
var extent = this.map.getExtent();
var pixel = new OpenLayers.Pixel(
1/resolution * (marker.lonlat.lon - extent.left),
1/resolution * (extent.top - marker.lonlat.lat)
Math.round(1/resolution * (marker.lonlat.lon - extent.left)),
Math.round(1/resolution * (extent.top - marker.lonlat.lat))
);
var m = marker.generateMarker(pixel);
this.div.appendChild(m);

View File

@@ -49,6 +49,7 @@ OpenLayers.Marker.prototype = {
// by the icon size.
this.object.style.top = (pixel.y+this.icon.offset.y) + "px"
this.object.style.left = (pixel.x+this.icon.offset.x) + "px";
this.object.style.position = "absolute";
this.object.onclick = this.onclick;
return this.object;
},