[OpenLayers-Users] Any idea of using setUrl on GeoRSS layer?

Deli Soetiawan crushfire2004 at gmail.com
Wed Oct 8 02:41:52 EDT 2008


Hi there,

i tried to create a georss layer that can do auto-refresh after specified
time, here the code for layer:

var iconMarker = new OpenLayers.Icon("images/markerblue.png", new
OpenLayers.Size(16,16));
var rssLayer = new
OpenLayers.Layer.GeoRSS('GeoRSS','georss.php',{icon:iconMarker});
map.addLayer(rssLayer);

here the code for refreshing georss layer:

setInterval(reloadRSS,60000); //reload every 60 seconds
function reloadRSS() {
	rssLayer.setUrl('georss.php');
}

the georss.php generate dynamic georss from database (not really important
what the content is)
according to: 
http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer/Image.js

setUrl function was defined, the parameter for this function is url of the
georss, so it can be use to reload the xml (formerly in Kamap application
i've made i use this kind of function) but it can't work?

when i debug using JS debugger (in Opera 9.6 Final):
Timeout thread: delay 60000 ms
Error:
name: TypeError
message: Statement on line 41: Type mismatch (usually non-object value
supplied where object required)

the line 41 is referencing to "rssLayer.setUrl('georss.php');" code, so why
type mismatch? do i set invalid type for parameter? is it correct to use
string ("georss.php") as parameter?

or any other way to refresh this layer type? (if you can please share some
working example :D)

Thanks,
Deli Soetiawan
-- 
View this message in context: http://www.nabble.com/Any-idea-of-using-setUrl-on-GeoRSS-layer--tp19873179p19873179.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list