Skip to content

Instantly share code, notes, and snippets.

View timdeschryver's full-sized avatar
👟

Tim Deschryver timdeschryver

👟
View GitHub Profile
export class AppComponent implements OnInit {
@ViewChild(MapInfoWindow, { static: false }) infoWindow: MapInfoWindow
infoContent = ''
openInfo(marker: MapMarker, content) {
this.infoContent = content
this.infoWindow.open(marker)
}
}
<map-info-window>{{ infoContent }}</map-info-window>
Property Description
close Closes this InfoWindow by removing it from the DOM structure
getContent Returns the content of the InfoWindow
getPosition Returns the position of the InfoWindow
getZIndex Returns the z-index of the InfoWindow
Property Description
close Closes this InfoWindow by removing it from the DOM structure
getContent Returns the content of the InfoWindow
getPosition Returns the position of the InfoWindow
getZIndex Returns the z-index of the InfoWindow
Property JavaScript API Method Description
closeclick closeclick This event is fired when the close button was clicked
contentChanged content_changed This event is fired when the content property changes
domready domready This event is fired when the <div> containing the InfoWindow's content is attached to the DOM
positionChanged position_changed This event is fired when the position property changes
zindexChanged zindex_changed This event is fired when the InfoWindow's zIndex changes
Property Description
options Sets the options, for more info see the docs
export class AppComponent implements OnInit {
@ViewChild(MapInfoWindow, { static: false }) infoWindow: MapInfoWindow
openInfo(marker: MapMarker, content) {
this.infoWindow.open(marker)
}
}
<map-marker
#markerElem
*ngFor="let marker of markers"
[position]="marker.position"
[label]="marker.label"
[title]="marker.title"
[options]="marker.options"
(mapClick)="openInfo(markerElem)"
>
</map-marker>
<map-info-window>Hello Google Maps</map-info-window>
Property JavaScript API Method Description
animationChanged animation_changed This event is fired when the marker's animation property changes
mapClick click This event is fired when the marker icon was clicked
clickableChanged clickable_changed This event is fired when the marker's cursor property changes
cursorChanged cursor_changed This event is fired when the marker's cursor property changes
mapDblclick dblclick This event is fired when the marker icon was double clicked
mapDrag drag This event is repeatedly fired while the user drags the marker
mapDragend dragend This event is fired when