This is a migrated thread and some comments may be shown as answers.

How to use BalloonStyle and BalloonData?

2 Answers 99 Views
Map
This is a migrated thread and some comments may be shown as answers.
Fabrice Marguerie
Top achievements
Rank 1
Fabrice Marguerie asked on 26 Aug 2010, 12:54 AM
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 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Aug 2010, 04:42 PM
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
0
Fabrice Marguerie
Top achievements
Rank 1
answered on 30 Aug 2010, 02:39 PM
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
Tags
Map
Asked by
Fabrice Marguerie
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Fabrice Marguerie
Top achievements
Rank 1
Share this question
or