map icon indicating copy to clipboard operation
map copied to clipboard

Its not a issue actually, Its a doubt. I am trying to use radius_change event of Circle without success could u display how to use it?!

Open Delfimarime opened this issue 8 years ago • 8 comments

I HAVE THE FOLLOWING HTML `

<ngui-map *ngIf="hasCenter()" center="{{center}}" (mapReady$)="onMapReady($event)" zoom="14" class="m-1" >

<marker [position]="center"  (click)="markerInfo($event.target)"></marker>

<circle (radius_change)="radiusChange($event)" center="{{center}}"   [strokeOpacity]="0.9" [strokeWeight]="1" [editable]="true"
        radius="500" draggable="false"></circle>

<info-window  id="my_location">Encontra-se aqui!</info-window>

ERROR

` AND NG2 COMPONENT ` markerInfo(marker: any) { marker.nguiMapComponent.openInfoWindow('my_location', marker, {}); } onMapReady(map: Map) { this._map = map; }

onCircleInit(value: Circle) { this._circle = value; }

get center(): any { return [this._center.latitude, this._center.longitude]; }

hasCenter(): boolean { return !isNullOrUndefined(this._center); }

radiusChange(event: any) { console.log('ALSLDLSADL'); } ` And the radius_change event doesnt work

Delfimarime avatar Apr 24 '17 08:04 Delfimarime

try this (radius_change)="myevent($event)"

allenhwkim avatar Apr 24 '17 13:04 allenhwkim

Tried but still doesnt work!?!

Delfimarime avatar Apr 24 '17 13:04 Delfimarime

https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map I don't see radius_change is an official event. Please use one of the official event. i.e. bounds_changed

Oh.. you are using circle. Then, it should be radius_changed based on https://developers.google.com/maps/documentation/javascript/3.exp/reference#Circle

allenhwkim avatar Apr 24 '17 14:04 allenhwkim

Hi I am facing the same issue.

https://plnkr.co/edit/2mgFh3MkwH5Q0aA8T7F8?p=preview

If you open de console you will see that onCircleInit event is logged. The circle is editable however everytime you resize the circle the radius_changed event is not fired.

Thanks in advance, Pablo

pablo-gonzalez avatar Feb 15 '18 17:02 pablo-gonzalez

@pablo-gonzalez can you try with (radiusChanged) instead

aitboudad avatar Feb 15 '18 17:02 aitboudad

It worked!

https://developers.google.com/maps/documentation/javascript/3.exp/reference?#Circle

According to Google documentation the event is radius_changed. Are you using a different event name in your component or google doc is wrong?

pablo-gonzalez avatar Feb 15 '18 17:02 pablo-gonzalez

we use camel-case for event name if I'm not wrong, I'll check it later.

aitboudad avatar Feb 15 '18 17:02 aitboudad

Same for center_changed.

we use camel-case for event name if I'm not wrong, I'll check it later.

If that is the case, you should consider updating the documentation of this great component!

Thank you very much.

pablo-gonzalez avatar Feb 16 '18 17:02 pablo-gonzalez