[georss] Styling GeoRss points

Gregor J. Rothfuss gregor at apache.org
Mon Jun 4 13:51:34 EDT 2007


Charlie Savage wrote:
> Hi everyone,
> 
> I'd like revisit a discussion that happened in January about styling 
> GeoRss points.  I'd like to specify two images/icons for each Atom entry 
> that has a GeoRss point - a normal image and a hover image for mouse overs.
> 
> I'm wondering if there is any community consensus on how to do this? 
> Doing a bit of research, I found a discussion about this on the GeoRss 
> mailing list in January. A good starting point is a post by Christopher 
> Schmidt who talked about reusing KML, while Mikel Maron asked if reusing 
> CSS was more appropriate.
> 
> I agree that styling information shouldn't be added to GeoRss and that 
> reusing CSS is a good choice. However, CSS doesn't work for points when 
> you want to represent them with an image/symbol. Based on its HTML 
> heritage, CSS considers images to be markup and not presentation and 
> thus does not support changing an image's src attribute. The closest it 
> gets is supporting background images, but that seems like the wrong 
> solution for this problem.

it appeals to me on a theoretical level, but you'd have to implement a 
CSS engine with all its cascading rules to do it properly. the only 
place where that ever happened outside of HTML is SVG and that has been 
a failure, unfortunately.

> Thus, we need to find another solution. Some ideas I've pondered include:
> 
> 1. Use KML as Chris suggested. It would look something like this:
> 
> <Style id="highlightPlacemark">
>   <IconStyle>
>   <Icon>
>   <href>http://maps.google.com/mapfiles/kml/paddle/red-stars.png</href>
>   </Icon>
>   </IconStyle>
> </Style>
> <Style id="normalPlacemark">
>   <IconStyle>
>   <Icon>
>   <href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
>   </Icon>
>   </IconStyle>
> </Style>
> <StyleMap id="exampleStyleMap">
>   <Pair>
>     <key>normal</key>
>     <styleUrl>#normalPlacemark</styleUrl>
>   </Pair>
>   <Pair>
>     <key>highlight</key>
>     <styleUrl>#highlightPlacemark</styleUrl>
>   </Pair>
> </StyleMap>
> 
> The obvious downside to this is how verbose it is - which is fine for 
> KML but doesn't fit the GeoRss philosphy of keeping things simple.

verbose yes, complicated no. once you consider the hoops you have to 
jump through with the other solutions, it balances out sorta ok. i was 
not around when that piece of KML was designed or this would maybe look 
something like

  <Style id="highlightPlacemark">
    <Icon href="http://maps.google.com/mapfiles/kml/paddle/red-stars.png"/>
  </Style>
  <Style id="normalPlacemark">
    <Icon href="http://maps.google.com/mapfiles/kml/paddle/wht-blank.png"/>
  </Style>
  <StyleMap id="exampleStyleMap">
    <Pair key="normal" href="#normalPlacemark/>
    <Pair key="highlight href="#highlightPlacemark/>
  </StyleMap>

water on the bridge for 2.1/2.2, but maybe something the OGC would like 
to tackle? making things simpler for a change?

> 2. Reuse atom's icon element:
> 
> <atom:icon>http://www.mapbuzz.com/images/marker.gif</atom:icon>
> <atom:icon pseudo-class="hover">
>     http://www.mapbuzz.com/images/marker_hover.gif</atom:icon>
> 
> The downsides to this approach are:
> 
>     * atom:icon is defined only at the feed level.
>     * we have to introduce a custom attribute, which I called 
> pseudo-class to match CSS's terminology.
>     * If Atom ever supports icon at the entry level the semantics likely 
> will be a bit different.
>     * atom:icon does not specify widths or heights, which is important 
> to support SVG symbols.

yahoo did that:

http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fdeveloper.yahoo.net%2Fmaps%2Fsample.xml

no comment.

> 3. Reuse XHTML's img element:
> 
> <xhtml:img href="http://www.mapbuzz.com/images/marker.gif"
>   height="32" width="32"/>
> <xhtml:img href="http://www.mapbuzz.com/images/marker.gif"
>   height="32" width="32"alt="hover"/>
> 
> The advantage to this approach is that Atom's content element already 
> allows mixing in of XHTML, so there is some precedence. It also supports 
> image sizes and we could hijack alt to specify different images types.

hijacking class or role seems more appropriate.

> 4. Reuse SVG's image element:
> 
> <xhtml:img xlink:href="http://www.mapbuzz.com/images/marker.gif"
> x="100" y="100"height="32" width="32"/>
> <xhtml:img xlink:href="http://www.mapbuzz.com/images/marker.gif"
> x="100" y="100"height="32" width="32" pseudo-class="hover"/>
> 
> An SVG image introduces a funny twist - it let's you specify x and y 
> values.I could see this being confused with the x/y values in a GeoRss 
> point. Alternatively, it could be helpful to precisely postion this 
> image. SVG images also support a number of style related attributes, 
> such as opacity, which could be helpful.

xlink? oy. talk about a stillborn standard.

> Currently, option #4 looks like the best choice to me, but just 
> wondering what other people think.

from an implementation POV, 1) has the benefit that you are implementing 
something that you need anyway if you are also supporting KML.
_______________________________________________
georss mailing list
georss at lists.eogeo.org
http://lists.eogeo.org/mailman/listinfo/georss



More information about the georss mailing list