Google Groups Home
Help | Sign in
Zoom out, pan to and zoom in
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
pw240639  
View profile
 More options Aug 20, 1:48 pm
From: pw240639 <phil.wal...@sunandshadows.net>
Date: Wed, 20 Aug 2008 01:48:08 -0700 (PDT)
Local: Wed, Aug 20 2008 1:48 pm
Subject: Zoom out, pan to and zoom in
I am a relative newbie to Google Map API although I have used Google
Earth KML.

I am creating a website "Shropshire Sundials",  Here is the link:
 www.shropshire-sundials.net

I am using mostly the Blackpool tutorials/example

I would like to be able to "fly" using the Satellite map from one
marker to another , and with slow and smooth animation :

from first marker,
zoom out to 9

pan to next marker

zoom in to 18

rather like Google Earth placemarks....

So far:
 GEvent.addListener(marker, "click", function() {
                map.setCenter(point,18,G_SATELLITE_MAP);
          marker.openInfoWindowHtml(html);
        });

I have tried to find how to do this through the Group but I am so far
confused. Your help would be appreciated!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelo  
View profile
 More options Aug 20, 1:58 pm
From: marcelo <marcelo...@hotmail.com>
Date: Wed, 20 Aug 2008 01:58:53 -0700 (PDT)
Local: Wed, Aug 20 2008 1:58 pm
Subject: Re: Zoom out, pan to and zoom in
You need to use a chain of window.setTimeout() statements, where the
execution of each statement sets up the next, but this is not a Google
Maps API issue. It's just basic Javascript.

--
Marcelo - http://maps.forum.nu
--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pw240639  
View profile
 More options Aug 23, 10:54 pm
From: pw240639 <phil.wal...@sunandshadows.net>
Date: Sat, 23 Aug 2008 10:54:05 -0700 (PDT)
Local: Sat, Aug 23 2008 10:54 pm
Subject: Re: Zoom out, pan to and zoom in
I have experimented with this link : www.shropshire-sundials.net

The key snippet is here:

 // A function to create the marker and set up the event window
      function createMarker(point,name,html,icontype) {
        var marker = new GMarker(point,dialIcons[icontype]);
        GEvent.addListener(marker, "click", function() {
        map.setCenter(new GLatLng( 52.67,-2.67),9,G_SATELLITE_MAP);
        setTimeout("map.panTo(point)", 100);
        for (var i = 9; i < 18; i++) {
         setTimeout("map.zoomIn()",50);
        }
          marker.openInfoWindowHtml(html);
        });
                // save  the info we need to use  later for for the side_bar
                gmarkers[i] = marker;
        htmls[i] = html;
        // ======= Add the sidebar entry to one of the sidebars =====
        side_html = '<a href="javascript:myclick(' + i + ')">' + name
+ '</a><br>';
        sidebar_html[Math.floor(i/num_markers)] += side_html;
        // ==========================================================
        i++;
        return marker;
      }

My intention is to zoomIn from 9 to 18 smoothly before opening the
InfoWindow.

It doesn 't appear to work correctly. I'm sure I'm missing some newbie
point! .Any suggestions gratefully received.

Phil

On 20 Aug, 09:58, marcelo <marcelo...@hotmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelo  
View profile
 More options Aug 23, 11:09 pm
From: marcelo <marcelo...@hotmail.com>
Date: Sat, 23 Aug 2008 11:09:46 -0700 (PDT)
Local: Sat, Aug 23 2008 11:09 pm
Subject: Re: Zoom out, pan to and zoom in
On Aug 23, 7:54 pm, pw240639 <phil.wal...@sunandshadows.net> wrote:

> I have experimented with this link :www.shropshire-sundials.net

I don't see any map on that site.

In any case, you need a *chain* of setTimeout() statements, meaning
that each one launches when the previous one completed, but that is
pure javascript and outside the scope of this group.

In any case, I doubt it will all look as smoooth as you mght expect.

--
Marcelo - http://maps.forum.nu
--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Esa  
View profile
 More options Aug 24, 3:57 am
From: Esa <esa.ilm...@gmail.com>
Date: Sat, 23 Aug 2008 15:57:47 -0700 (PDT)
Local: Sun, Aug 24 2008 3:57 am
Subject: Re: Zoom out, pan to and zoom in

On 23 elo, 21:09, marcelo <marcelo...@hotmail.com> wrote:

> In any case, you need a *chain* of setTimeout() statements, meaning
> that each one launches when the previous one completed

Exactly. A simple way to construct the chain is to use 'zoomend' event
listener to trigger the new setTimeout(). The event returns old and
new zoomlevels as parameters which are handy for an if() limiter.
Using setInterval() might be even easier.

> In any case, I doubt it will all look as smoooth as you mght expect.

I agree with your doubt. I tried it once with terrible results. First
of all
setTimeout("map.zoomIn()",50) is much too quick. I don't get the tiles
so fast and there is no sense to make a page that works only with a
100M connection. It should be more than 500 milliseconds.

You have to use continuous zoom if you even dream to get a smooth
result, but actually that is too fast.
Start with something like
GEvent.addListener(map,'zoomend',function(oldZ,newZ){
  var delay = setTimeout("map.zoomIn(null,null,true)",500);
  if(newZ > 16) delay = null;

});

with continuous zoom enabled. And you see that continuous zoom stops
waiting on every step but still there are tiles missing all the time.
Even cpu doesn't like it. It goes hot.

I can see one solution. Try to hack the speed control of the
continuous zoom and turn it slower, somewhere around two seconds per
zoomlevel step.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pw240639  
View profile
 More options Aug 24, 4:16 pm
From: pw240639 <phil.wal...@sunandshadows.net>
Date: Sun, 24 Aug 2008 04:16:05 -0700 (PDT)
Local: Sun, Aug 24 2008 4:16 pm
Subject: Re: Zoom out, pan to and zoom in
Here is my link:http://www.sundial.pwp.blueyonder.co.uk/
shropshiresundials/shropshiresundialsGooglemap-F.html

I have added the enableContinuousZoom statement and changed the
setTimeouts  in the zoomIn() loop as you suggested.

I have tried to follow your posts but I am in uncharted waters. I
don't understand the "zoomend" listener and this statement: var delay
= setTimeout("map.zoomIn(null,null,true)",500);  Are there parameters
to zoomIn()?

Using my code in the link, I see only the first and the last zoom
level and, in between, the InfoWindow

Again, your help is appreciated,
Phil

On 23 Aug, 23:57, Esa <esa.ilm...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Esa  
View profile
 More options Aug 25, 1:19 am
From: Esa <esa.ilm...@gmail.com>
Date: Sun, 24 Aug 2008 13:19:18 -0700 (PDT)
Local: Mon, Aug 25 2008 1:19 am
Subject: Re: Zoom out, pan to and zoom in

On 24 elo, 14:16, pw240639 <phil.wal...@sunandshadows.net> wrote:

> Here is my link:http://www.sundial.pwp.blueyonder.co.uk/
> shropshiresundials/shropshiresundialsGooglemap-F.html

> I have added the enableContinuousZoom statement and changed the
> setTimeouts  in the zoomIn() loop as you suggested.

I did not find those things on the page you linked.
So I made a quick demo page
http://esa.ilmari.googlepages.com/animPan.htm

Copy/paste the code to your page so that you can crank the timeout
value.

> I have tried to follow your posts but I am in uncharted waters. I
> don't understand the "zoomend" listener and this statement: var delay
> = setTimeout("map.zoomIn(null,null,true)",500);  Are there parameters
> to zoomIn()?

zoomIn() parameters are undocumented but you have to set the third
parameter to get animated continuous zoomIn.

GEvent 'zoomend' listener is constructed to trigger the next timeouted
zoomIn() when the previous zooming ends.

var delay is the variable name for the setTimeout() function so that
we can destroy it and stop the process by
delay = null;


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Esa  
View profile
 More options Aug 25, 1:46 am
From: Esa <esa.ilm...@gmail.com>
Date: Sun, 24 Aug 2008 13:46:29 -0700 (PDT)
Local: Mon, Aug 25 2008 1:46 am
Subject: Re: Zoom out, pan to and zoom in
I still have to clear a few things about timing of the loop.

If you have no continuous zoom you have to set some timeout because
'zoomend' comes immediately after zoomIn() is triggered.

Continuous zoom gives you around 500 ms of timeout by itself. The
timeOut value of our loop is the time how long the code waits after
continuous zoom animation is finished. And after that wait time a new
zoomIn() is triggered. So you can set the value to zero with
continuous zoom. Zero is the value for smooth animation. But in
practice the map tiles are not loaded that fast.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pw240639  
View profile
 More options Aug 28, 7:52 pm
From: pw240639 <phil.wal...@sunandshadows.net>
Date: Thu, 28 Aug 2008 07:52:15 -0700 (PDT)
Local: Thurs, Aug 28 2008 7:52 pm
Subject: Re: Zoom out, pan to and zoom in
I copied your demo page, animPan.htm, into my website and altered  the
timeOut to 1500, which allows me to see the zoomIn()  to step steadily
from 1 to 16  on the LargeControl..

Then I copied the zoomIn() loop Listener and increased to timeOut to
15500 before adding it to my script at this link:.
http://www.sundial.pwp.blueyonder.co.uk/shropshiresundials/shropshire...

or, alternately, http://www.shropshire-sundials.net    and follow the
"click here" link.

At the zoomIn() at 9, ie the first iteration, the infoWindow appears.
No more steps appear in the LargeControl until the last (16) iteration
when the script continues normally.

I presume that my problem is to do with the infoWindow. Do I need to
create a Listener for the InfoControl and ,if so ,how do I do this? .
Or it is something else in my code?

I appreciate your help and explanations
Phil


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelo  
View profile
 More options Aug 29, 1:25 am
From: marcelo <marcelo...@hotmail.com>
Date: Thu, 28 Aug 2008 13:25:28 -0700 (PDT)
Local: Fri, Aug 29 2008 1:25 am
Subject: Re: Zoom out, pan to and zoom in
Try this one:
http://maps.forum.nu/temp/gm_fly_over.html

I think it can only be done with pretty small maps.

;-)

--
Marcelo - http://maps.forum.nu
--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Garthan  
View profile
 More options Aug 29, 1:34 am
From: Garthan <lance...@inetnebr.com>
Date: Thu, 28 Aug 2008 13:34:08 -0700 (PDT)
Local: Fri, Aug 29 2008 1:34 am
Subject: Re: Zoom out, pan to and zoom in
I like your distraction...

On Aug 28, 3:25 pm, marcelo <marcelo...@hotmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google