【发布时间】:2018-10-12 14:19:18
【问题描述】:
当用户单击按钮时,我想将openlayers 库中的zoom 放到一个位置,例如:Berlin。有人能告诉我怎么可能吗?
下面是我的代码:
app.component.html
<button id='berlin' (click)="onClick('berlin')">Zoom to Berlin</button>
app.component.ts
berlin = fromLonLat([13.388866, 52.517071]);
public onClick(city:any) {
console.log(city);
view.animate({
center: city,
duration: 2000
});
}
【问题讨论】:
标签: angular openlayers angular-openlayers