<style>
  .markers_labels{
    margin-left: -24px !important;
    margin-top: -43px !important;
  }
  .gm-svpc,.gm-style-mtc,.gm-style-cc{
    display: none;
  }
</style>

<template>
    <div >
      <div id="map_canvas" style="height: 400px; width: 100%"></div>
    </div>
</template>
<script>
    export default {
      props:["dataList"],
        name: 'GGMap',
      data(){
          return{
            show:false,
            directionsService: new google.maps.DirectionsService(),
            directionsDisplay: new google.maps.DirectionsRenderer(),
            map:{},
          }
      },
      created(){

      },
      destroyed: function() {

      },
      mounted(){
        this.mapBuild() //初始化实例之后调用
      },
      methods:{
        //  地图实例
        mapBuild(){
          this.dataList = [
            {
              "name": "加勒古堡",
              "lng": "80.218689700000027",
              "lat": "6.0246384",
              "type": 1
            },
            {
              "name": "高跷渔夫",
              "lng": "80.221615100000008",
              "lat": "6.0526652",
              "type": 1
            },
            {
              "name": "海上小火车",
              "lng": "79.86127620000002",
              "lat": "6.9265997",
              "type": 1
            },
            {
              "name": "南部海滨-出海观鲸",
              "lng": "80.771948100000031",
              "lat": "7.8729438999999992",
              "type": 1
            },
            {
              "name": "马渡河红树林",
              "lng": "80.221548799999937",
              "lat": "6.0517981999999986",
              "type": 1
            },
            {
              "name": "小鱼 SPA",
              "lng": "80.771948100000031",
              "lat": "7.8729438999999992",
              "type": 1
            },
            {
              "name": "海龟保育院",
              "lng": "80.543844999999919",
              "lat": "6.0697217",
              "type": 1
            },
            {
              "name": "南部海滨",
              "lng": "80.771948100000031",
              "lat": "7.8729438999999992",
              "type": 1
            },
            {
              "name": "佛牙寺",
              "lng": "80.633818900000051",
              "lat": "7.2896137",
              "type": 1
            },
            {
              "name": "康提湖",
              "lng": "80.642420599999923",
              "lat": "7.2916219999999994",
              "type": 1
            },
            {
              "name": "狮子岩",
              "lng": "80.759666700000025",
              "lat": "7.9574582",
              "type": 1
            },
            {
              "name": "米内瑞亚国家公园",
              "lng": "80.759666700000025",
              "lat": "7.9574582",
              "type": 1
            },
            {
              "name": "市政厅",
              "lng": "79.861730999999963",
              "lat": "6.9255783",
              "type": 1
            },
            {
              "name": "国家博物馆",
              "lng": "79.860964400000057",
              "lat": "6.9268083",
              "type": 1
            },
            {
              "name": "班达拉奈克国际会议大厦",
              "lng": "79.8603081",
              "lat": "6.926091",
              "type": 1
            }
          ]
          this.$googleMap.initLine(this.dataList,this);
          console.log(this.dataList)
        },
      },
    }
</script>

