SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)

    Google Maps - Get Mouse Position

    Hello everyone,

    I have problem that should be stupidly simple... but I seem to be a extra stupid. =p

    Basically I'm implementing the Google Maps API (v3). I've set up an event so when it's right-clicked, a context menu pops up.

    Now, the problem: I want to get the x/y of the mouse (so I can center the context menu). However, Google seems to have stripped this out of the MouseEvent which they send (no pageX/pageY).

    So, how can I get the mouse position? (Not the LatLng, that's easy. =p)

    Thanks.

  2. #2
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    basically Google provides us the facility to create a Google map mouse position means we can target a specific location for our business on google map.
    Last edited by DaveMaxwell; Mar 3, 2011 at 11:50. Reason: removed fake sig

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    Ah, answered my own question. It seems there is a pixel object, which is a point that has an x and y property which has the mouse X and Y. Doesn't look to be documented anywhere, but it's there.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •