Update:
Apparently, this seems to only work if I define a new inline redraw function
within the GEvent.addListener() call.
I was under the impression that it was ok to pass the name of an existing
function to GEvent.addListener, such as.
//define my event handler function first
Function my_click_handler(){.}
//pass my previously defined function to GEvent.addListener()
GEvent.addListener(map,'click',my_click_handler());
Please forgive my ignorance, but is this a 'javascript' thing, or is it
simply by design that GEvent.addListener() can only handle inline function
definitions as arguments? Or, am I simply doing something wrong in the way
Im trying to do this?
My URL is listed below, but for brevity, here's the basic idea.
Var myOverlay = new myCustomOverlay()
GEvent.addListener(map,'moveend',myOverlay.redraw(true));
Shouldn't something like this work? -> attempting to bind the event to the
overlay object's 'redraw()' function.
Need help understanding this.
Thanks,
P.Romero
_____
From: [email protected] [mailto:[email protected]]
Sent: 2009-04-04 12:17 AM
To: [email protected]
Subject: overlay redraw on 'movend/dragend' events...'this.Ch is undefined'
error
Hi,
Here's my url:
http://mexsurf.com/test/maptst1.html
goal:
I want to force a redraw of my custom overlay ONLY on zoom/projection
changes AND/OR after a drag/move has completed.
To achieve this:
In my overlay prototype redraw function, I test the 'force' value and return
if force is false.
I then added an event listener for 'dragend/moveend', but neither worked
(see below).
problem:
Im getting a javascript error
Error: this.Ch is undefined
Source File:
http://maps.google.com/intl/en_ALL/mapfiles/150c/maps2.api/main.js
Line: 367
This occurs at the end of a map drag (also, the 'hand' cursor remains in a
'clenched grip/fist').
you'll see in my code how I went about trying to call my redraw functions.
I tried a couple of different ways, but nothing worked.
Can someone please help me figure out how to get this to work?
Or, is there a better way to go about this? -> force the redraw ONLY at the
end of a drag (in addition to zoom/projection changes).
Please help,
Thanks,
P.Romero
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---