hi Carlo<br><br>i'm working on vector layer because it seems to be the right solution.<br>at the moment i'm drawing a custom (vector) marker and the next step will be to find a way to animate it (and to show the popup window inside it).<br>
<br>this is the initial code i've wrote to draw a shape on a map<br> var point = e.xy;<br> <br> var markerTemplate = [<br> point,<br> point.offset(new OpenLayers.Pixel(100,0)),<br>
point.offset(new OpenLayers.Pixel(100,100)),<br> point<br> ];<br><br> for(i=0; i<markerTemplate.length; i++){<br> markerTemplate[i] = map.getLonLatFromViewPortPx(markerTemplate[i]);<br>
markerTemplate[i] = new OpenLayers.Geometry.Point(markerTemplate[i].lon,markerTemplate[i].lat);<br> }<br> <br> var style_mark = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);<br>
style_mark.graphicWidth = 24;<br> style_mark.graphicHeight = 20;<br> style_mark.graphicXOffset = 10; // default is -(style_mark.graphicWidth/2);<br> style_mark.graphicYOffset = -style_mark.graphicHeight;<br>
// graphicTitle only works in Firefox and Internet Explorer<br> style_mark.graphicTitle = "this is a test tooltip";<br><br><br> var feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(markerTemplate)),null,style_mark);<br>
<br>but i've changed it with this<br> OpenLayers.Renderer.symbol.marker = [0,0, 0,-100, 100,-100, 0,0];<br> var style_mark = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);<br>
style_mark.graphicName='marker';<br> style_mark.pointRadius=10;<br> <br> var point = map.getLonLatFromViewPortPx(e.xy);<br> var feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(point.lon,point.lat),null,style_mark);<br>
<br>because i wanted a fixed size marker respect to the zoom level of the map<br><br><br>if someone know how to animate the mark (i've seen a Tween class but i had no time to experiment!) please write down a link or a sample code!!<br>
<br>Vito<br><br><br><br>--<br>-----------<br>Tafuni Vito<br><a href="mailto:vito@vitotafuni.com">vito@vitotafuni.com</a><br>---------------------------------------------<br>"Verba volant, scripta manent... data corrupted"<br>
<br><br>2010/6/15 Carlo Sassani <<a href="mailto:carlo@sarmoung.it">carlo@sarmoung.it</a>><br><br> Vito Tafuni <vitotafuni@...> writes:<br><br> > hi to all I would like to make a marker like the "image markers" on<br>
london2012<a href="http://www.london2012.com/map.php">http://www.london2012.com/map.php</a><br> > click on "Olimpic Park"so i would like to have a "zooming" animation on a<br> marker instead of the info bubble popup<br>
> do you suggest me to work on markers layout (extending the Marker class) or<br> > with the vector layout (and vector shapes)??thanks Vito<br> > _______________________________________________<br> > Users mailing list<br>
> Users@...<br> > <a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br><br><br> I've a similar problem!<br> Did you find any solution?<br><br><br>
<br><br> _______________________________________________<br> Users mailing list<br> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br> <a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br>