Find a Winery

Find a Winery

Winery Index:

0 - 9 A B C D E F G H I J K L M N O P Q R S T V W X Y Z

0 - 9

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

V

W

X

Y

Z

// this js need to move in some common js file... var toType = function (obj) { return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); } var googleMap = { map_element : null, map : null, info_content : '', init: function() { var _this = this; if ( toType(_this.map_element) === 'htmldivelement' ) { _this.map = new google.maps.Map(_this.map_element, { zoom: 1, center: new google.maps.LatLng(0, 0), styles: [ { stylers: [ { saturation: -80 } ] } ] }); var data_url = $(_this.map_element).data('url'); if ( data_url.length ) { $.ajax({ url : data_url, dataType : 'json', success : function(data) { if ( data.length ) { var bounds = new google.maps.LatLngBounds(); var infoWindow = null; $.each(data, function(i, obj) { var latLng = new google.maps.LatLng(parseFloat(obj.latitude), parseFloat(obj.longitude)); var marker = new google.maps.Marker({ position : latLng, map : _this.map, title : obj.name }); if ( _this.info_content !== '' ) { google.maps.event.addListener(marker, 'click', function() { if (infoWindow) { infoWindow.close(); } infoWindow = new google.maps.InfoWindow(); var infoContent = _this.info_content; $.each(obj, function(key, value) { if ( key === 'thumb_logo' ) { if ( value ) { var infoImg = document.createElement('img'); infoImg.style.cssText = 'float: right; width: 75px; height: auto; margin: 10px 0 10px 10px;'; infoImg.src = value; var imgContainer = document.createElement('div'); imgContainer.appendChild(infoImg); infoContent = infoContent.replace(RegExp('{' + key + '}', 'g'), imgContainer.innerHTML); } else { infoContent = infoContent.replace(RegExp('{' + key + '}', 'g'), ''); } } else { infoContent = infoContent.replace(RegExp('{' + key + '}', 'g'), value); } }); infoWindow.setContent(infoContent); infoWindow.open(_this.map, marker); }); } bounds.extend(latLng); }); google.maps.event.addListenerOnce(_this.map, 'bounds_changed', function(event) { //this.setZoom(this.getZoom() - 1); if ( this.getZoom() > 15 ) { this.setZoom(15); } }); _this.map.fitBounds(bounds); } } }); } } } }; // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . googleMap.map_element = document.getElementById('map'); googleMap.info_content = '{thumb_logo}

{name}

Address: {address}
Products: {products}

View Winery';