[OpenLayers-Users] iconOffset in Text Layer

Stuart Eve stuarteve at lparchaeology.com
Fri Mar 9 12:55:51 EST 2007


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?

Thanks

Stuart

var markers = new OpenLayers.Layer.Text( "text", {location: "http://my.web.server/markers.txt"});
map.addLayers([markers,wms]); 


CSV File:

point    title    description    icon    iconSize    iconOffset
1802503.12384,4917414.67151    AIAC_686    <p class="search_chat"><span 
class="search_nm">Site Name:</span> Gradiste<br/><span 
class="search_nm">Site Name:</span> Gradiste<br/></p>    
http://my.web.server/images/marker2.png    20,36    -10,-36
1800718.35122,4937764.64047    AIAC_700    <p class="search_chat"><span 
class="search_nm">Site Name:</span> Gradiste<br/><span 
class="search_nm">Site Name:</span> Gradiste<br/></p>    
http://my.web.server/images/marker2.png    20,36    -10,-36







More information about the Users mailing list