I'm using the geocoder platform to get the lat/lng of an address. I then set the map center to those coordinates.
However, when I call map.getCenter() afterwards, I only get 0 for lat, lng and alt. What could be the problem?
If you ask for map's center right after setting new center, you'll get the old (or better said current) one.
You should wait till the map's center is really updated or use mapviewchangeend event listener:
map.setCenter({lat:15,lng:16});
map.addEventListener('mapviewchangeend', (e) => {
console.log(map.getCenter());
})