[OpenLayers-Users] Using Graphic markers for WFS layers - solved
Robert Sanson
SansonR at asurequality.com
Tue Sep 16 16:40:35 EDT 2008
Thanks Eric
It turned out I had an error in the URL specifying the graphic icon. Fixing that solved the problem.
Kind regards,
Robert Sanson
>>> "Eric Lemoine" <eric.c2c at gmail.com> 16/09/2008 6:00 p.m. >>>
Hi.
I am not sure about what's causing you trouble. But, have you tried this:
new OpenLayers.Style(OpenLayers.Util.applyDefaults(your_style_object,
OpenLayers.Feature.Vector.style["default"]));
In this way you make sure you have all the required properties.
Eric
2008/9/15, Robert Sanson <SansonR at asurequality.com>:
> Here is how I specify a styleMap:
>
> var style_gate = new OpenLayers.StyleMap({"default": new
> OpenLayers.Style({
> "graphicOpacity":1,
> "externalGraphic":"markers/main_gate_16.gif",
> "graphicXOffset":-8,
> "graphicYOffset":-8,
> "graphicWidth":16,
> "graphicHeight":16,
> "id":"main_gate",
> "strokeLinecap":"round",
> "strokeOpacity":1,
> "fillOpacity":1,
> "pointRadius":8})
> });
>
> I then reference this in my WFS layer definition:
>
> var maingatewfs = new OpenLayers.Layer.WFS("Main Gate",
>
> "http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=main_gates&service=wfs&version=1.0.0&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=10
> (
> 'http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=main_gates&service=wfs&version=1.0.0&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=10'
> )",
> {styleMap: style_gate, extractAttributes: true}
> );
> map.addLayer(maingatewfs);
>
> However, I am still getting the standard translucent orange point symbol.
>
> Can anyone point out what is wrong?
>
> Many thanks,
>
> Robert Sanson
>
>
>
>>>> "Robert Sanson" <SansonR at asurequality.com> 15/09/2008 4:47 p.m. >>>
> I have a map with three WFS point lfeature ayers. I want to use different
> markers for each WFS layer. How do I specify the icons to use?
>
> Many thanks,
>
> Robert Sanson
> ------------------------------------------------------------------
> The contents of this email are confidential to AsureQuality. If you have
> received this communication in error please notify the sender immediately
> and delete the message and any attachments. The opinions expressed in this
> email are not necessarily those of AsureQuality. This message has been
> scanned for known viruses before delivery. AsureQuality supports the
> Unsolicited Electronic Messages Act 2007. If you do not wish to receive
> similar communications in future, please notify the sender of this message.
> ------------------------------------------------------------------
>
>
> This message has been scanned for malware by SurfControl plc.
> www.surfcontrol.com
>
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080917/89f0231e/attachment.html
More information about the Users
mailing list