$.fn.initCustMap = function() {
    var currMapId = $(this).attr('id'),
        latitude = $(this).attr('data-cord').split(',')[0],
        longitude = $(this).attr('data-cord').split(',')[1],
        mapAddr = $(this).attr('data-addr'),
        //mapZoom=parseInt($(this).attr('data-zoom'));
        mapZoom = 17
    //console.log(currMapId+","+latitude+","+longitude+","+mapAddr+","+mapZoom);

    var Options = {
        zoom: mapZoom,
        /*縮放比例*/
        //zoomControl: false,
        //scaleControl: false,
        center: new google.maps.LatLng(22.613312, 120.305111),
        scrollwheel: false,

        //disableDoubleClickZoom: true,

        //center: new google.maps.LatLng(latitude, longitude), /*所查詢位置的經緯度位置*/
        styles: [{
                "featureType": "all",
                "elementType": "all",
                "stylers": [{
                    "hue": "#e7ecf0"
                }]
            },
            {
                "featureType": "all",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "administrative",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "landscape",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "landscape.natural",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "poi",
                "elementType": "all",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "poi",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "poi",
                "elementType": "labels.icon",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "road",
                "elementType": "all",
                "stylers": [{
                    "saturation": -70
                }]
            },
            {
                "featureType": "road",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "road",
                "elementType": "labels.icon",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "road.highway",
                "elementType": "all",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "road.highway",
                "elementType": "geometry.stroke",
                "stylers": [{
                    "lightness": "27"
                }]
            },
            {
                "featureType": "road.highway",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "road.highway",
                "elementType": "labels.icon",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "road.arterial",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "road.local",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "on"
                }]
            },
            {
                "featureType": "transit",
                "elementType": "all",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "transit",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "transit.station",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            },
            {
                "featureType": "water",
                "elementType": "all",
                "stylers": [{
                        "visibility": "simplified"
                    },
                    {
                        "saturation": -60
                    },
                    {
                        "lightness": "100"
                    }
                ]
            },
            {
                "featureType": "water",
                "elementType": "geometry.fill",
                "stylers": [{
                    "color": "#749fb8"
                }]
            },
            {
                "featureType": "water",
                "elementType": "labels.text",
                "stylers": [{
                    "visibility": "off"
                }]
            }
        ]
    };

    var locations = [
        ['Lipoart 萊波亞美醫診所', 22.613312, 120.305111, 'https://www.google.com.tw/maps/place/萊波亞美醫診所/@22.6133074,120.3045629,19z']
    ];

    map = new google.maps.Map(document.getElementById(currMapId), Options);

    /*地圖參數相關設定 End*/

    /*自行設定圖標 Start*/

    var marker, i;
    var infowindow = new google.maps.InfoWindow();

    var image = [{
        url: '/files/icons/map_mark.png?1516609988',
        /*自定圖標檔案位置或網址*/
        size: new google.maps.Size(52, 60),
        /*自定圖標大小*/
        origin: new google.maps.Point(0, 0),
        anchor: new google.maps.Point(26, 60)
        /* },
		 {
            url: '/images/private-car-park.png?1702040451', 
            size: new google.maps.Size(32, 32), 
            origin: new google.maps.Point(0, 0),
            anchor: new google.maps.Point(16, 32)
          },
		 {
            url: '/images/public-car-park.png?1702040451',
            size: new google.maps.Size(32, 32), 
            origin: new google.maps.Point(0, 0),
            anchor: new google.maps.Point(16, 32)*/
    }];


    for (i = 0; i < locations.length; i++) {


        marker = new google.maps.Marker({
            map: map,
            position: new google.maps.LatLng(locations[i][1], locations[i][2]),
            /*圖標經緯度位置*/
            icon: image[i]
        });

        if (i == 0) {
            infowindow.setContent('<div class="map-info-title">' + locations[0][0] + '</div><a href="' + locations[0][3] + '" class="map-info-link" target="_blank"><span class="fa fa-map"></span> 開啟google地圖</a>');
            infowindow.open(map, marker);
            bounds = new google.maps.LatLngBounds();
        }

        google.maps.event.addListener(marker, 'click', (function(marker, i) {
            return function() {
                infowindow.setContent('<div class="map-info-title">' + locations[i][0] + '</div><a href="' + locations[i][3] + '" class="map-info-link" target="_blank"><span class="fa fa-map"></span> 開啟google地圖</a>');
                infowindow.open(map, marker);
            }
        })(marker, i));
    }



    /*自行設定圖標 End*/


    /*所查詢位置詳細資料 Start*/
    /*
        infowindow = new google.maps.InfoWindow({
            content:  '<div class="map-info-title">白砂15</div>'+mapAddr+'<br><a href="https://www.google.com.tw/maps/place/946%E5%B1%8F%E6%9D%B1%E7%B8%A3%E6%81%86%E6%98%A5%E9%8E%AE%E6%A8%B9%E6%9E%97%E8%B7%AF25-3%E8%99%9F/@21.9525269,120.7118502,17z/data=!3m1!4b1!4m5!3m4!1s0x3471b075345e7137:0xbbf835fad93dbaf!8m2!3d21.9525269!4d120.7140389" class="map-info-link" target="_blank"><span class="fa fa-map"></span> 開啟google地圖</a>'
        });
        
        infowindow.open(map, marker);
		*/




}