AckerApple / agm-overlays

Custom marker overlay for the @agm/core package
MIT License
25 stars 24 forks source link

Event with change z-index not firing #12

Open Merglodov opened 6 years ago

Merglodov commented 6 years ago

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

AckerApple commented 6 years ago

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 commented 6 years ago

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

Merglodov commented 6 years ago

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())
    }
  }
AckerApple commented 6 years ago

OHHHH OK, now I get it. Details help.

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

AckerApple commented 6 years ago

I have to run the build process and publish now

AckerApple commented 6 years ago

Get version 1.2.0

I updated all dependencies including Angular

Close this issue when satisfied

Merglodov commented 6 years ago

Many thanks!

Merglodov commented 6 years ago

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.

AckerApple commented 6 years ago

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 commented 6 years ago

Repopened until we figure what to do