I have created a custom module, which creates a layer, and pulls in points/locations from a kml file. All works great.

The KML file creates custom icons per category. The custom icons come up great, different color for each category...
But... they come up the wrong size. Somehow they are getting blown up/expanded from their original 16x16 size.

The map is behind a firewall for now so no URL available.

Something aboput <scale>?
Any ideas.

Comments

tmcw’s picture

Hi, you're looking for the "scale" parameter in KML styles, documented here by Google. I think that the default for OpenLayers is... 14px wide? But, anyway, use Firebug or whatever to see how large the image elements are being rendered and then do the quick math to find the scale factor to make them the correct size.

Anonymous’s picture

Yep, that was it. KML now looks like:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
  <Style id="sensitiveStyle">
   <IconStyle id="sensitiveIcon">
    <Icon>
      <href>http://maps.google.com/mapfiles/kml/paddle/grn-stars-lv.png</href>
      <scale>0.5</scale>
    </Icon>
   </IconStyle> 
  </Style>
  <Placemark>
   <name>2964</name>
   <description>Park</description>
   <styleUrl>#sensitiveStyle</styleUrl>
   <Point>
       <coordinates>2.13432,53.26387,0</coordinates>//note space in here causes problems
   </Point>
  </Placemark>
</Document>
</kml>
tmcw’s picture

Status: Active » Fixed

Cool, marking as fixed.

Status: Fixed » Closed (fixed)

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