Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is possible define vector style to show vector external graphic file on map in map units?

My vector is shown in fixed size. External graphic are from .svg and .png file. I tried both of file.

I think that is possible, but with .svg file?


Sample code:

    var wfs_layer = new OpenLayers.Layer.Vector("Vector sample", {
strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
//projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
// loading data through localhost url path
url: "http://localhost:8080/geoserver/wfs",
featureNS :  ".....",
extractAttributes: true,
// layer name
featureType: "laeyr8",
geometryName: "geom",
schema: "...localhost:8080/geoserver/wfs/....."
autoLoad: true

and vector style:

    var vector_style = new OpenLayers.Style({
'externalGraphic': "Layerfile.svg",
//'externalGraphic': "marker-gold.png",
'fillColor': '#669933', 
'fillOpacity': .5, 
'strokeColor': '#aaee77', 
'strokeWidth': 3, 
'pointRadius': 5 

Of course, other parameter of color or fill parameter isn`t working, in external graphic only radius work.

Is there any way to show vector in map units?

share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.