Open elgibor-solution opened 1 year ago
Hi,
Can help advice how to set marker info window content on Angular?
Below is code that i try but not working
component.html <MapView [lat]="dd.lat" [lng]="dd.lng" [zoom]="dd.zoom" (ready)="onMapReady($event)" (markerTap)="onMarkerSelect($event)" (markerInfoWindow)="initInfoWindow($event)" (markerInfoContents)="initInfoWindow($event)" (infoWindowTap)="onInfoWindowSelect($event)"></MapView>
<MapView [lat]="dd.lat" [lng]="dd.lng" [zoom]="dd.zoom" (ready)="onMapReady($event)" (markerTap)="onMarkerSelect($event)" (markerInfoWindow)="initInfoWindow($event)" (markerInfoContents)="initInfoWindow($event)" (infoWindowTap)="onInfoWindowSelect($event)"></MapView>
component.ts initInfoWindow(args) { const info = new StackLayout(); info.width = 100; info.height = 100; info.backgroundColor = 'white'; const image = new Image(); image.src = 'https://camo.githubusercontent.com/3bd307204ac6237963e0448c00800a9df08f245d9e78fbbeb4191e625c834286/68747470733a2f2f64316c66797a356b7774387675392e636c6f756466726f6e742e6e65742f6e61746976657363726970742d6c6f676f2d323032312e706e67'; info.addChild(image); const text = new Label(); text.text = "Custom Info Window"; info.addChild(text); args.view = info; }
initInfoWindow(args) { const info = new StackLayout(); info.width = 100; info.height = 100; info.backgroundColor = 'white'; const image = new Image(); image.src = 'https://camo.githubusercontent.com/3bd307204ac6237963e0448c00800a9df08f245d9e78fbbeb4191e625c834286/68747470733a2f2f64316c66797a356b7774387675392e636c6f756466726f6e742e6e65742f6e61746976657363726970742d6c6f676f2d323032312e706e67'; info.addChild(image); const text = new Label(); text.text = "Custom Info Window"; info.addChild(text); args.view = info; }
Hi,
Can help advice how to set marker info window content on Angular?
Below is code that i try but not working
component.html
<MapView [lat]="dd.lat" [lng]="dd.lng" [zoom]="dd.zoom" (ready)="onMapReady($event)" (markerTap)="onMarkerSelect($event)" (markerInfoWindow)="initInfoWindow($event)" (markerInfoContents)="initInfoWindow($event)" (infoWindowTap)="onInfoWindowSelect($event)"></MapView>
component.ts
initInfoWindow(args) { const info = new StackLayout(); info.width = 100; info.height = 100; info.backgroundColor = 'white'; const image = new Image(); image.src = 'https://camo.githubusercontent.com/3bd307204ac6237963e0448c00800a9df08f245d9e78fbbeb4191e625c834286/68747470733a2f2f64316c66797a356b7774387675392e636c6f756466726f6e742e6e65742f6e61746976657363726970742d6c6f676f2d323032312e706e67'; info.addChild(image); const text = new Label(); text.text = "Custom Info Window"; info.addChild(text); args.view = info; }