[OpenLayers-Users] Syntax for the GeoRSS call?

Robert Buzink post at robertbuzink.nl
Tue Feb 6 15:05:33 EST 2007


hi Alex,

You can find an example of a directly displayed GeoRSS layer at
http://www.ekoplan.org/wikimap/demo20. As you can see, I used a php-proxy to
get the georss-xml. Most likely that is your problem (the proxy). You can
find info on setting up a cgi-proxy at openlayers.org, or you can use the
php-proxy I use for wikimap for testing. You can find the sourcecode of
wikimap through http://wikimap.sf.net.

Robert.

On 2/6/07, Alexandre Leroux <alexandre.leroux at ec.gc.ca> wrote:
>
>
> Hi list,
>
> OpenLayers's GeoRSS example ask you to feed the url through a textbox. I
> have failed to find the right syntax to send it directly.
>
> My last attempt was:
> OpenLayers.Layer.GeoRSS("Slashgeo", "http://slashgeo.org/index.rss");
> map.addLayer([georss_layer]);
> but it doesn't work. What's wrong? (I have tried multiple permutations,
> including removing the [] on georss_layer)
>
> I tried with the live example on
> http://openlayers.org/dev/examples/georss.html and of course it works.
> However, for some reason, the georss feed doesn't show up when testing
> the example locally using the georss.html example bundled with the files.
>
> I copied my full code below just in case. Thanks!
>
> Alex
> --
> Alexandre Leroux, M.Sc., Ing.
> Environnement Canada / Environment Canada
> Centre météorologique canadien / Canadian Meteorological Centre
> Division de la réponse aux urgences environnementales /
> Environmental Emergency Response Division
> alexandre.leroux at ec.gc.ca
>
>
>
>
> <html xmlns="http://www.w3.org/1999/xhtml">
>    <head>
>      <style type="text/css">
>          #map {
>              width: 1000px;
>              height: 700px;
>              border: 1px solid black;
>          }
>      </style>
>      <script
> src='
> http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'
> ></script>
>      <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
>      <script type="text/javascript">
>          <!--
>          var map, layer, georss_layer;
>
>       //   OpenLayers.ProxyHost = "/proxy/?url=";
>          function init(){
>              map = new OpenLayers.Map('map', {maxResolution:'auto'});
>              layer = new OpenLayers.Layer.Google( "Google Satellite" ,
> {type: G_NORMAL_MAP, 'maxZoomLevel':18} );
>              map.addLayers([layer]);
> //            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
> //               "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'}
> );
> //            map.addLayer(layer);
>              map.setCenter(new OpenLayers.LonLat(0, 0), 2);
>              georss_layer = new OpenLayers.Layer.GeoRSS("Slashgeo",
> "http://slashgeo.org/index.rss");
>              map.addLayer([georss_layer]);
>              map.addControl(new OpenLayers.Control.LayerSwitcher());
>          }
>          function addUrl() {
>              var value = $('url').value;
>              var parts = value.split("/");
>                  var newl = new OpenLayers.Layer.GeoRSS(
> parts[parts.length-1], value);
>                  map.addLayer(newl);
>              $("url").value = "";
>          }
>          // -->
>      </script>
>    </head>
>    <body onload="init()">
>      <h1>GeoRSS in OpenLayers</h1>
>      <p style="font-size:.9em;">This demo uses the OpenLayers GeoRSS
> parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are
> currently supported. <a
> href="http://trac.openlayers.org/wiki/HowToDownload">Get the code!</a></p>
>      <form onsubmit="return false;">
>     GeoRSS URL: <input type="text" id="url" size="50" /><input
> type="submit" onclick="addUrl(); return false;" value="Load Feed"
> onsubmit="addUrl(); return false;" />
>      </form>
>      <div id="map"></div>
>      http://slashgeo.org/index.rss
>    </body>
> </html>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Robert Buzink, website ontwerp en ontwikkeling
Sint-Pietersaalststraat 123
9000 Gent
+32 (0)9 33 00 267
+32 (0)487 548 414
post at robertbuzink.nl
robertbuzink.nl/webdesign
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070206/857d8569/attachment.html


More information about the Users mailing list