fix for #60
conversions to/from lonlat/px need to take into account the offset of the layersContainerDiv. I have introduced the following functions for converting between layer and screen pixel values: getLayerPxFromScreenPx() and getScreenPxFromLayerPx() they are pretty self-explanitory. I then renamed: getPixelFromLonLat() and getLonLatFromPixel() to: getScreenPxFromLonLat() and getLonLatFroScreenmPx() and added: getLayerPxFromLonLat() and getLonLatFromLayerPx() updates were made throughout the code, demos, and tests so everything should still run smoothly. -e- git-svn-id: http://svn.openlayers.org/trunk/openlayers@329 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -58,7 +58,7 @@ OpenLayers.Layer.Markers.prototype =
|
||||
* @param {OpenLayers.Marker} marker
|
||||
*/
|
||||
drawMarker: function(marker) {
|
||||
var px = this.map.getPixelFromLonLat(marker.lonlat);
|
||||
var px = this.map.getLayerPxFromLonLat(marker.lonlat);
|
||||
var markerImg = marker.draw(px);
|
||||
if (!marker.drawn) {
|
||||
this.div.appendChild(markerImg);
|
||||
|
||||
Reference in New Issue
Block a user