[OpenLayers-Users] GeoRSS not Loading

sebastian pawlak sdpawlak at gmail.com
Thu Feb 26 17:57:05 EST 2009


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=";
        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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090226/ec6dca59/attachment.html


More information about the Users mailing list