[OpenLayers-Users] Custom Icon on KML layers

Tito, Joe Joseph.Tito at sparta.com
Tue Jan 31 08:09:55 EST 2012


I have a vector layer being created from a KML file via an HTTP protocol, and I'm trying to figure out how to get a custom icon to be displayed for all point in the KML file.

Example URL to icon: http://www.mysite.com/icon.png

How I create the KML Layer:

var layer = new OpenLayers.Layer.Vector('mylayer', {
    strategies: [new OpenLayers.Stategy.Fixed()],
    protocol: new OpenLayer.Protocol.HTTP({
        url: 'http://www.mysite.com/kml.kml',
        format: new OpenLayers.Format.KML({
            extractStyles: false,
            extractAttributes: false,
            maxDepth: 0
        })
    })
});

I've tried creating a style and a style map and adding it to the layer, but I can't seem to get anything to work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120131/9188b377/attachment.html


More information about the Users mailing list