[OpenLayers-Users] KML Layer Opacity

Eric Lemoine eric.c2c at gmail.com
Fri Jun 13 03:15:18 EDT 2008


Hi. Your code looks good to me. As for the styling, you can probably
rely on the styling framework - search for 'style' in the wiki to
learn about that framework, and look at the various examples. Cheers,
Eric

2008/6/12, Levii Smith <smithlev at levii.com>:
> Just a question: Can an opacity be set to the KML or vector layers without
> individually modifying each marker?
>
> Current method of creating the KML layer below (it works, don't know if I
> should be doing it differently though).
>
> /* Begin KML handling functions */
> function createKMLLayer(id, url, name) {
>  if(document.getElementById(id).disabled == false) {
>   if ( document.getElementById(id).checked == true ) {
>    window[id] =  new OpenLayers.Layer.GML(name, url,{format:
> OpenLayers.Format.KML,formatOptions:
> {extractStyles:true,extractAttributes:true}});
>    map.addLayer(window[id]);
>    selectControl = new OpenLayers.Control.SelectFeature(window[id],
>                 {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
>    map.addControl(selectControl);
>    selectControl.activate();
>   } else {
>    map.removeLayer(window[id]);
>   }
>  }
> }
>
>
>
> Thanks,
>
> Levii



More information about the Users mailing list