我目前正在使用来自 https://angular-maps.com/的AGM地图 我想在滚动时禁用缩放功能。即使在输入手势处理="'合作'"之后,它仍然保持不变。是否有任何因素可能是它不接受我输入的原因?
.map-container {
margin-top: 56px;
margin-left: 0;
padding: 0;
-ms-overflow-x: hidden;
overflow-x: hidden;
overflow-y: scroll;
position: relative;
overflow: hidden;
}
.main-container {
margin-top: 56px;
margin-left: 235px;
padding: 15px;
-ms-overflow-x: hidden;
overflow-x: hidden;
overflow-y: scroll;
position: relative;
overflow: hidden;
}
agm-map{
height: 100vh;
width: 100vw;
margin-left: 0;
padding: 0;
-ms-overflow-x: hidden;
overflow-x: hidden;
overflow-y: scroll;
position: relative;
overflow: hidden;
}
@media screen and (max-width: 992px) {
.main-container {
margin-left: 0px !important;
}
}
<div [@routerTransition] class="map-container">
<agm-map [latitude]="lat" [longitude]="lng" [zoom]='12' [gestureHandling]="'cooperative'">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>
</div>
没有设置apiVersion 但设置指令 [scrollwheel]="null" 对我有用!
https://github.com/SebastianM/angular-google-maps/issues/1411
根据问题线程,问题不在于 AGM 模块,而在于谷歌 API。我遇到了同样的问题,并且能够通过在模块"forRoot"方法中将apiVersion设置为"3.31"来解决它:
imports: [
AgmCoreModule.forRoot( {
apiKey: Globals.googleApiKey,
apiVersion: '3.31'
} ),