" + address; var marker; if(accountType.includes('Dealer')) { marker = new google.maps.Marker({ map: map, position: latlng, icon : delearNormalIcon(), id : id }); } else { marker = new google.maps.Marker({ map: map, position: latlng, icon : distNormalIcon(), id : id }); } google.maps.event.addListener(marker, 'click', function() { _genelecsitedealermap_openDialogue(name, address, distance, city, country, zipcode, state, hideAddress,marketSegment, email, phone, samCertified, accountType, website, id, lat, lng, techService, showRoom, smartIPCertified); }); markers.push(marker); } function _genelecsitedealermap_markerCluster() { // Add a marker clusterer to manage the markers. markerCluster.clearMarkers(); markerCluster.addMarkers(markers); } function doNothing() {} function _genelecsitedealermap_deleteUrl(param) { var url = new URL(window.location.href); var query_string = url.search; var search_params = new URLSearchParams(query_string); search_params.delete(param); url.search = search_params.toString(); var newurl = url.toString(); window.history.replaceState({path:newurl},'',newurl); } function _genelecsitedealermap_updateUrl(param, value) { var url = new URL(window.location.href); var query_string = url.search; var search_params = new URLSearchParams(query_string); search_params.set(param, value); url.search = search_params.toString(); var newurl = decodeURIComponent(url.toString()); window.history.replaceState({path:newurl},'',newurl); } function _genelecsitedealermap_searchDealer(lat, lng, countryShortName) { AUI().use('aui-io-request', function(A){ A.io.request('https://www.genelec.com/accessories/8020-320b/w-table-stand-l-shape?p_p_id=genelecsitedealermap&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=searchDealer&p_p_cacheability=cacheLevelPage', { method: 'post', data : { _genelecsitedealermap_lat: lat, _genelecsitedealermap_lng: lng, _genelecsitedealermap_countryShortName: countryShortName }, on : { success : function() { var data = this.get('responseData'); if(!cluster) { _genelecsitedealermap_updateHash(); _genelecsitedealermap_updateUrl("lat", lat); _genelecsitedealermap_updateUrl("lng", lng); } data = JSON.parse(data);	var location = data.location; allStores = location; var distFiler = data.distFilter; var dealerFilter = data.dealerFilter; var showroomFilter = data.showroomFilter; var studioMonitorFilter = data.studioMonitorFilter; var homeSpeakersFilter = data.homeSpeakersFilter; var avInstallationFilter = data.avInstallationFilter; var technicalServiceFilter = data.technicalServiceFilter; var northEast = data.northEast; var southWest = data.southWest; var distance = data.distance; setTimeout(function(){ _genelecsitedealermap_setFilter(distFiler, dealerFilter,showroomFilter, studioMonitorFilter, homeSpeakersFilter, avInstallationFilter, technicalServiceFilter); }, 1000); _genelecsitedealermap_setStoresList(location); var myLatlng = new google.maps.LatLng(lat, lng); var southWestLat = new google.maps.LatLng(southWest.lat, southWest.lng); var northEastLat = new google.maps.LatLng(northEast.lat, northEast.lng); var boundsSN = new google.maps.LatLngBounds(); if(dragAndDrop) { map.setCenter(myLatlng); map.setZoom(map.getZoom()); } else if(clusterMarkerers){ map.setCenter(myLatlng); map.setZoom(map.getZoom()); } else if(param){ map.setCenter(myLatlng); map.setZoom(map.getZoom()); } else { for (var i = 0; i < location.length; i++) { var latLong = new google.maps.LatLng(location[i].latitude, location[i].longitude); boundsSN.extend(latLong); } boundsSN.extend(myLatlng); map.setCenter(boundsSN.getCenter()); map.fitBounds(boundsSN); } _genelecsitedealermap_defaultMarker(lat,lng); setTimeout(function(){ _genelecsitedealermap_readFilterParam(); }, 1000); dealerInfoBoxHeight(); }, failure : function() {} } }); }); } function _genelecsitedealermap_setStoresList(stores) { var html = ""; var markerIndex=0; for(var i =0; i' html += '