[OpenLayers-Users] can't view text layer

Alok Jadhav alok at cse.iitb.ac.in
Sun May 13 01:16:44 EDT 2007



Hello,
  I want to display some markers from a file using OpenLayers.Layer.Text()

my textfile is like this:

point   title   description     icon
72.82488,18.90948       COLABA1 COLABA1
72.79488,18.9594        COLABA2 COLABA2
72.89488,19.10948       COLABA3 COLABA3
72.92488,19.159 COLABA4 COLABA4 
http://www.openlayers.org/api/img/zoom-world-mini.png

(The values are tab seperated!)


and part of code to use this file is :

<snippet>
textLayer = new OpenLayers.Layer.Text( "text", {location: 
"./textfile2.txt"} );

 	markers = new OpenLayers.Layer.Markers( "Markers" );   // Markers 
for selected stop!
 	var size = new OpenLayers.Size(22,32);B
         var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
 	tile = new OpenLayers.Layer.KaMap( "Mumbai Navigator 
KaMap","http://10.129.112.144:8080/mumbai/tile.php", {'layers': 'mumbai', 
map: 'mumbai', i: 'JPEG'} );
 	busStops = new OpenLayers.Layer.KaMap("Bus stops", 
"http://10.129.112.144:8080/mumbai/tile.php", {'g': 'grp', map: 'mumbai'}, 
{'isBaseLayer': false});
 	map.addLayers([tile, busStops, vectorLayer, markers, textLayer]); 
</snippet>


I cannot see any of the markers from the textfile on the map. If I add the 
markers manually using OpenLayers.Layer.Markers, they are visible but 
nothing from the text layer.

I am just not able to solve this problem. I can't seem to know what is 
the problem.  Please some1 tell me where I am going wrong.

thanks in advance.

-Alok



More information about the Users mailing list