Closed kinski76 closed 12 years ago
Hi Ade,
To ease to an extent you'll need to modify the map first, then grab its coordinate and pass that to easey. This is untested, but it's a pattern that I've used before:
// assuming you have a MM.Map instance named map
var ease = easey().map(map);
// get a copy of the current center coordinate
var currentCoord = map.coordinate.copy();
// set the extent, changing the center coord
map.setExtent(locations);
// grab a copy of the new coordinate
var nextCoord = map.coordinate.copy();
// return the map to its previous state
map.coordinate = currentCoord;
// ease to the new extent coord
ease.to(nextCoord)
.run(1000);
Does that work?
Shawn
You are a god send that works! :)
Thank you very much
ade
On 12 Jul 2012, at 19:50, Shawn Allen wrote:
Hi Ade,
To ease to an extent you'll need to modify the map first, then grab its coordinate and pass that to easey. This is untested, but it's a pattern that I've used before:
// assuming you have a MM.Map instance named map var ease = easey().map(map); // get a copy of the current center coordinate var currentCoord = map.coordinate.copy(); // set the extent, changing the center coord map.setExtent(locations); // grab a copy of the new coordinate var nextCoord = map.coordinate.copy(); // return the map to its previous state map.coordinate = currentCoord; // ease to the new extent coord ease.to(nextCoord) .run(1000);
Does that work?
Reply to this email directly or view it on GitHub: https://github.com/stamen/modestmaps-js/issues/139#issuecomment-6944100
Glad to be of service!
oooo one other little question if you don't mind:)
.path("about") is so much for what I'm trying to do. However using this plays a bit of havoc with the bounding box set with extent. So currently when I zoom in using .path("about") some of the content that "should" appear based on the extent set gets lost. Is there a way around this or is it a case of sticking to .path("screen")?
cheers once more:|
ade
On 12 Jul 2012, at 20:07, Shawn Allen wrote:
Glad to be of service!
Reply to this email directly or view it on GitHub: https://github.com/stamen/modestmaps-js/issues/139#issuecomment-6944589
To be totally honest, I'm not sure. Paging @tmcw :)
Hi
Wondered if someone could help clarify something...
Is it possible to use easey and tween to an extent?
I am currently using:
MM_map.setExtent(locations);
Which work great but it would be awesome If I could use easy to animate to the extent. Can't work out if it's currently possible so any help would be appreciated.
thanks very much in advance
ade