Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度贴图的缩放更改或中心更改事件?_Angular_Typescript_Google Maps_Maps_Zooming - Fatal编程技术网

Angular 角度贴图的缩放更改或中心更改事件?

Angular 角度贴图的缩放更改或中心更改事件?,angular,typescript,google-maps,maps,zooming,Angular,Typescript,Google Maps,Maps,Zooming,您好,我目前正在为一个项目工作,其中我们使用角度贴图,前面使用角度6,后面使用Python 我需要的是从API中获取一定公里范围内的有线点。我已经有了编写的代码,我只需要能够实时检测缩放和坐标中心的变化 我可以从文件map.js(Angular Maps library的自有文件)中检测到这些更改,但我无法从该文件中更改我的主组件的值 是否有任何方法可以检测缩放和中心变化 我想要的是一个非常类似于: (mapClick) = "MyFunction1($event)" 但这样做: (zoom

您好,我目前正在为一个项目工作,其中我们使用角度贴图,前面使用角度6,后面使用Python

我需要的是从API中获取一定公里范围内的有线点。我已经有了编写的代码,我只需要能够实时检测缩放和坐标中心的变化

我可以从文件
map.js
(Angular Maps library的自有文件)中检测到这些更改,但我无法从该文件中更改我的主组件的值

是否有任何方法可以检测缩放和中心变化

我想要的是一个非常类似于:

(mapClick) = "MyFunction1($event)" 
但这样做:

(zoomChange)="MyFunction2()"

你可以解决问题,同样地,如果有人需要,也可以留下解决方案

步骤1:在文件
.html
中添加

<agm-map [zoom]="mapa_cfg.zoom" [latitude]="mapa_cfg.latitud" [longitude]="mapa_cfg.longitud"(zoomChange)="zoomChange($event)" (centerChange)="centerChange($event)">
zoomChange(event){
    console.log(event);
}

centerChange(event){
    console.log(event);
}