[OpenLayers-Users] iconOffset in Text Layer

Christopher Schmidt crschmidt at metacarta.com
Fri Mar 9 22:26:40 EST 2007


On Fri, Mar 09, 2007 at 05:55:51PM +0000, Stuart Eve wrote:
> Hi All
> 
> I have been having some problems getting the iconOffset setting to work 
> with my marker layer. No matter what I do it doesn't seem to take notice 
> of it. It always seems to place the middle of the marker directly on top 
> of the point where it is supposed to be. I have had a look around in the 
> code using FireBug and it almost seems if it is using the default offset 
> of (-w/2,-h/2) instead of the offset set in the csv. I am using the 
> current trunk code, and I have had it working before on previous releases.
> 
> I have provided the text file it is creating the markers from, and the 
> call to the marker layer. Can anyone see what I am doing wrong?

Quick glance: It sems like the Icon() API doesn't account for passing an
offset an no 'calculateOffset' function. The fix is probably to not set
a calculateOffset function in the initializer for Icon() if this.offset
exists. 

In other words:

It's a bug. Patches graciously accepted :)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list