Constructing a varible in a writer.WriteElementString for GeoRSS Feed.

Last post 07-03-2008 5:20 AM by Samu Zhang - MSFT. 1 replies.

Sort Posts:

  • Constructing a varible in a writer.WriteElementString for GeoRSS Feed.

    06-29-2008, 5:53 PM
    • Loading...
    • rainmanjam
    • Joined on 03-27-2007, 1:11 PM
    • Posts 25

    I am adding the icon field in a GeoRSS XML feed and would like the icon change per GPS position.  I would like to take the following code:

     

        public string NumToEnforcementLevel(int Level)
    {
    switch (Level)
    {
    case 1:
    return "Low";
    case 2:
    return "Moderate";
    case 3:
    return "High";
    }
    return "Unspecified";
    }
     

       and make the level part of the url for each gps point.


        public XmlTextWriter AddRSSItem(XmlTextWriter writer, string Title,int level, string Description, double Lat, double Lon)
    {
    writer.WriteStartElement("item");
    writer.WriteElementString("title", Title);
    writer.WriteElementString("description", Description);
    writer.WriteElementString("geo:lat", Lat.ToString());
    writer.WriteElementString("geo:long", Lon.ToString());
    **** writer.WriteElementString("icon", "http://njection.com/speedtrap/Images/" + level + ".png");*****
    writer.WriteEndElement();
    return writer;
    }

     What would be the best way of doing this?


    Filed under:
  • Re: Constructing a varible in a writer.WriteElementString for GeoRSS Feed.

    07-03-2008, 5:20 AM
    Answer

    Hi rainmanjam ,

    writer.WriteElementString("icon", "http://njection.com/speedtrap/Images/" + NumToEnforcementLevel(level) + ".png")

     

    Sincerely,
    Samu Zhang
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter