angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.39k stars 6.76k forks source link

feat(google-maps): Add support for polygonPathsChange event #26303

Open sametcelikbicak opened 1 year ago

sametcelikbicak commented 1 year ago

Feature Description

Hi, old AGM - Angular Google Maps has polygon paths change event and it is so useful. Now I'm converting my components from AGM to google-maps component but it does not support polygon paths change event. It would be great if this component support polygon paths change event like old agm component.

https://github.com/sebholstein/angular-google-maps/blob/340e3e35b60169b901842d0ca71c13944ad7fd2c/packages/core/src/lib/directives/polygon.ts#L197

My old implementation

<agm-map
    [latitude]="latitude"
    [longitude]="longitude"
    (mapReady)="onMapReady($event)"
>
    <agm-polygon
        *ngFor="let shape of shapes"
        [paths]="shape.paths"
        [strokeColor]="getColor(shape)"
        [strokeWeight]="shape.zIndex === 1 ? 3 : 1"
        [fillColor]="getColor(shape)"
        [fillOpacity]="getOpacity(shape)"
        [editable]="shape.editable"
        [zIndex]="shape.zIndex"
        (polyMouseOver)="polyMouseOver($event, shape.shapeName)"
        (polyMouseOut)="polyMouseOut()"
        (polyClick)="polyClick($event, shape)"
        (polyPathsChange)="polyPathsChange($event)"
        (polyRightClick)="polyRightClick($event, shape)"
    >
    </agm-polygon>
</agm-map>

New implementation with google-map

<google-map
    [options]="mapOptions"
    (mapInitialized)="onMapReady($event)"
    (mouseout)="onMapMouseOut()"
>
    <map-polygon
        *ngFor="let shape of shapes"
        [paths]="shape.paths"
        [options]="{
            strokeColor: getColor(shape),
            strokeWeight: shape.zIndex === 1 ? 3 : 1,
            fillColor: getColor(shape),
            fillOpacity: getOpacity(shape),
            zIndex: shape.zIndex,
            editable: shape.editable
        }"
        (polygonMouseover)="polyMouseOver($event, shape.shapeName)"
        (polygonMouseout)="polyMouseOut()"
        (polygonClick)="polyClick($event, shape)"
        (polygonRightclick)="polyRightClick($event, shape)"
    >
    </map-polygon>
</google-map>

Use Case

In my use case I control intersection and cover functionality with old component polyPathsChange event, now I can't control them with efficient way so it is super powerful and helpful feature to be when google-map support polygonPathsChange event itself as old component support.

FatihBukusoglu commented 1 year ago

Also having similar issue with transitioning from AGM. Some events from AGM are not supported by google-maps component.

efeaktas commented 1 year ago

I have also same problem. Please, make it supported.