0

I'm using Openlayers 2 with Gmaps and a vector layer to display features with icons.

I'm using this code to set the icons on the features:

feature.style = {
            externalGraphic : iconUrl,
            graphicWidth : 30,
            graphicHeight : 20,
            fillOpacity : 1
        };

The problem is that I'm using the same icons in the site with css sprites and it would better to use them with openlayers rather than requesting the same icons from the server.

So I'm looking for a way to give each feautre a css class rather than a url for the icon.

1 Answer 1

1

There is no way to apply CSS in feature.style.

One more thing, image is only one time loaded in client machine then, it is used throughout the application. So, no worry about that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.