"idle" event fires too soon

1,320 views
Skip to first unread message

bratliff

unread,
Jan 4, 2011, 10:50:33 AM1/4/11
to Google Maps JavaScript API v3
I am trying to implement a "light weight" marker facility:

http://www.polylib.us/polycluster/place

CANVAS (non-clickable) performance is fine. SVG (clickable)
performance is horrible.

I would like to be able to disable the overlay layer during map
repositioning. The "bounds_changed" "center_changed" and
"zoom_changed" events accurately signal the beginning of the movement
but the "idle" event does not accurately signal the end of the
movement.

I believe it is a bug according to the documentation. Can someone
suggest a workaround without timer interrupts. CPU speeds vary.
Anything I do with timer interrupts will be either too fast or too
slow on some devices.

David Ruggles

unread,
Jan 4, 2011, 11:27:03 AM1/4/11
to google-map...@googlegroups.com
I don't know if this will help you in your specific case, but I've used the "tilesloaded" event to detect movement end more accurately.


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


bratliff

unread,
Jan 4, 2011, 12:15:37 PM1/4/11
to Google Maps JavaScript API v3
On Jan 4, 4:27 pm, David Ruggles <thedavidfac...@gmail.com> wrote:
> I don't know if this will help you in your specific case, but I've used the
> "tilesloaded" event to detect movement end more accurately.

I have tried it too. If the tiles are already in cache, it fires too
soon. If the tiles are not already in cache, it does not fire quickly
enough. If additional tiles are not required, it never fires.

I believe I can work around it by examining the actual "style.top" and
"style.left" properties of the container DIV. If I detect no change
for some period of time like one second, I will assume the movement
has stopped. It is a long time to wait for the overlay layer to
reappear but it will expedite map movement.

Are you aware of a way to disable smooth panning ? It seems like
another useless feature like bouncy markers. It ought to be an
option.

Chris Broadfoot

unread,
Jan 4, 2011, 6:47:07 PM1/4/11
to google-map...@googlegroups.com
Hi bratliff - is it this issue you're facing?


Chris

bratliff

unread,
Jan 4, 2011, 8:40:53 PM1/4/11
to Google Maps JavaScript API v3
Hi Chris,

It may be related but it does not involve an infowindow. The "idle"
event fires in the middle of map movement but not at its completion.

See:

http://code.google.com/p/gmaps-api-issues/issues/detail?id=2845

Also:

http://code.google.com/p/gmaps-api-issues/issues/detail?id=2846

which addresses the same performance bottleneck.

Smooth panning may seem cute but it really hurts performance. I would
like to be able to suppress it the same way I can suppress bouncy
markers. Frivolous elements of the API ought to be an option.
Ideally, Google's development resources would be focused on fixing
bugs.

Berry

Chris Broadfoot

unread,
Jan 4, 2011, 11:44:05 PM1/4/11
to google-map...@googlegroups.com
On Wed, Jan 5, 2011 at 12:40 PM, bratliff <brat...@umich.edu> wrote:
I would like to be able to suppress it

I replied on the issue tracker but will copy the reply here:

---

What isn't covered by

MapOptions - draggable=false, disabling pan control

Map - Using setCenter and not panTo; fitBounds and not panToBounds

InfoWindow - disableAutoPan=true

bratliff

unread,
Jan 5, 2011, 12:14:48 AM1/5/11
to Google Maps JavaScript API v3
On Jan 5, 4:44 am, Chris Broadfoot <c...@google.com> wrote:
> On Wed, Jan 5, 2011 at 12:40 PM, bratliff <bratl...@umich.edu> wrote:
> > I would like to be able to suppress it
>
> I replied on the issue tracker but will copy the reply here:
>
> ---
>
> What isn't covered by
>
> MapOptions - draggable=false, disabling pan control
>
> Map - Using setCenter and not panTo; fitBounds and not panToBounds
>
> InfoWindow - disableAutoPan=true

Do you mean I have build my own pan / zoom control from scratch just
to suppress an annoying feature of the API ? What about other people
who might be using the PolyCluster class library ? If I could get /
set the state of the feature, I could disable / enable it during
dragging / panning / zooming. It is cute but it is an obstacle to
decent performance.

Reply all
Reply to author
Forward
0 new messages