Hi,
 
"${angle}" will expand to aFeature.attributes.angle. Add this attribute to
your features, then your styleMap should do the rest.
 
Arnd
 

  _____  

Von: users-boun...@openlayers.org [mailto:users-boun...@openlayers.org] Im
Auftrag von David Hine
Gesendet: Dienstag, 30. März 2010 15:11
An: users@openlayers.org
Betreff: [OpenLayers-Users] seeking advice to orient image on layer



Dear OL List

I am seeking assistance to orient an arrow image on a layer using the latest
wind direction record in a MySQL database.

 

I have a php file printing the value of the direction and I reference it by
its location… but this is not successful.

 

Your suggestions would be very welcome.

Thanks

David Hine

 

Snip….

vectors = new OpenLayers.Layer.Vector(

                "Wind Direction",

                {

                    styleMap: new OpenLayers.StyleMap({

                        "default": {

                            externalGraphic: "img/windarrow.png",

                            //graphicWidth: 17,

                            graphicHeight: 67,

                            graphicYOffset: -33,

                            rotate: "${angle}",

                            fillOpacity: "1"

                        },

                        "select": {

                            cursor: "crosshair",

                            externalGraphic: "img/marker.png"

                        }

                    })

                }

            );

            

             map.addLayer(vectors);

            

            var features = [];

            var x = 145.85318;

            var y = -17.53748;

            var angle = {location: "./txtgen_wind_dir.php"}

             rotate: "${angle}",

             origin = (x, y),

             

                features.push(

                    new OpenLayers.Feature.Vector(

                        new OpenLayers.Geometry.Point(x, y), {angle:
"${angle}", origin: (x, y)

                        }

                    )

                );                   

                vectors.addFeatures(features);

 

snip….

_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to