agm-overlays icon indicating copy to clipboard operation
agm-overlays copied to clipboard

Event with change z-index not firing

Open Merglodov opened this issue 7 years ago • 10 comments

Could you please add z-index update in onChangesOverride method?

Merglodov avatar Aug 29 '18 06:08 Merglodov

I think you got the wrong package for this request. The code you seek already exists in the map package, I’m just html overlay package.

Code you seek: https://github.com/SebastianM/angular-google-maps/blob/master/packages/core/directives/map.ts#L312

AckerApple avatar Aug 29 '18 11:08 AckerApple

I see I have a zIndex input binding but it’s only read and never changes: https://github.com/AckerApple/agm-overlays/blob/master/src/AgmOverlay.component.ts#L29

AckerApple avatar Aug 29 '18 11:08 AckerApple

Yes, you right you have a binding without changes and z-index not changes dynamically

For example, I change z-index on pin hover, and if I use agm-marker everything is ok.

What do you think about update onChangesOverride like bellow?

   onChangesOverride( changes ){
    if( (changes.latitude || changes.longitude  || changes. zIndex) ){
      this.overlayView.latitude = this.latitude;
      this.overlayView.longitude = this.longitude;
      this.overlayView.zIndex = this.zIndex;

      this._markerManager.deleteMarker(<any>this.overlayView)
      .then(()=>this.load())
    }
  }

Merglodov avatar Aug 29 '18 11:08 Merglodov

OHHHH OK, now I get it. Details help.

Issue a pull request and I’ll merge that code in

AckerApple avatar Aug 29 '18 12:08 AckerApple

I have to run the build process and publish now

AckerApple avatar Aug 29 '18 13:08 AckerApple

Get version 1.2.0

I updated all dependencies including Angular

Close this issue when satisfied

AckerApple avatar Aug 29 '18 13:08 AckerApple

Many thanks!

Merglodov avatar Aug 29 '18 14:08 Merglodov

Hi @AckerApple !

Sorry for interrupting, but it looks like that code I have added has broken changes for InfoWindow.

When z-index changes event occurs related marker delete and as result Info Window hidden.

Perhaps it's better to cancel the changes until the right solution is ready?

I'm really sorry about the incorrect solution I have added.

Merglodov avatar Sep 04 '18 08:09 Merglodov

Understood. I don’t have time to investigate right now. I also don’t like the info-window and don’t use it. Nor do I change zIndex in my markers.

So either you can issue a fix, wait for someone else to complain, or wait till it effect me and I will change

AckerApple avatar Sep 04 '18 11:09 AckerApple

Repopened until we figure what to do

AckerApple avatar Sep 04 '18 11:09 AckerApple