[OpenLayers-Users] semicolon is GeoRSS url's

Robert Buzink post at robertbuzink.nl
Sun Jan 14 11:43:45 EST 2007


hi Christopher,

The same problem also occurs with the most recent svn. The example page that
you pointed to, uses javascript to get the url in the map dynamically. Could
that be the difference? To prove my point (:-), you can find the code of the
GeoRSS example with the semicolon-url precoded in the map function below and
as an attachment. Note that functionality is broken (and precoded feed
doesn't show). I guess  the semicolon just breaks the add.layer statement in
two?

robert,

<code>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
        #map {
            width: 800px;
            height: 400px;
            border: 1px solid black;
        }
    </style>
    <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
    <script type="text/javascript">
        <!--
        var map, layer;

        OpenLayers.ProxyHost = "/proxy/?url=";
        function init(){
            map = new OpenLayers.Map('map', {maxResolution:'auto'});
            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), 0);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            var geourlgent = new OpenLayers.Layer.GeoRSS("geourl near
gent...", "http://geourl.org/near?p=http://www.robertbuzink.nl;format=rss10
");
            map.addLayers([geourlgent]);
        }
        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>
  </body>
</html>
</code>




On 1/14/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
>
> On Sun, Jan 14, 2007 at 04:53:31PM +0100, Robert Buzink wrote:
> > I have a  little problem that I can't solve. I want to include georss
> layers
> > in a map from a mysql database through php. It works fine except for
> url's
> > that have a semicolon in it. I tried escaping before adding the url to
> the
> > database, escaping with javascript and even came up with the code below
> > (within a php echo statement), but nothing works! What am I missing?
> >
> > <code>
> > var url = "http://geourl.org/near?p=http://www.robertbuzink.nl" +
> > unescape('%3b') + "format=rss10";
> >
> > var geourlgent = new OpenLayers.Layer.GeoRSS("geourl near gent...",
> url);
> >
> > map.addLayers([geourlgent]);';
> > </code>
>
> Pasting:
>
> http://geourl.org/near?p=http://www.robertbuzink.nl;format=rss10
>
> into http://openlayers.org/dev/examples/georss.html
>
> works for me. Perhaps this is fixed in the most recent version of SVN:
> can you check?
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> 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://openlayers.org/pipermail/users/attachments/20070114/e6d77524/attachment-0001.htm 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openlayers.org/pipermail/users/attachments/20070114/e6d77524/attachment-0001.html 


More information about the Users mailing list