Closed quadband closed 6 years ago
I modified the following and resolved my issue:
onChangesOverride( changes ){
if( (changes.latitude || changes.longitude) ){
this.overlayView.latitude = this.latitude;
this.overlayView.longitude = this.longitude;
this.overlayView.draw()
}
}
this.overlayView.draw = function(){
if ( !this.div ) {
this.div = elm
this.getPanes().overlayImage.appendChild( elm )
}
let latlngnew = new google.maps.LatLng(this.latitude,this.longitude)
const point = this.getProjection().fromLatLngToDivPixel( latlngnew )
if (point) {
elm.style.left = (point.x - 10) + 'px'
elm.style.top = (point.y - 20) + 'px'
}
}
I’ll check it out tomorrow
@quadband you can now download 1.1.2. The issue should be fixed now Also, the demo page has parameters where you can update the overlays.
I will be closing this issue in the near future if no further comments
Thanks much!
This issue re-appeared, at least on the 1.3.0 release. When switching to 1.1.2 (as suggested above) the repositioning works.
Confirmed. Demo seems to still update marker position however an error is thrown in console.
The initial rendering of the overlay works fine, but when I update the lat/lng of the marker it does not update.
I went digging in the source and found a few issues. Imports not being used : Subscription, EventEmitter, TemplateRef, QueryList, AgmInfoWindow, LatLngBounds, LatLng, AgmMarker, GoogleMap
Are these still necessary?
Additionally, you are not importing AfterViewInit, OnChanges, or OnDestroy from @angular/core
I'm not seeing a call to MarkerManager.updateMarkerPosition
Within overlayView.draw your point will never change as it can never obtain a new lat/lng from the variable latlng as it is defined up above.
I'm wondering if there were some breaking changes made upstream.
I am using Angular 6 and the latest release of AGM.