Rob Angelier
Rob Angelier

Reputation: 2333

How to render info window content dynamically

I'm using the agm-direction package to display route information on the agm-map (https://www.npmjs.com/package/agm-direction).

I would like to know how I can render the content of the infowindow for especially the origin marker:

marker options

the output looks like this:

info window output

I would like to do something like this, so I can build a more complex infowindow:

enter image description here

enter image description here

Upvotes: 0

Views: 922

Answers (2)

Expert Suggestion
Expert Suggestion

Reputation: 401

using agm-info-window you can put your dynamic text into agm-info-window

 <agm-map [latitude]="lat" [longitude]="lng">

      <agm-marker [latitude]="lat" [longitude]="lng">

        <agm-info-window>
          <h3><strong>Howdy!</strong></h3>
          <p>You are here!</p>
        </agm-info-window>

      </agm-marker>

    </agm-map>

Upvotes: 2

Incognita
Incognita

Reputation: 99

Infowindow is string, so if you want to process your variables than write it within `` See Below example

`<h1>${vehicles[0].name}</h1>`

Upvotes: 0

Related Questions