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 4088636
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:00:30+00:00 2026-05-20T19:00:30+00:00

How can i setup a callback function for a click event on a pin?

  • 0

How can i setup a callback function for a click event on a pin?
I need both pins the green one (one location) and the red one (clustered locations).
I’m using the v6 api.

That’s the code so far:

var shape = new VEShape(VEShapeType.Pushpin, new VELatLong(pin.position.lat, pin.position.lng));
shape.SetTitle('<h2>'+pin.overlay.headline+'</h2>');
shape.SetDescription('<p>'+pin.overlay.text+'</p>');

var pinIcon = new VECustomIconSpecification();
pinIcon.Image = '/images/map/pin.png';
pinIcon.TextContent = '.';
shape.SetCustomIcon(pinIcon);
  • 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-20T19:00:30+00:00Added an answer on May 20, 2026 at 7:00 pm

    The correct way to do this is to override the onclick and onmouseover
    functions within VEMap.AttachEvent(); AttachEvent has many return values
    useful in identifying which pin you click/mouseover, such as the pinID (elementID return value for the VEMap.onclick() method).

    You can use the ID in combination with map.ShowInfoBox(), and map.GetShapeByID to
    show your infobox upon click.

    READ: VEMap.AttachEvent <– Google that, I’d paste the URL but I need more rep on StackOverflow

    READ: VEMap.onclick. Also, Understand the return values:

    READ All mouse events
    http://msdn.microsoft.com/en-us/library/bb412438.aspx

    /*************************************
     * Code snippets..
     * For example purposes I'm going to do 
     * things a bit out of order.
    *************************************/
    
    // Attach your events in the map load callback:
    map.AttachEvent("onmouseover", myFnForMouseOver);
    map.AttachEvent("onclick", myFnForOnClick);
    
    
    // Callback functions used in the AttachEvent(s) above..
    function myFnForMouseOver(e){
        if(e.elementID){
            return true; // Disables the rollover ShowInfoBox()
        }
    }
    
    function myFnForOnClick(e){
        if(e.elementID){
            // Show infobox using the PINs/Shapes actual ID, (return value from e.elementID)
            map.ShowInfoBox(map.GetShapeByID(e.elementID)); 
            return true;
        }
    }
    
    /*
     * end 
     */
    

    Thats it

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

Sidebar

Related Questions

Can you setup a variable for javascript in one page and have another page
I can setup a connection manager that uses the Directory Services OLE provider and
I'm trying to follow the instructions here ( http://docs.pylonsproject.org/projects/pyramid_beaker/en/latest/ ) so I can setup
Can I setup a Dictionary of MyDict<Type, BlockingCollection<differentTypes> possibly through an interface that circumvents
Can't setup Octopress blog on Github. I'm following this guide on octopress but after
Can I setup Team Foundation Server in such a manner that every uer have
How can i setup ACL with class-field-scope in sonata admin bundle Setting up the
How can I setup expires headers in PHP + Apache? I'm currently using an
How can I setup custom sorting method for a QTableView , or for the
If a UILabel contains too much text, how can I setup my label so

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.