angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

AGM cluster image change

Open silpa-kanthan opened this issue 8 years ago • 7 comments

I m using AGM map. I can able to change the cluster image. But I want to change cluster image dynamically. I have four buttons. For each button I have different colour images. Need to show the image based on the button click.

silpa-kanthan avatar Dec 11 '17 05:12 silpa-kanthan

@silpa-kanthan could you please provide an example, to make clear what isn't working how it should work?

jigfox avatar Dec 17 '17 19:12 jigfox

@jigfox sorry for the late reply

silpa-kanthan avatar Dec 19 '17 10:12 silpa-kanthan

<agm-map #gm
  [streetViewControl]="true"
  [zoom]="zoomValue"
  style="height: 82vh; background-position: 50% 50%"
  [latitude]="mainLatitude"
  [longitude]="mainLongitude"
>
  <agm-marker-cluster  imagePath="assets/images/{{category}}/m">
    <agm-marker
      *ngFor="let marker of mapList"
      [latitude]="marker.Latitude"
      [longitude]="marker.Longitude"
      [iconUrl]="'assets/images/pg.png'">
    </agm-marker>
  </agm-marker-cluster>
</agm-map>

this is my code. In this I need to change the cluster image path dynamically. {{category}} - based on the button click the category value and cluster image path changes but the image not changing

silpa-kanthan avatar Dec 19 '17 10:12 silpa-kanthan

Is it possible for you to provide the code? Where category gets changed, this way I could try to reproduce your problem

jigfox avatar Dec 19 '17 11:12 jigfox

map @jigfox , template code,

  • Category1 {{Category1Count}}
  • Category2 {{Category2Count}}
  • Category3 {{Category3Count}}
ts code,

public category = 'categoryone';

getCategory1() { this.category = 'categoryone'; }

getCategory2() { this.category = 'categorytwo'; }

getCategory3() { this.category = 'categorythree'; }

silpa-kanthan avatar Dec 19 '17 11:12 silpa-kanthan

I would also like this to be possible. I would like to have different cluster icon based on conditions/properties found in the array of markers.

savageqm avatar Jan 17 '18 15:01 savageqm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 13 '18 19:11 stale[bot]