jerrykur


Can someone provide a link to a sample GeoRSS XML file. I want to see if my code is working

Maybe the VE team should keep a sample file permanently available for developer to test against.

jerry




Re: Found the problem, Firefox

jerrykur


I am using the following routine to try and load my xml file.  It fails on the AddLayer call.  Any thoughts

function TestRss()

{

var veLayerSpec = new VELayerSpecification();

veLayerSpec.Type = VELayerType.GeoRSS;

veLayerSpec.ID = 'layer1';

veLayerSpec.LayerSource = "http://localhost/georss2.xml";

veLayerSpec.Method = 'get';

// veLayerSpec.FnCallback = onFeedLoad;

alert('About to add Layer ');

map.AddLayer(veLayerSpec);

alert('Added Layer ');

map.ShowLayer('layer1');

}

My XML file, georss2.xml,  is :

< xml version="1.0" encoding="utf-8" >

<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">

<channel>

<title>test</title>

<link>http://localhost/default.aspx</link>

<description>My test</description>

<item>

<name>Sample location</name>

<description>Aspen, CO</description>

<geo:lat>39.1930007935</geo:lat>

<geo:lon>-106.820999146</geo:lon>

</item>

</channel>

</rss>






Re: Found the problem, Firefox

jerrykur

I found the problem. Apparently the AddLayer fails in Firefox. Anyone know how to get around this

jerry






Re: Found the problem, Firefox

Derek Chan

Okay I'm assuming you've already implemented the Firefox hack on the wiki.  After trying to duplicate it on my machine, I'm seeing this error off of firebug:

Permission denied to call method XMLHttpRequest.open

Apparently this is caused by an un-signed script in a Mozilla based browser.  Namely when trying to use XMLHttpRequest (from calling the veLayerSpec.LayerSource) off a remote computer.  

I'd recommend looking this up further on google or check out the following links below

http://www.forum4designers.com/message25416.html

and
http://www.mozilla.org/projects/security/components/signed-scripts.html

Note that I set mine up on my local IIS and grabbed it off using http://localhost/georss2.xml.  I don't think this error will occur however if it is referenced locally

Hope that helps start things off,





Re: Found the problem, Firefox

Keith Kinnan

The GeoRSS "permission denied" error is caused when the browser loads the GeoRSS XML file from a different domain than the domain the mashup is loaded from. The security settings of browsers by default do not allow you to make XmlHttpRequest calls across domains. To fix this, you can load the XML file from the same domain as your mashup site, or you can create a proxy which reads the XML file from a different domain and serves it up in the same domain as the mashup.

You can see a sample GeoRSS mashup at:

http://blogs.msdn.com/keithkin/archive/2006/09/19/virtual-earth-api-using-georss-layers.aspx

Here's a sample GeoRSS file:

http://krkinnan.members.winisp.net/georss/2004hurricaneivan.xml

Thanks,

Keith