You need to sign in to do that
Don't have an account?

lightning:map on click of address not able to get value
Hi,
I am displaying map in lightning component using lightning:map tag. on click of the address at the left side i am not able to get the address information in javscript controller. Please help me to sort this.


I am displaying map in lightning component using lightning:map tag. on click of the address at the left side i am not able to get the address information in javscript controller. Please help me to sort this.
<lightning:map mapMarkers="{!v.mapMarkers}" zoomLevel="{!v.zoomLevel}" onclick="{!c.onclickofMap}" />
onclickofMap:function(component,event,helper) { // alert('The event is:'+JSON.stringify(event)); // var locationNameVal = event.getParam("v.value"); // var temp = component.find("mapvals").get("v.value"); // var id = event.currentTarget.dataset.id; //it will return thisDiv // var getTargetedButton = component.find(id); //it will return the source button var res = null ; var oTarget = event.target ; if (oTarget.attributes[title] != null) { alert('The oTarget is:' +oTarget); res = oTarget.attributes[title].value; } else { for (var i = 0; i < oTarget.attributes.length; i++) { if (oTarget.attributes[i].name === title) res = oTarget.attributes[i].value; alert('coming here: '+res+'.....'); } } }