How to use BalloonStyle and BalloonData?

3 posts, 0 answers
  1. Fabrice Marguerie
    Fabrice Marguerie avatar
    9 posts
    Member since:
    May 2010

    Posted 25 Aug 2010 Link to this post

    Could someone please provide a code sample that shows how to use the MapPinPoint.BalloonStyle and MapPinPoint.BalloonData properties?
    I haven't found anything about these properties.
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 26 Aug 2010 Link to this post

    Hi Fabrice Marguerie,

    The MapPinPoint.BalloonStyle and MapPinPoint.BalloonData properties are used for internal purposes of the KML reader. You can use these properties in your application. The BalloonStyle sets appearance of the tooltip will be shown for MapPinPoint. The BalloonStyle.Text property specifies template of the tooltip as XHTML fragment (only <p>, <b> and <font> elements are supported currently). For example:

    <text>
        <![CDATA[
            <body bgcolor="#000000" width="100%">
                <p><b><font color="#000000">$[PERIMETER/displayName]:</font></b> <font color="#000000">$[PERIMETER]</font></p>              
                    <p><b><font color="#000000">$[DAYADM/displayName]:</font></b> <font color="#000000">$[DAYADM]</font></p>                
                    <p><b><font color="#000000">$[ORDERADM/displayName]:</font></b> <font color="#000000">$[ORDERADM]</font></p>
                    <p><b><font color="#000000">$[MONTHADM/displayName]:</font></b> <font color="#000000">$[MONTHADM]</font></p>
                    <p><b><font color="#000000">$[AREA/displayName]:</font></b> <font color="#000000">$[AREA]</font></p>                
                    <p><b><font color="#000000">$[STATE/displayName]:</font></b> <font color="#000000">$[STATE]</font></p>              
                    <p><b><font color="#000000">$[YEARADM/displayName]:</font></b> <font color="#000000">$[YEARADM]</font></p>              
                    <p><b><font color="#000000">$[STATEFIPS/displayName]:</font></b> <font color="#000000">$[STATEFIPS]</font></p>              
                    <p align="center"><font size='14' face='arial' color="#0099FF">Powered by GeoCommons</font></p>
            </body>
        ]]>
    </text>


     The BalloonData sets data that will be shown in the tooltip. This data must be represented as KML <ExtendedData> element. For example:

    <ExtendedData>
        <Data name='PERIMETER'>
            <displayName><![CDATA[Perimeter]]></displayName>
            <value><![CDATA[0.053]]></value>
        </Data>
        <Data name='DAYADM'>
            <displayName><![CDATA[Day Admitted]]></displayName>
            <value><![CDATA[14.0]]></value>
        </Data>
        <Data name='ORDERADM'>
            <displayName><![CDATA[Order Admitted]]></displayName>
            <value><![CDATA[22]]></value>
        </Data>
        <Data name='MONTHADM'>
            <displayName><![CDATA[Month Admitted]]></displayName>
            <value><![CDATA[December]]></value>
        </Data>
        <Data name='AREA'>
            <displayName><![CDATA[Area]]></displayName>
            <value><![CDATA[0.0]]></value>
        </Data>
        <Data name='STATE'>
            <displayName><![CDATA[State Name]]></displayName>
            <value><![CDATA[Alabama]]></value>
        </Data>
        <Data name='YEARADM'>
            <displayName><![CDATA[Year Admitted]]></displayName>
            <value><![CDATA[1819.0]]></value>
        </Data>
        <Data name='STATEFIPS'>
            <displayName><![CDATA[Day Admitted]]></displayName>
            <value><![CDATA[01]]></value>
        </Data>
    </ExtendedData>


    Regards,
    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Fabrice Marguerie
    Fabrice Marguerie avatar
    9 posts
    Member since:
    May 2010

    Posted 30 Aug 2010 Link to this post

    Thank you.
    I didn't know these properties where designed for KML. You should add this information to the documentation since these properties are public.

    Fabrice
Back to Top