repr:text

Diagram

Description

The template body.

This is an HTML code with the following inserts:

$[data_field_name|value_by_default]

When creating an HTML layout for a specific map object, such inserts are replaced with data from the object. For example, the template body might look like this:

<div><h3>$[name|no name specified]</h3><span>$[description|no description]</span></div>

When this template is applied, the $[name|no name specified] field will be replaced by the name field value of the object the template is used for.

If the name field is not set for an object, the default value will be substituted. Similarly for $[description|no description].

When describing geographic objects with YMapsML, you can use such tags as gml: name, gml: description, and gml: metaDataProperty for storage and subsequent display of data.

For security reasons, HTML markup can only be stored in the gml: description tag. All other tags must contain text only, and HTML markup in them is shown on the screen.

Contained by:

repr:Template

repr:text

YMapsML document that describes an icon placemark template:

<repr:Template gml:id="myIconTemplate">
    <repr:text>
        <![CDATA[
          <div style="font-size:15px;"><div><u>Name</u>: $[name]</div>
          <div><u>Description</u>: $[description]</div> </div>
          <div> <img src="http://www.irk.ru/img/site/gallery/75/c07c4446-d9d8-4c19-b595-e764145517b2_jpg_160x100000_q85.jpg"></div>
        ]]>
    </repr:text>
</repr:Template>

Using this template, you can define a style:

<repr:Style gml:id="myStyle">
   <repr:balloonContentStyle>
      <repr:template>#myIconTemplate</repr:template>
   </repr:balloonContentStyle>
   <repr:iconStyle>
      <repr:href>http://company.yandex.ru/i/ya.png</repr:href>
      <repr:size x="56" y="56"/>
   </repr:iconStyle>
</repr:Style>

And apply it to a placemark:

<ymaps:GeoObject>
   <ymaps:style>#myStyle</ymaps:style>
   <gml:name>Baikal</gml:name>
   <gml:description> The deepest lake on the planet Earth.<br/>The largest natural freshwater reservoir.</gml:description>
   <gml:Point>
      <gml:pos>107.7 53.08</gml:pos>
   </gml:Point>
</ymaps:GeoObject>