[Vuejs]-Display Google Map using Vue.js, inside a rails application

0👍

Found an answer to my question online. It appears that the “ready” function is depricated and i needed to use “mounted”.

new Vue({
  el: '#vue-map',
  data: {},
  methods: {},
  mounted(){
      var myOptions = {
        zoom: 12,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        center: new google.maps.LatLng(25.761680, -80.19179)
      };
      var mapp = new google.maps.Map(document.getElementById("map_canvas2"), 
                 myOptions);
  }
});

Leave a comment