[OpenLayers-Users] seeking advice to orient image on layer

David Hine David.Hine at landandwater.com.au
Tue Mar 30 09:10:49 EDT 2010


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....

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100330/f7c72322/attachment.html


More information about the Users mailing list