Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7564457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:54:33+00:00 2026-05-30T13:54:33+00:00

This page describes The Default Control Set for Google Maps V3 API: http://code.google.com/apis/maps/documentation/javascript/controls.html#DefaultUI I

  • 0

This page describes The Default Control Set for Google Maps V3 API: http://code.google.com/apis/maps/documentation/javascript/controls.html#DefaultUI

I am interested in taking over PanControl’s click event and bind it to my custom function.

For example, when user clicks on Pan Left (Up/Right/Down) UI control, not only map’s viewport changes, but also function A is called.

As I imagine, one way of doing this, would be to listen to Map’s click event and check it’s target?

Any suggestions/examples (particularly helpful) on how this can be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:54:34+00:00Added an answer on May 30, 2026 at 1:54 pm

    Your assumption (listen to Map’s click event and check it’s target) sounds correct, as there is no implementation for accessing the controls .

    This works for me(now):

    google.maps.event.addDomListener(map.getDiv(),'click', 
                 function(e) 
                 {
                    var t=e.target,
                        a=[null,'left','right','up','down'];
    
                    if(
                        t.parentNode.parentNode.hasAttribute('controlwidth')
                          &&
                        t.parentNode.childNodes.length==5
                          &&
                        t.parentNode.firstChild.tagName=='IMG'
                          &&
                        t.parentNode.firstChild.src
                             =="http://maps.gstatic.com/mapfiles/mapcontrols3d7.png"
                      )
                      {
                        for(var i=1;i<t.parentNode.childNodes.length;++i)
                        {
                          if(t.parentNode.childNodes[i]==t)
                          {
                            alert('You\'ve clicked on \n>>>'+a[i]+
                                  '\nyou may call a function now.');
                          }
                        }
                      }
                 });
    

    http://jsfiddle.net/doktormolle/fwgMy/

    But it only works until Google will modify the markup, and this may be tomorrow.

    A better approach would be to hide the pan-control and create your own control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in this page http://api.jquery.com/category/effects/ when you put 'up'(keyboard) and 'down',then put 'enter',it will go
This page from Adobe says to add a wmode parameter and set its value
This page in the Android documentation defines an element id as follows: <TextView android:id=@+id/label
Consider this page @ http://www.bloodbone.ws/screwed.html I need to be able to have the a.grow
This page describes how to override the drawHighlightIndicator/drawSelectionIndicators methods for the header of a
This page describes an 'IN' operator that can be used in GAE Datastore to
In a code i have seen this creation of token for a login page:
I found this tutorial http://sqllessons.com/categories.html and I want to use the described method as
So, as described on this msdn page , when you define a Connection String
This page mentions how to trunc a timestamp to minutes/hours/etc. in Oracle. How would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.