Skip to content

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

Open
@sametcelikbicak

Description

@sametcelikbicak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: google-mapsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions