OpenLayers OpenLayers

Ticket #60 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

Bug in map.getPixelFromLonLat()

Reported by: euzuro Assigned to: euzuro
Priority: major Milestone: 2.0 Release
Component: Map Version:
Keywords: Cc:
State:

Description

[18:49:32] euzuro: can you check out markerss.html in the examples directory [18:50:12] euzuro: specifically the following function (which is activated on cliking the purple div) [18:50:12] euzuro:

function add() {

var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17)); marker = new OpenLayers.Marker(new OpenLayers.LonLat(180,90), icon); markers.addMarker(marker);

}

[18:50:52] euzuro: basically, it doesnt work correctly if you've moved the map around at all first [18:51:10] euzuro: which boils down to a problem with: map.getPixelFromLonLat() [18:51:39] euzuro: the map.getExtent() function returns the bounds for the screen [18:52:04] euzuro: but if we want to place objects (markers, popups) directly into the map.layersContainerDiv or layer.div [18:52:23] euzuro: then we need to offset them by how much the map has been moved since the last redraw. [18:52:28] euzuro: if that makes any sense.... [18:52:41] cr5chmidt: yeah, that makes sense [18:52:47] cr5chmidt: because the div has moved [18:52:53] cr5chmidt: and we're positioning them relatively to that [18:52:58] euzuro: right. [18:53:10] euzuro: im not quite sure how to approach this. [18:53:23] euzuro: ie im not sure if it's getExtent [18:53:27] euzuro: which needs to be changed [18:53:33] euzuro: or the way we're using it... [18:53:57] cr5chmidt: no, getExtent is right [18:54:03] cr5chmidt: it generates the correct bounds even after dragging [18:54:22] euzuro: right

Change History

05/24/06 13:27:42 changed by euzuro

"bug" is also present in getLonLatFromPixel().

05/24/06 13:28:58 changed by euzuro

actually, these functions are maybe worth preserving... as they *are* accurate for the map or control level. The only reason they are off is because we are sliding the actual layer divs.

05/24/06 14:13:56 changed by euzuro

  • owner changed from crschmidt to euzuro.
  • status changed from new to assigned.

im gonna fix this.

05/24/06 14:47:15 changed by euzuro

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed with r329

08/16/06 01:08:40 changed by euzuro

  • milestone set to 2.0 Release.