Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agm-polygon path is not getting updated on changes in component.ts file #2021

Open
sp21 opened this issue Aug 29, 2022 · 0 comments
Open

agm-polygon path is not getting updated on changes in component.ts file #2021

sp21 opened this issue Aug 29, 2022 · 0 comments

Comments

@sp21
Copy link

sp21 commented Aug 29, 2022

agm-polygon path is not getting updated on changes in component.ts file

Steps to reproduce the problem:
Give paths in component.ts file

  1. paths = [
    [{ lat: 51.673858, lng: 7.815982 ,label:"Node1"},
    { lat: 51.373858, lng: 7.215982,label:"Node2" }],[

{ lat: 51.673858, lng: 7.815982, label:"Node2"},
{ lat: 51.723858, lng: 7.895982 ,label:"Node3"},]
]

  1. use agm-polygon in template to bind paths
    <agm-polygon [paths]="paths" [clickable]="false" >

    Current Behavior:
  2. use marker right click or any onclick event to change the paths to the new one
    <agm-marker (markerRightClick)="onRightClickMarker(m)">

paths = [
[{ lat: 31.673858, lng: 5.815982 ,label:"Node1"},
{ lat: 31.373858, lng: 5.215982,label:"Node2" }],[

{ lat: 31.673858, lng: 5.815982, label:"Node2"},
{ lat: 31.723858, lng: 5.895982 ,label:"Node3"},]
]

Even though the paths will change it is not getting updated in the template.
Expected behavior:
The polygon lines should get updated.

angular-google-maps, Angular, & any other relevant dependency versions
agm/core version used: "@agm/core": "^1.0.0",

Stack Blitz Link: https://stackblitz.com/edit/agm-angular-google-map-cedfud?file=app%2Fapp.component.ts,app%2Fapp.component.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant