Hi Takako,<br><br>In my example I wanted the map to move.<br>However, it should be fairly easy to adapt the code to your liking.<br><br>Basically what I do is letting the tween class calculate my path & timing, and on eachStep I move the map. On eachStep, you should move your pinpoint with something like this: (NOTE: not tested)<br>
<br><br>someFunc: function() {<br><br>// var fromCoord = your starting point<br>// var toCoord = your destination point<br>// var duration = number of steps it should take, the more you take, the smoother the ride & longer it will take. (unless you also change the INTERVAL constant on Tween)<br>
var callbacks = {<br> eachStep: tweenstep<br>};<br>var tween = new OpenLayers.Tween(OpenLayers.Easing.Quad.easeInOut);<br>tween.start(fromCoord, toCoord, duration, {callbacks: callbacks}<br><br>},<br><br>tweenstep: function (value) {<br>
// TODO: move your feature to the new coord<br> // given in value.x and value.y<br>},<br><br><br>And another note: the tweenstep function is being called from the tween class, so you are out of scope and cannot see your feature. That's why, in my blogpost, I also stored the map object into the tween. You will probably have to do something similar with your feature.<br>
<br>If you can't get this to work, I might be able to set up a sample somewhere. Also, you might have some luck looking at the developer example code:<br><a href="http://openlayers.org/dev/tests/manual/tween.html">http://openlayers.org/dev/tests/manual/tween.html</a><br>
<br>regards,<br>Casper<br><br><div class="gmail_quote">On Wed, Dec 7, 2011 at 6:39 PM, Takako Tucker <span dir="ltr"><<a href="mailto:Takako.Tucker@bbc.co.uk">Takako.Tucker@bbc.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Hi, so this is what I currently got. </font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"><a href="http://paste.org/41978" target="_blank">http://paste.org/41978</a></font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">I can't seem to see Tweening working between pinpoints...
Any advise would be much appreciated. </font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">The map shouldn't move and just pinpoints should
move...</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Takako</font></span></div><br>
<div dir="ltr" lang="en-us" align="left">
<hr>
<font face="Tahoma" size="2"><div class="im"><b>From:</b> Casper Span
[mailto:<a href="mailto:info@spatially-oriented.com" target="_blank">info@spatially-oriented.com</a>] <br><b>Sent:</b> 07 December 2011
10:38<br><b>To:</b> Takako Tucker<br></div><b>Cc:</b> Adam Eskreis;
<a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><div><div class="h5"><br><b>Subject:</b> Re: [OpenLayers-Users]
Tweening pinpoints<br></div></div></font><br></div><div><div class="h5">
<div></div>I dabbled a bit with this a few weeks ago and posted a small blog on
it... Maybe it helps.<br><a href="http://www.spatially-oriented.com/joomla/tech/34-gis-articles/59-animated-zoom-with-openlayers" target="_blank">http://www.spatially-oriented.com/joomla/tech/34-gis-articles/59-animated-zoom-with-openlayers</a><br>
<br><br>
<div class="gmail_quote">On Wed, Dec 7, 2011 at 10:55 AM, Takako Tucker <span dir="ltr"><<a href="mailto:Takako.Tucker@bbc.co.uk" target="_blank">Takako.Tucker@bbc.co.uk</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><u></u>
<div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Thanks for
this! I had a look at .Tween, but as it reacts to DOM elements I couldn't be
sure if it works with Lon Lat (X.Y) figure. </font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">I'll try
again later on though. </font></span></div><br>
<div dir="ltr" lang="en-us" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> Adam Eskreis [mailto:<a href="mailto:aeskreis@gmail.com" target="_blank">aeskreis@gmail.com</a>]
<br><b>Sent:</b> 06 December 2011 18:03<br><b>To:</b> Takako
Tucker<br><b>Cc:</b> <a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br><b>Subject:</b> Re:
[OpenLayers-Users] Tweening pinpoints<br></font><br></div>
<div>
<div>
<div></div>There is an OpenLayers.Tween class I believe.<br><br>Also, this is
something that could easily be done iwth just regular javascript. Don't
forget, OpenLayers is comprised of DOM elements, so you can manipulate the map
with regular javascript, you don't have to use an OpenLayers
construct.<br><br>
<div class="gmail_quote">On Tue, Dec 6, 2011 at 12:33 PM, Takako Tucker <span dir="ltr"><<a href="mailto:Takako.Tucker@bbc.co.uk" target="_blank">Takako.Tucker@bbc.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><u></u>
<div>
<p><font face="Arial" size="2">Hello, </font></p>
<p><font face="Arial" size="2">I'm currently using
OpenLayers.Control.DragFeature to move pinpoint from one place to another.
</font></p>
<p><font face="Arial" size="2"> var
dragFeature = new OpenLayers.Control.DragFeature(location);</font> <br><font face="Arial" size="2">
map.addControl(dragFeature);</font> <br><font face="Arial" size="2">
dragFeature.activate();</font> </p><br>
<p><font face="Arial" size="2">But not only moving pinpoints, I need to add
tween animation. </font></p>
<p><font face="Arial" size="2">Has anyone done tween animation for moving
pinpoints? </font></p>
<p><font face="Arial" size="2">Any advise would be much appreciated! </font></p>
<p><font face="Arial" size="2">Thanks </font></p>
<p><font face="Arial" size="2">Takako</font> </p>
<div> </div><br><font face="Times New Roman" size="3"><a href="http://www.bbc.co.uk" target="_blank">http://www.bbc.co.uk</a><br>This
e-mail (and any attachments) is confidential and may contain personal views
which are not the views of the BBC unless specifically stated.<br>If you
have received it in error, please delete it from your system.<br>Do not use,
copy or disclose the information in any way nor act in reliance on it and
notify the sender immediately.<br>Please note that the BBC monitors e-mails
sent or received.<br>Further communication will signify your consent to
this.</font>
</div><br>_______________________________________________<br>Users mailing
list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br>
<div> </div><br><font face="Times New Roman" size="3"><a href="http://www.bbc.co.uk" target="_blank">http://www.bbc.co.uk</a><br>This
e-mail (and any attachments) is confidential and may contain personal views
which are not the views of the BBC unless specifically stated.<br>If you have
received it in error, please delete it from your system.<br>Do not use, copy
or disclose the information in any way nor act in reliance on it and notify
the sender immediately.<br>Please note that the BBC monitors e-mails sent or
received.<br>Further communication will signify your consent to this.</font>
</div></div></div><br>_______________________________________________<br>Users
mailing list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br>
<div> </div><br><font face="Times New Roman" size="3"><a href="http://www.bbc.co.uk" target="_blank">http://www.bbc.co.uk</a><br>This e-mail (and any
attachments) is confidential and may contain personal views which are not the
views of the BBC unless specifically stated.<br>If you have received it in
error, please delete it from your system.<br>Do not use, copy or disclose the
information in any way nor act in reliance on it and notify the sender
immediately.<br>Please note that the BBC monitors e-mails sent or
received.<br>Further communication will signify your consent to this.</font>
<div> </div><br><font face="Times New Roman" size="3"><a href="http://www.bbc.co.uk" target="_blank">http://www.bbc.co.uk</a><br>This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.<br>
If you have received it in error, please delete it from your system.<br>Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.<br>Please note that the BBC monitors e-mails sent or received.<br>
Further communication will signify your consent to this.</font>
</div></div></div>
</blockquote></div><br>