[OpenLayers-Users] read Format.GeoRSS from http request

Fabio D'Ovidio fabiodovidio at gmail.com
Fri Jul 11 10:37:40 EDT 2008


Christopher Schmidt ha scritto:
> On Fri, Jul 11, 2008 at 03:24:37PM +0200, Fabio D'Ovidio wrote:
>> Hi and Thanks for the replay.
>> I tryed but it didn't work.....
>> the code is:
>> var urlObj = "myurl"
>>                  var features = new OpenLayers.Layer.GML("GeoRSS", 
>> urlObj, {format: OpenLayers.Format.GeoRSS});
> This is not what I said. 
> What is your goal? I thought that you were trying to add a layer. Adding
> a layer is done exactly as I said: var l = new OL.Layer.GML();
> map.addLayer(l); 

I have a vector Layer on the map. I fill it with a feature read using 
Format.GeoRSS parser
If I read GeoRSS from a txt file, all is ok. The problem is when i try 
to read invoking http request...

> What you're doing here appears to be unrelated to that, with some other
> goal that I don't understand.
> The layer is 'l', the features are l.features, the parser can write out
> the features via var p = new OpenLayers.Format.GeoRSS();
> p.write(l.features)... but why would you want to? You don't need to
> write out the GeoRSS file...
I want to to write out GeoRSS only for test if it is right. That's all.
I am trying as following:

function test2 () {
                 var parser = new OpenLayers.Format.GeoRSS({'xy': true});
                 var urlObj = "myurl"
                 var parts = urlObj.split("/");
                  var features = 
                  var str = parser.write(features);
                  str = str.replace(/,/g, ', ');
                  document.getElementById('output').value = str;

The problem now is that I am using OpenLyares from Jboss 
( and "myurl" is on
The error is that openLayers try to GET "myurl" on 8085 port...

More information about the Users mailing list