My favorites | Sign in
Project Logo
             
New issue | Search
for
| Advanced search | Search tips
Issue 73: LabeledMarker click event does not pass thru click coordinates
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Dec 2008
Type-Defect
Priority-Medium
Class-LabeledMarker


Sign in to add a comment
 
Reported by Nekromanter, Oct 27, 2008
What steps will reproduce the problem?
1. Create a labeled marker with a click event listener that uses the 
coordinates given as parameters when called.
2. Click the marker itself
3. Click the label

What is the expected output? What do you see instead?
As you will see, when you press the label no coordinates are given. This 
is, because there are no coordinates sent.



Comment 1 by pamela.fox, Oct 27, 2008
That's true, the event was added  to LabeledMarker before we added support for 
sending latlng in the JS API. Want to fix it and submit a patch? :)
Labels: Class-LabeledMarker
Comment 2 by Nekromanter, Oct 27, 2008
I already created a patch for the file myself in the current project. Should I just 
send you the changes?
Comment 3 by pamela.fox, Oct 28, 2008
You can attach a file (the diff) to this bug.
Comment 4 by bbrala, Nov 03, 2008
Nekro, did you attach the fix? or mail the fix? 
Comment 5 by Nekromanter, Nov 03, 2008
Sorry that it took so long.

Here it is. Let me know if you experience any problems.
difference.patch
1.3 KB   Download
Comment 6 by bbrala, Nov 03, 2008
Thanks for the reply :)
Comment 8 by Nekromanter, Nov 04, 2008
Oh sure, no problem :)
Comment 9 by s-n-usha...@nm.ru, Nov 30, 2008
Hi Nekromanter,

I've got occasionally involved into the discussion of this issue you have reported
(please see
http://groups.google.com/group/google-maps-utility-library/browse_thread/thread/2099a45b76dc6dbe/30c3af970e4f9d6d?hl=en#30c3af970e4f9d6d
).

Pamela asked me if your patch could be incorporated into the new LabeledMarker
version that's now in progress, and frankly I ended in certain hesitation. The
reasons were two:
1) The new event handling/passing mechanism in LabeledMarker that is now more aligned
with standard GEvent handling techniques is slightly different from the one that your
patch is based upon, and I still do not feel enough comfortable with GEvent handling
to refactor your patch.
2) The patch you've submitted suggests (if i'm not mistaken) that the coordinates
supplied for the event are the ones of the mouse click point rather than the
coordinates of the marker itself; so to that extent the marker label is considered
separate from the marker, and the effect of clicking the label is similar to clicking
the underlying map rather than clicking the marker. Is it really what is intended? If
you really need mouse click point coordinates, maybe it would be better to intercept
map events? Or if you prefer to have the marker coordinates then just ask the marker
about them?

Please kindly comment...

Regards,
Sergey

Comment 10 by Nekromanter, Nov 30, 2008
Hi Sergey!

I think you're right. I will look at this tomorrow and try to upload a new patch, 
that uses the markers coordinates.

Sincerely,
Sebastian / Nekromanter
Comment 11 by s-n-usha...@nm.ru, Dec 02, 2008
Hi Sebastian,

I just thought that development svn repository has limited availability, so please
find attached a copy of current development version of the code - just to be on the
safe side...

Regards,
Sergey


labeledmarker.js
9.6 KB   Download
Comment 12 by Nekromanter, Dec 02, 2008
Hi Sergey,

the change was really simple, I just had to add a call to this.getLatLng(). See the 
attached JS file for the solution.
labeledmarker.js
9.6 KB   Download
Comment 13 by s-n-usha...@nm.ru, Dec 02, 2008
Thanks Sebastian, great!

Please watch the continuation in the story about label visibility :)
Comment 14 by Nekromanter, Dec 03, 2008
No problem ;)

I will!
Comment 15 by pamela.fox, Dec 26, 2008
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Hosted by Google Code