[OpenLayers-Users] GeoRSS not Loading

Christopher Schmidt crschmidt at metacarta.com
Thu Feb 26 19:55:29 EST 2009


On Thu, Feb 26, 2009 at 05:57:05PM -0500, sebastian pawlak wrote:
> I'm very new to OL and am having trouble adding a GeoRSS feed, can someone
> help me out with this school assignment?  The google and WMS layers load
> fine, but when I add the GeoRSS feed all I get is a blank page with the
> navigation buttons I pasted the code below:
> 
> <html>
> <head>
>   <title>Google Maps and Borders WMS</title>
>     <script src="http://openlayers.org/api/2.7-rc2/OpenLayers.js"></script>
>     </head>
>     <body>
>     <div style="width:600; height:400" id="map"></div>
>     <script src='
> http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAM6aPkvOw7fbMP3iLehByFRRrBxiCgxM9Ztl3tSy9n7d1g9V0ZhREBamGsf3vofTiExYT-ejShtOpHw
> '></script>
> 
>     <script defer="defer" type="text/javascript">
>        OpenLayers.ProxyHost = "/proxy/?url=";
                                 ^^^ Unlikey.

http://faq.openlayers.org/proxyhost/how-do-i-set-up-a-proxyhost/                                 

-- Chris

>         var map = new OpenLayers.Map('map');
> 
>         //google layers
> 
>         var gphy = new OpenLayers.Layer.Google(
>             "Google Physical",
>             {type: G_PHYSICAL_MAP});
>         var gmap = new OpenLayers.Layer.Google(
>             "Google Streets", // the default
>             {numZoomLevels: 3});
> 
>         //wms layers
> 
>         var twms2 = new OpenLayers.Layer.WMS( "Provinces",
>             "http://cgkn2.cgkn.net/cgi-bin/cgknwms?",
>             {transparent: 'True',
>             layers: 'Borders_Line'},
>             {'reproject': true});
>         var twms3 = new OpenLayers.Layer.WMS( "Fault Lines",
>             "http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?",
>             {transparent: 'True',
>             layers: 'FAULTS_CA:GSC'},
>             {'reproject': true});
> 
>         //georss layer.... debug
> 
>         var url = 'http://api.flickr.com/services/feeds/geo/?';
>         var urlObj = OpenLayers.Util.getElement(url);
>         document.write(url);
>         var value = urlObj.value;
>         var parts = value.split("/");
>         var georsslayer = new OpenLayers.Layer.GeoRSS(parts[parts.length-1],
> value);
>         map.addLayer([georsslayer]);
>         urlObj.value = "";
> 
> 
>         //add layers to map
>         map.addLayers([gphy, gmap, twms2, twms3]);
> 
>         //turn off layers to reduce the load of initial map
>         twms2.setVisibility(false);
>         twms3.setVisibility(false);
> 
>         //add the layer switching widget
>         var ls = new OpenLayers.Control.LayerSwitcher();
>         map.addControl(ls);
>         ls.maximizeControl();
>         //center on Carleton University - far zoom
> 
>         map.setCenter(new OpenLayers.LonLat(-75.6951, 45.387), 3);
>     </script>
> </body>
> </html>

> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list