Hello,

Thank you for this usefull module.

I have succeeded in exporting my located nodes, but I don't understand how to use IconStyle

I putted the code

<Style id="element">
<IconStyle>
<Icon>
<href>http://www.ziip.be/map/zip-vert.png</href>
</Icon>
</IconStyle>
</Style>

in the file kml-style.tpl.php and this piece of code is well integrated in my KML files

but no links between included "Placemarkq" and these iconstyles

how to implement them, and how to choose this style for this placemark and this style for this other placemark?

thank you for your informations

I joined a screenshot of my view configuration, if needed

matthieu

CommentFileSizeAuthor
kml.jpg129.96 KBmatthieu_collet

Comments

jeffschuler’s picture

Status: Active » Fixed

Your placemarks need to reference #element as their style.
Copy kml-placemark.tpl.php to your theme and add <styleUrl>#element</styleUrl> to your placemarks, like:

<?php
?><Placemark>
  <styleUrl>#element</styleUrl>
  <name>
    <![CDATA[<?php print $name ?>]]>
  </name>
  <description>
    <![CDATA[<?php print $description ?>]]>
  </description>
  <?php if ($styleUrl): ?>
  <styleUrl><?php echo $styleUrl; ?></styleUrl>
  <?php endif; ?>
  <Point>
    <coordinates><?php print $coords ?></coordinates>
  </Point>
</Placemark>

If you want to customize the icon for in each placemark based on fields in each row of your view, what just got committed to 6.x-2.x-dev lets you get at those fields from kml-placemark.tpl.php. See #1252348: Make remaining fields available in point.

Please re-open this if this doesn't solve your dilemma. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.