[Google Maps API v3] Re: rightclick event inside a circle

2012-01-20 Thread Nianwei Liu
The Circle class has a rightclick event and returns mouseevent with
latLng. If that's not working then it's a good candidate for firing a
bug report.


On Jan 19, 6:51 am, Eduardo duduweil...@gmail.com wrote:
 Martin: it doesn't work
 Rossko: it doesn't work too

 I tried the mousemove event, but it did not get the position of the
 movements within the circle, it always shows the menu in the last position
 of the mouse over the map (ie, at the edge of the circle)

 the same thing to rightclick events: the map does not receive the events
 that were triggered by a click or rightclick inside the circle.

-- 
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-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: rightclick event inside a circle

2012-01-20 Thread Eduardo
no, you misunderstood. this is the only thing that is working. but with 
that i can't get the mouse position, but with the rightclick event on the 
map this property is already defined in the mouse event
*
**event.pixel.x* and *event.pixel.y*

these properties could be defined in all the click events

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/zztywa1AIFsJ.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: rightclick event inside a circle

2012-01-20 Thread Rossko
 no, you misunderstood. this is the only thing that is working. but with
 that i can't get the mouse position, but with the rightclick event on the
 map this property is already defined in the mouse event
 *
 **event.pixel.x* and *event.pixel.y*

That's not documented.  It might stop working in future releases.

Both map and circle are documented to return MouseEvent objects on a
rightclick, which contain a LatLng like the man said
http://code.google.com/apis/maps/documentation/javascript/reference.html#MouseEvent

If you must have pixels, you can convert a LatLng using
http://code.google.com/apis/maps/documentation/javascript/reference.html#MapCanvasProjection

If you want to raise an enhancement request to change the behaviour,
you could use the issues list
http://code.google.com/p/gmaps-api-issues/

-- 
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-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: rightclick event inside a circle

2012-01-19 Thread Rossko
Maybe circumvent the problem - only listen for map right-clicks; when
you get one, check to see if it is within your circle(s). The maths
for that should be easy, testing if the click is less than 'radius'
distance from 'centre(s)'.

-- 
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-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: rightclick event inside a circle

2012-01-19 Thread Eduardo
Martin: it doesn't work
Rossko: it doesn't work too

I tried the mousemove event, but it did not get the position of the 
movements within the circle, it always shows the menu in the last position 
of the mouse over the map (ie, at the edge of the circle)

the same thing to rightclick events: the map does not receive the events 
that were triggered by a click or rightclick inside the circle.

-- 
You received this message because you are subscribed to the Google Groups 
Google Maps JavaScript API v3 group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/MCCI6ygDQxsJ.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



Re: [Google Maps API v3] Re: rightclick event inside a circle

2012-01-19 Thread Andrew Leach
On 19 January 2012 11:51, Eduardo duduweil...@gmail.com wrote:
 Martin: it doesn't work
 Rossko: it doesn't work too

 I tried the mousemove event, but it did not get the position of the
 movements within the circle, it always shows the menu in the last position
 of the mouse over the map (ie, at the edge of the circle)

Did you add the mousemove listener to the circle as well as the map?

 the same thing to rightclick events: the map does not receive the events
 that were triggered by a click or rightclick inside the circle.

This is why a link to the map really is needed. We need to see what
you have and try it (and debug it) for ourselves.

-- 
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-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.



[Google Maps API v3] Re: rightclick event inside a circle

2012-01-18 Thread Martin™
Hi.

Could you add an API event listener for the Map 'mousemove' event:

http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

google.maps.event.addListener(myMap, 'mousemove', function(mouseEvent)
{
 lastMousePosition=mouseEvent.latLng;
});

lastMousePosition would have to be defined as a global variable in
your code.

Then add a DOM event listener for the mouse right click event.

Whenever the DOM event is triggered you will have the last mouse
position available.

Or does the API 'consume' the right click event so it will not
propogate to your DOM listener?

Martin.


On Jan 18, 12:58 pm, Eduardo duduweil...@gmail.com wrote:
 hello,

 i am working in a system and I need to create a custom context menu when
 the user right click *inside* a circle. i have noticed that a right click
 on the map triggers an event with the XY position defined, and then I can
 create a menu for the map. But when the rightclick is inside a circle, the
 event doesn't have the XY position, and I can't show the menu at the right
 position!!

 anyone knows how to get the screen XY position when the click event is
 triggered?!

-- 
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-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.