I would like to zoom
in openlayers
library to a location eg: Berlin
when the user click on the button. can someone tell me how is it possible to be done?
Below are my code:
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
});
}