[OpenLayers-Users] CVS format for OpenLayers.Layer.Text?

Bill Woodall bwoodall at wardrobe.dhs.org
Wed Jan 31 15:57:37 EST 2007


On Wed, 2007-01-31 at 20:06 +0000, Alexandre Leroux wrote:
> Hi list,
> 
> Wow. OpenLayers is so easy to use. I'm enthusiastic :-)
> 
> Using 2.3-rc2, I have some problems with:
> http://openlayers.org/doc/reference.html#OpenLayers.Layer.Text
> 
> It is said the textfile must be in CSV, but when looking at the example 
> textfile.txt, here copied:
> point title description icon
> 10,20 my orange title   my orange description
> 2,4   my aqua title  my aqua description
> 42,-71   my purple title   my purple description<br/>is great. 
> http://www.openlayers.org/api/img/zoom-world-mini.png
> 
> This is obviously not comma separated.
> 
> I failed to generate any text file that would be successfully read by 
> OpenLayers.Layer.Text. Anyone can reduce the confusion?
> 
> Thanks,
> 
> Alex

Hi Alex,

The docs should refer to the textfile as a Delimiter-separated values
(DSV) instead of Comma-separated values (CSV) and in this case the DSV
are tabs.

The required columns for the textfile are;
 point     x,y pair in the appropriate units
   or
 lon       the "x" coordinate 
 lat       the "y" coordinate

optional columns are;
 title        popupContentHTML Title
 image,icon   url to the "stick pin" image/icon
 iconSize     yes, the size you want the image/icon to be
 iconOffset   you guess it, the offset 
	(for a stickpin use something  width/2,-height to position
	the image/icon over the point )
 description  popupContentHTML desc

Hope that helps

.........Bill,
OL/TC user




More information about the Users mailing list