0

I am trying to load a Google map VF page in my lightning component and display leads based on city searched. The component loads properly with the leads on first search but on the second search the component doesn't refreshes and displays old records

Here's the piece of code-

<aura:if isTrue="{!and(v.lead.length > 0, v.acc.length == 0) }">
   <c:GoogleMap id="GoogleMap" lat="{!v.lat}"  long="{!v.long}" mapOptions="{!v.mapOptions}" mapOptionsCenter="{!v.mapOptionsCenter}" mapData="{!v.mapData}" />
 </aura:if>

Attribute holding the search string i.e Place-

<aura:attribute name="place" type="String"/>

Is it because the lead.length > 0 is true in second case as well so the component doesn't reloads. How should I achieve this then. Appreciate any help here! Thanks

  • any reason why you are not using the lightning:map component? – glls Jan 22 at 1:26
  • I don't think there is enough code context here to provide an answer. Please show how the search is initiated. – David Reed Jan 22 at 1:31
  • If the condition always evaluates to true, the contents within aura:if will not be re-rendered. – Jayant Das Jan 22 at 1:34
  • @glls- Lightning:map is just for displaying records. I want more customisations. e.g actions on the map marker, a search bar on map to search places etc – SFDCLearner Jan 22 at 1:36
  • @JayantDas- How can I render the same component with different values then – SFDCLearner Jan 22 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.