right click map event

1,669 views
Skip to first unread message

d.bun

unread,
Dec 6, 2009, 1:54:39 AM12/6/09
to Google Maps JavaScript API v3
This is what it says in the reference about map 'rightclick' events.
"MouseEvent | This event is fired when the DOM contextmenu event is
fired on the map container."
I've tried to capture right clicks on the map by:
google.maps.event.addListener(map,'rightclick',function(){...})
It doesn't seem to do anything.
So I'm curious what the reference means and how to capture right-
clicks.
I would like to build a custom right click menu - which might be a
contextmenu the reference refers to.

d.bun

unread,
Dec 6, 2009, 2:11:00 AM12/6/09
to Google Maps JavaScript API v3
I accidently found out that the right click works on infowindows.

d.bun

unread,
Dec 6, 2009, 2:45:32 AM12/6/09
to Google Maps JavaScript API v3

Esa

unread,
Dec 6, 2009, 10:26:47 AM12/6/09
to Google Maps JavaScript API v3
Sounds like a browser specific issue. What is your browser.

I can get 'rightclick' on map with the most usual XP browsers.
http://koti.mbnet.fi/ojalesa/v3/v3events.htm

bratliff

unread,
Dec 6, 2009, 2:55:00 PM12/6/09
to Google Maps JavaScript API v3
On Dec 6, 3:26 pm, Esa <esa.ilm...@gmail.com> wrote:
> Sounds like a browser specific issue. What is your browser.
>
> I can get 'rightclick' on map with the most usual XP browsers.http://koti.mbnet.fi/ojalesa/v3/v3events.htm

Right click works fine but Left click does not on my PC due to a
disabled clock. Google added support for iPhone "touch" events in
version 2.122. It attempts to distinguish a "long" touch from a
"short" touch. Well, I am not using an iPhone, I am using a standard
browser. Touch events are as meaningless to me as "mousemove" events
are to an iPhone user.

Google, PLEASE fix your click event handler for browsers other than
the iPhone. If you detect a standard browser, a "click" event is not
a "touch" event. It ought to be use a normal "click" event handler.

It was reported a year ago. It is still not working.

Ben Appleton

unread,
Dec 6, 2009, 4:57:40 PM12/6/09
to google-map...@googlegroups.com
This post doesn't seem to relate to the original question.

On Mon, Dec 7, 2009 at 6:55 AM, bratliff <brat...@umich.edu> wrote:
> On Dec 6, 3:26 pm, Esa <esa.ilm...@gmail.com> wrote:
>> Sounds like a browser specific issue. What is your browser.
>>
>> I can get 'rightclick' on map with the most usual XP browsers.http://koti.mbnet.fi/ojalesa/v3/v3events.htm
>
> Right click works fine but Left click does not on my PC due to a
> disabled clock.  Google added support for iPhone "touch" events in
> version 2.122.  It attempts to distinguish a "long" touch from a
> "short" touch.  Well, I am not using an iPhone, I am using a standard
> browser.  Touch events are as meaningless to me as "mousemove" events
> are to an iPhone user.

I suggest you enable your clock. There will always be corner-cases
where weird configuration breaks expected behavior.

> Google, PLEASE fix your click event handler for browsers other than
> the iPhone.  If you detect a standard browser, a "click" event is not
> a "touch" event.  It ought to be use a normal "click" event handler.
>
> It was reported a year ago.  It is still not working.

Maps API v3 launched in May this year, ie. half a year ago. Are you
referring to Maps API v2?

> --
>
> 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.
>
>
>

d.bun

unread,
Dec 7, 2009, 4:46:28 PM12/7/09
to Google Maps JavaScript API v3
I'm on an old fat mac os x powerpc, and tried on firefox, safari, and
now I'm using Camino because of the speed. Rightclick doesn't work on
any of them, interesting though, didn't know it was a problem with the
browser or system.

bratliff

unread,
Dec 13, 2009, 8:46:14 AM12/13/09
to Google Maps JavaScript API v3
On Dec 6, 9:57 pm, Ben Appleton <apple...@google.com> wrote:
> > Right click works fine but Left click does not on my PC due to a
> > disabled clock. Google added support for iPhone "touch" events in
> > version 2.122. It attempts to distinguish a "long" touch from a
> > "short" touch. Well, I am not using an iPhone, I am using a standard
> > browser. Touch events are as meaningless to me as "mousemove" events
> > are to an iPhone user.
>
> I suggest you enable your clock.

Sorry - not just for one web site. Every other web site (not using
the API) on the planet handles "click" events properly without timing
dependencies. For non-iPhone browsers, a "click" is a "click", not a
"touch". It is neither a "long click" nor a "short click" but simply
a "click". Your "double click" works properly. Your "right click"
works properly. I can work around it in my own applications but I
cannot change other web sites using the API.

> > Google, PLEASE fix your click event handler for browsers other than
> > the iPhone. If you detect a standard browser, a "click" event is not
> > a "touch" event. It ought to be use a normal "click" event handler.
>
> > It was reported a year ago. It is still not working.
>
> Maps API v3 launched in May this year, ie. half a year ago. Are you
> referring to Maps API v2?

Yes. 2.121 worked properly. 2.122 broke it.

Esa

unread,
Dec 13, 2009, 10:57:25 AM12/13/09
to Google Maps JavaScript API v3
I didn't know that any timer used in 'click'. To me it seems that
'click' is derived from 'mouseup' sensing if mouse was moved between
'mousedown' and 'mouseup'.

If you keep mouse down for any length of time, you will get a 'click'
at 'mouseup' time. But if you drag map or a draggable marker, no
'click' is triggered. However 'click' on a polygon is triggered even
if you drag between 'mousedown' and 'mouseup'. That might be
considered as a bug. If you try to drag the map inside a polygon, you
will always trigger a 'click' on the polygon.

Ben Appleton

unread,
Dec 13, 2009, 4:46:10 PM12/13/09
to google-map...@googlegroups.com
On Mon, Dec 14, 2009 at 2:57 AM, Esa <esa.i...@gmail.com> wrote:
> I didn't know that any timer used in 'click'. To me it seems that
> 'click' is derived from 'mouseup' sensing if mouse was moved between
> 'mousedown' and 'mouseup'.
>
> If you keep mouse down for any length of time, you will get a 'click'
> at 'mouseup' time. But if you drag map or a draggable marker, no
> 'click' is triggered. However 'click' on a polygon is triggered even
> if you drag between 'mousedown' and 'mouseup'. That might be
> considered as a bug.

Confirmed, that is a bug we intend to fix.

> If you try to drag the map inside a polygon, you
> will always trigger a 'click' on the polygon.
>

bratliff

unread,
Dec 13, 2009, 6:05:04 PM12/13/09
to Google Maps JavaScript API v3
On Dec 13, 9:46 pm, Ben Appleton <apple...@google.com> wrote:
> Confirmed, that is a bug we intend to fix.

Any chance my issue might be addressed ?

I am using documented function calls:

#include <windows.h>

void main(void)
{
HANDLE hTok;
TOKEN_PRIVILEGES tp;
LUID luid;
SYSTEMTIME SysT;
DWORD step;
DWORD tick;
BOOL bool;

OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES
+TOKEN_QUERY,&hTok);

LookupPrivilegeValue(NULL,"SeSystemTimePrivilege",&luid);

tp.PrivilegeCount=1;
tp.Privileges[0].Luid=luid;
tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;

AdjustTokenPrivileges(hTok,FALSE,&tp,0,NULL,NULL);

GetSystemTimeAdjustment(&step,&tick,&bool);

SetSystemTimeAdjustment(0,0);

GetSystemTime(&SysT);

SysT.wYear=2010;
SysT.wMonth=1;
SysT.wDayOfWeek=1;
SysT.wDay=1;
SysT.wHour=0;
SysT.wMinute=0;
SysT.wSecond=0;
SysT.wMilliseconds=0;

SetSystemTime(&SysT);

AdjustTokenPrivileges(hTok,TRUE,&tp,0,NULL,NULL);
}

to deal with an erratic time of day clock. The interval timer still
ticks but the time of day clock is frozen.

Ben Appleton

unread,
Dec 13, 2009, 6:12:46 PM12/13/09
to google-map...@googlegroups.com
On Mon, Dec 14, 2009 at 10:05 AM, bratliff <brat...@umich.edu> wrote:
On Dec 13, 9:46 pm, Ben Appleton <apple...@google.com> wrote:
> Confirmed, that is a bug we intend to fix.

Any chance my issue might be addressed ?

I was not talking about browsers whose users have disabled the clock.
 
Reply all
Reply to author
Forward
0 new messages