title: OpenLayer setCenter() doesn't work a second time
body: <p>I am trying to reproduce a map app using openLayer API with VUE and this setCenter() function doesn't work on my second call of it. In the following snippet of code, the map would be initialized with a random centre of [60,60] and then when i input an number to update its Latitude it works ok, but when i try to change the centre again by repeating the step with a different input the map simply doesn't update the view.</p>
  
  <p>In browser console, however, 
      <code>window.map.getView().getCenter()</code>
  would give the latest coordinates that i want.</p>
  
  <p>The reason why map is initialized in a <code>setTimeout()</code> fashion is how i imported openLayer using <code>&lt;script&gt;</code> tags in my index.html file. Therefore why must the <code>map</code> instance be bounded to <code>window</code>.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;template&gt;
      &lt;div id="map" class="map"&gt;
      &lt;input type="text" @keyup.enter="changeCenter" v-model="center"&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
    export default {
      name: "Olmap",
      props: ["InitCenter"], //[60,60]
      data(){
        return{
          center: ""
        }
      },
      components:{
        topInfoBar
      },
      methods:{
        changeCenter: function(){
          window.changeCenter([parseInt(this.center), 40])
        }
      },
      created(){
        setTimeout(()=&gt;{
          var map = new window.ol.Map({
            target: 'map',
            layers: [
              new window.ol.layer.Tile({
                source: new window.ol.source.OSM()
              })
            ],
            view: new window.ol.View({
              center: window.ol.proj.fromLonLat(this.InitCenter),
              zoom: 4
            })
          });
          window.map = map;
        },50);
  
        var changeCenter = function(center){
          window.map.getView().setCenter(center);
        }
        window.changeCenter = changeCenter;
      },
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Anyone can help me with this?</p>