How to styling agm-marker-label - max-width for set text to center ? I can change label position but can't set min-width for centralization label name.
<agm-marker *ngIf="school.lat && school.lng"
[iconUrl]="{url: school.mapMarker, scaledSize: {height: 75,width: 48},labelOrigin:{x:70,y:20}}"
[label]="{text:school.schoolName}"
[longitude]="school.lng | parseFloat"
[latitude]="school.lat | parseFloat">
</agm-marker>
The title of the marker. All markers are displayed on the map in order of their zIndex, with higher values displaying in front of markers with lower values. By default, markers are displayed according to their vertical position on screen, with lower markers appearing in front of markers further up the screen.
AgmInfoWindow renders a info window inside a AgmMarker or standalone. Disable auto-pan on open. By default, the info window will pan the map so that it is fully visible when it opens. Sets the open state for the InfoWindow. You can also call the open () and close () methods.
Which animation to play when marker is added to a map. This can be 'BOUNCE' or 'DROP' Icon (the URL of the image) for the foreground. The label (a single uppercase character) for the marker. The latitude position of the marker. The longitude position of the marker. If true, the marker can be clicked. Default value is true.
using 2 [label] attributes didn't work for me. Instead the following worked:
<agm-marker
*ngFor="let sp of mySPlist"
[latitude]="sp.geoLat" [longitude]="sp.geoLon"
[iconUrl]="sp.icon"
[label]="{color: 'white', text: sp.name}"
>
</agm-marker>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With