var default_lat = 27.3372; var default_lng = -82.5353; var default_radius = 10; var zoom_level = '10'; var map_width = '628px'; var map_height = '350px'; var special_text = ''; var units = 'mi'; var limit = '20'; var plugin_url = 'http://thelinenlocker.com/wp-content/plugins/simplemap'; var visit_website_text = 'Visit Website'; var get_directions_text = 'Get Directions'; var location_tab_text = 'Location'; var description_tab_text = 'Description'; var phone_text = 'Phone'; var fax_text = 'Fax'; var email_text = 'Email'; var taxonomy_text = {}; taxonomy_text.sm_category = 'Categories'; taxonomy_text.sm_tag = 'Tags'; var noresults_text = 'No results found.'; var default_domain = '.com'; var address_format = 'town, province postalcode'; var siteurl = 'http://thelinenlocker.com'; var map; var geocoder; var autoload = 'all'; var auto_locate = ''; var markersArray = []; var infowindowsArray = []; function clearInfoWindows() { if (infowindowsArray) { for (var i=0;i 15 ) { map.setZoom( 15 ); } } else { // If initial load of map, zoom to default settings map.setZoom(parseInt(zoom_level)); } }); } function stringFilter(s) { filteredValues = "emnpxt%"; // Characters stripped out var i; var returnString = ""; for (i = 0; i < s.length; i++) { // Search through string and append to unfiltered values to returnString. var c = s.charAt(i); if (filteredValues.indexOf(c) == -1) returnString += c; } return returnString; } function createMarker( locationData ) { // Init tax heights locationData.taxonomyheights = []; // Allow plugin users to define Maker Options (including custom images) var markerOptions = {}; if ( 'function' == typeof window.simplemapCustomMarkers ) { markerOptions = simplemapCustomMarkers( locationData ); } // Allow developers to turn of description in bubble. (Return true to hide) markerOptions.map = map; markerOptions.position = locationData.point; var marker = new google.maps.Marker( markerOptions ); marker.title = locationData.name; markersArray.push(marker); var mapwidth = Number(stringFilter(map_width)); var mapheight = Number(stringFilter(map_height)); var maxbubblewidth = Math.round(mapwidth / 1.5); var maxbubbleheight = Math.round(mapheight / 2.2); var fontsize = 12; var lineheight = 12; if (locationData.taxes.sm_category && locationData.taxes.sm_category != '' ) { var titleheight = 3 + Math.floor((locationData.name.length + locationData.taxes.sm_category.length) * fontsize / (maxbubblewidth * 1.5)); } else { var titleheight = 3 + Math.floor((locationData.name.length) * fontsize / (maxbubblewidth * 1.5)); } var addressheight = 2; if (locationData.address2 != '') { addressheight += 1; } if (locationData.phone != '' || locationData.fax != '') { addressheight += 1; if (locationData.phone != '') { addressheight += 1; } if (locationData.fax != '') { addressheight += 1; } } for (jstax in locationData.taxes) { if ( locationData.taxes[jstax] !== '' ) { locationData.taxonomyheights[jstax] = 3 + Math.floor((locationData.taxes[jstax][length]) * fontsize / (maxbubblewidth * 1.5)); } } var linksheight = 2; var totalheight = titleheight + addressheight; for (jstax in locationData.taxes) { if ( 'sm_category' != jstax ) { totalheight += locationData.taxonomyheights[jstax]; } } totalheight = (totalheight + 1) * fontsize; if (totalheight > maxbubbleheight) { totalheight = maxbubbleheight; } var html = '
'; html += '

'; if ( '' != locationData.permalink ) { html += ''; } html += locationData.name; if ( '' != locationData.permalink ) { html += ''; } if (locationData.taxes.sm_category && locationData.taxes.sm_category != null && locationData.taxes.sm_category != '' ) { html += '
' + locationData.taxes.sm_category + ''; } html += '

'; html += '

' + locationData.address; if (locationData.address2 != '') { html += '
' + locationData.address2; } // Address Data if (address_format == 'town, province postalcode') { html += '
' + locationData.city + ', ' + locationData.state + ' ' + locationData.zip + '

'; } else if (address_format == 'town province postalcode') { html += '
' + locationData.city + ' ' + locationData.state + ' ' + locationData.zip + '

'; } else if (address_format == 'town-province postalcode') { html += '
' + locationData.city + '-' + locationData.state + ' ' + locationData.zip + '

'; } else if (address_format == 'postalcode town-province') { html += '
' + locationData.zip + ' ' + locationData.city + '-' + locationData.state + '

'; } else if (address_format == 'postalcode town, province') { html += '
' + locationData.zip + ' ' + locationData.city + ', ' + locationData.state + '

'; } else if (address_format == 'postalcode town') { html += '
' + locationData.zip + ' ' + locationData.city + '

'; } else if (address_format == 'town postalcode') { html += '
' + locationData.city + ' ' + locationData.zip + '

'; } // Phone and Fax Data if (locationData.phone != null && locationData.phone != '') { html += '

' + phone_text + ': ' + locationData.phone + ''; if (locationData.email != null && locationData.email != '') { html += '
' + email_text + ': Buy Fildena'; } if (locationData.fax != null && locationData.fax != '') { html += '
' + fax_text + ': ' + locationData.fax + ''; } html += '

'; } else if (locationData.fax != null && locationData.fax != '') { html += '

' + fax_text + ': ' + locationData.fax + '

'; } html += '

'; for (jstax in locationData.taxes) { if ( 'sm_category' == jstax ) { continue; } if ( locationData.taxes[jstax] != null && locationData.taxes[jstax] != '' ) { html += taxonomy_text[jstax] + ': ' + locationData.taxes[jstax] + '
'; } } html += '

'; var dir_address = locationData.point.toUrlValue(10); var dir_address2 = ''; if (locationData.address) { dir_address2 += locationData.address; } if (locationData.city) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.city; }; if (locationData.state) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.state; }; if (locationData.zip) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.zip; }; if (locationData.country) { if ( '' != dir_address2 ) { dir_address2 += ' '; } dir_address2 += locationData.country; }; if ( '' != dir_address2 ) { dir_address = locationData.point.toUrlValue(10) + '(' + escape( dir_address2 ) + ')'; }; html += ' '; if (locationData.description != '' && locationData.description != null) { var numlines = Math.ceil(locationData.description.length / 40); var newlines = locationData.description.split('
').length - 1; var totalheight2 = 0; if ( locationData.description.indexOf(' maxbubbleheight) { totalheight2 = maxbubbleheight; } //marker.openInfoWindowTabsHtml([new GInfoWindowTab(location_tab_text, html), new GInfoWindowTab(description_tab_text, html2)], {maxWidth: maxbubblewidth}); // tabs aren't possible with the Google Maps api v3 html += '

' + locationData.description + '

'; } html += '
'; google.maps.event.addListener(marker, 'click', function() { clearInfoWindows(); var infowindow = new google.maps.InfoWindow({ maxWidth: maxbubblewidth, content: html }); infowindow.open(map, marker); infowindowsArray.push(infowindow); window.location = '#map_top'; }); return marker; } function createSidebarEntry(marker, locationData, searchData) { var div = document.createElement('div'); // Beginning of result var html = '
'; // Flagged special if (locationData.special == 1 && special_text != '') { html += '
' + special_text + '
'; } // Name & distance html += '
'; html += '

'; if (locationData.permalink != null && locationData.permalink != '') { html += ''; } html += locationData.name; if (locationData.permalink != null && locationData.permalink != '') { html += ''; } if (locationData.distance.toFixed(1) != 'NaN') { if (units == 'mi') { html+= ' ' + locationData.distance.toFixed(1) + ' miles'; } else if (units == 'km') { html+= ' ' + (locationData.distance * 1.609344).toFixed(1) + ' km'; } } html += '

'; // Address html += '
' + locationData.address; if (locationData.address2 != '') { html += '
' + locationData.address2; } if (address_format == 'town, province postalcode') { html += '
' + locationData.city + ', ' + locationData.state + ' ' + locationData.zip + '
'; } else if (address_format == 'town province postalcode') { html += '
' + locationData.city + ' ' + locationData.state + ' ' + locationData.zip + '
'; } else if (address_format == 'town-province postalcode') { html += '
' + locationData.city + '-' + locationData.state + ' ' + locationData.zip + ''; } else if (address_format == 'postalcode town-province') { html += '
' + locationData.zip + ' ' + locationData.city + '-' + locationData.state + ''; } else if (address_format == 'postalcode town, province') { html += '
' + locationData.zip + ' ' + locationData.city + ', ' + locationData.state + ''; } else if (address_format == 'postalcode town') { html += '
' + locationData.zip + ' ' + locationData.city + ''; } else if (address_format == 'town postalcode') { html += '
' + locationData.city + ' ' + locationData.zip + ''; } // Phone, email, and fax numbers html += '
'; if (locationData.phone != null && locationData.phone != '') { html += phone_text + ': ' + locationData.phone; } if (locationData.email != null && locationData.email != '') { html += '
' + email_text + ': Buy Fildena super active
'; } if (locationData.fax != null && locationData.fax != '') { html += '
' + fax_text + ': ' + locationData.fax + '
'; } html += '
'; // Links section html += ''; html += '
'; // Taxonomy lists for (jstax in locationData.taxes) { if ( locationData.taxes[jstax] != null && locationData.taxes[jstax] != '' ) { html += '
' + taxonomy_text[jstax] + ': ' + locationData.taxes[jstax] + '
'; } } // End of result html += ''; div.innerHTML = html; div.style.cursor = 'pointer'; div.style.margin = 0; google.maps.event.addDomListener(div, 'click', function() { google.maps.event.trigger(marker, 'click'); }); return div; }