javascript - Adding onclick to Polygon Location Label in Google Maps v3 -


i have following code initialize polygon onclick listener displays alert:

polygon.location = location;  polygon.locationlabel = new locationlabel(location, latlng, mapprovider.map);   google.maps.event.addlistener(polygon, 'click', function(e) {             alert('hello');  }); 

this fine, displays alert when click polygon not actual label. how add listener alert displayed when label clicked?

try :

 texttoshow = polygon.locationlabel;  google.maps.event.addlistener(polygon, 'click', function(e, texttoshow) {        alert(texttoshow);  }); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -