[OpenLayers-Users] Trouble with image rotated and location
Tony Peña
emperor.cu at gmail.com
Mon Sep 5 09:34:19 EDT 2011
Hi, i'm searching at google and some list about geolocation and openlayers
and i get set lonLat at map and rotation of the image, but can't join the
rotated image in the lonLat
i send here my example OpenLayer javascript, if some can see my trouble and
help me to fix it!..
i don't know any of javascript, i'll try to adapt other code into my. so...
here is.
<html><body>
<div id="mapdiv"></div>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script>
map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer.OSM());
lon = -81.094400;
lat = 17.585400;
var lonLat = new OpenLayers.LonLat( lon, lat )
.transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
);
var zoom = 6;
var markers = new OpenLayers.Layer.Markers( "Markers" );
var icon = new OpenLayers.Icon("./images/airplane.gif");
var planes=new OpenLayers.Layer.Vector("Planes",
{
styleMap: new OpenLayers.StyleMap({
"default": {
externalGraphic:
"./images/airplane.gif",
graphicWidth: 16,
graphicHeight: 16,
graphicYOffset: 0,
rotation: "${angle}",
fillOpacity: "${opacity}"
}
})
});
var feature=new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point( lon, lat), {"angle": 45, opacity:
100});
planes.addFeatures([feature]);
map.addLayer(planes);
map.setCenter (lonLat, zoom);
</script>
</body></html>
--
Antonio Peña
Secure email with PGP 0x8B021001 available at http://pgp.mit.edu
Fingerprint: 74E6 2974 B090 366D CE71 7BB2 6476 FA09 8B02 1001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110905/7eecd851/attachment.html
More information about the Users
mailing list