var latlist = new Array(); var lnglist = new Array(); var lat = '39.8760810'; var lng = '32.87102900000000'; latlist[0] = 0; lnglist[0] = 0; var myLatlng; var mapOptions; var map; var kmlLayer; var infowindow; function initialize(lat, lng) { myLatlng = new google.maps.LatLng(lat, lng); mapOptions = { zoom: 5, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); kmlLayer = new google.maps.KmlLayer({ url: 'https://www.cantasepette.com/resman/uploads/maps.kml?rand='+(new Date()).valueOf(), suppressInfoWindows: true, map: map }); var urlstring = decodeURI(location.href); var urlparca = urlstring.split('#'); $('#inland option[value="'+urlparca[1]+'"]').attr('selected','selected'); $("#inland").trigger('change'); $(".sbHolder").eq(0).find("a").eq(1).text($('#inland option:selected').text()); google.maps.event.addListener(kmlLayer, 'click', function(kmlEvent) { showInContentWindow(kmlEvent.latLng, kmlEvent.featureData.description); }); function showInContentWindow(position, text) { var content = text; if (infowindow) infowindow.close(); infowindow = new google.maps.InfoWindow({ content: content, position: position }) infowindow.open(map); } } //google.maps.event.addDomListener(window, 'load', initialize(lat, lng)); $(window).on("load",function(e) { initialize(lat, lng); }); //setMapCenter(latlist[$(this).text()], lnglist[$(this).text()]) İl: Yurtdışı: Türkiye i Yukarıdaki menüden il veya ülke seçimi yaparak mağazalarımızı listeleyebilirsiniz. x $('.remove').on('click', function(){ $(this).parent().hide(1000, function(){ $(this).remove(); }); }); $(document).ready(function(){ $("#outland").change(function () { $("#outland option:selected").each(function () { var yurtdisi = $(this).val(); var html2='<option value="0" >Seçiniz</option>'; var ilarr = []; $.ajax({ url:'https://www.cantasepette.com/resman/uploads/maps.xml?rand='+(new Date()).valueOf(), type:'GET', dataType:'xml', success:function(gelen){ $(gelen).find('MAGAZA').each(function(){ if($(this).find('ULKE').text()==yurtdisi && (latlist[$(this).find('PLAKA').text()]!=parseFloat(latlist[$(this).find('PLAKA').text()])) && $(this).find('LAT').text()!='' && $(this).find('LNG').text()!=''){ latlist[$(this).find('PLAKA').text()] = $(this).find('LAT').text(); lnglist[$(this).find('PLAKA').text()] = $(this).find('LNG').text(); if(ilarr[$(this).find('PLAKA').text()]!=parseInt(ilarr[$(this).find('PLAKA').text()])) { ilarr[$(this).find('PLAKA').text()] = $(this).find('PLAKA').text(); html2 +='<option value="'+$(this).find('PLAKA').text()+'">'+$(this).find('IL').text()+'</option>'; } } }); $('#inland').html(html2); $( "#inland option:eq(1)" ).attr('selected','selected').change(); $( "#inland" ).change(); } }); }); }); $("#inland").change(function () { $("#inland option:selected").each(function () { var sehir= $(this).text(); var plaka= $(this).val(); var html=''; $.ajax({ url:'https://www.cantasepette.com/resman/uploads/maps.xml?rand='+(new Date()).valueOf(), type:'GET', dataType:'xml', success:function(gelen){ $(gelen).find('MAGAZA').each(function(){ if($(this).find('PLAKA').text()==plaka){ html += '<div class="mgz ' + $(this).find('ACIKLAMA').text() + '">'; html += '<div id="firma_aciklama"><span>' + $(this).find('ACIKLAMA').text() + '</span></div>'; html += '<div id="firma_name">' + $(this).find('MAGAZATITLE').text() + '</div>'; html += '<div id="firma_konum">' + $(this).find('MAGAZAKONUM').text() + '</div>'; html += '<div id="firma_tel">' + $(this).find('MAGAZATEL').text() + '</div>'; html += '<div id="firma_saat">' + $(this).find('H_ICI').text() + '</div>'; if($(this).find('LAT').text().trim()!='' && $(this).find('LNG').text().trim()!='') if($(this).find('LAT').text().trim()!='' && $(this).find('LNG').text().trim()!='') html += '<div id="link" onclick="var linklatlong = new google.maps.LatLng($(\'span\',this).eq(0).text() ,$(\'span\',this).eq(1).text());map.setCenter(linklatlong); map.setZoom(15);"><span style="display:none">'+$(this).find('LAT').text()+'</span><span style="display:none">'+$(this).find('LNG').text()+'</span>Haritada Göster</div>'; html += '</div>'; } }); $('.shopList').html(html); } }); }); $("#inland option:selected").each(function () { var sehit = $(this).val(); setTimeout(function() { // $(".shopList").mCustomScrollbar({ // autoHideScrollbar:true //}); }, 800); }); var latval = latlist[$("#inland option:selected").val()]; var lngval = lnglist[$("#inland option:selected").val()]; if(latval==0 && lngval==0){ var myLatlng2 = new google.maps.LatLng(32.87102900000000,39.8760810); map.setCenter(myLatlng2); map.setZoom(5); } else if(latval!='' && lngval!='') { var myLatlng2 = new google.maps.LatLng(latval,lngval); try { map.setCenter(myLatlng2); map.setZoom(10); } catch(e){}} }); $("#outland").trigger('change'); $("#inland").trigger('change'); }); function inland_trigger() { $("#inland").trigger('change'); } var urlstring = decodeURI(location.href); var urlparca = urlstring.split('#'); if(urlparca.length==2) { $('#inland option[value="'+urlparca[1]+'"]').attr('selected','selected'); $("#inland").trigger('change'); setTimeout('inland_trigger()',3000); } #firma_aciklama span { background: #ff0013; color: #fff; text-transform: uppercase; width: initial; text-align: center; font-size: 12px; padding: 4px 10px; font-weight: 600; } .BAYİ.hide{display: none;} .SERVİS.hide{display: none;} .BAYİ.active{display:block;} .SERVİS.active{display:block;} .select1,.select2{ vertical-align: middle !important;margin-left: 10px;} @media(max-width:767px){.contents .article .shopfilter fieldset{width:100%}} .contents {width: 100%;margin: 25px 0px 50px 0px;position: relative;} .contents .title {width: 100%;border-bottom: #a5997f solid 1px;padding: 10px 0;margin-bottom: 10px;display: block;position: relative;clear: both;display: none;} .title h1 {font: 20px/35px 'Cuprum';color: #333;} .contents .article { display: block; position: relative; clear: both; width: 40%; margin: 25px 0 0 0;} .contents .article.wide { width: 100%; margin: 15px 0 25px 0;} .contents .article .shopfilter { width: 100%; clear: both; display: block; border-bottom: #A59A80 solid 1px; padding-bottom: 15px; margin-bottom: 15px;} .contents .article .shopfilter fieldset { margin-right: 75px;} .contents .article .shopfilter > *, .contents .article .shopfilter fieldset > * {display: inline-block;vertical-align: top;font: 18px/35px arial;color: #333;} .selectius{border: 1px solid #dadada;} .shopfilter fieldset:last-child { display: none !important;} .shopcontent .alert { display: none;} .shopList {float: left;width: 29%;height: 511px;overflow: hidden;padding-right: 10px;margin-right: 20px;overflow-y: scroll;} .mgz {/* height: 248px; */float: c;/* width: 171px; */padding-bottom: 15px;border-bottom: 1px solid #ccc;margin-bottom: 15px;font-size: 11px;display: block;color: #333;text-align: left;} #firma_name {font-weight: bold !important;color: #333;margin-bottom: 5px;font-size: 16px;} #firma_konum {margin-bottom: 5px;font-size: 14px;} #firma_tel {margin-bottom: 11px;font-size: 14px;/* font-weight: bold; */} #firma_saat {line-height: 16px;font-size: 13px;} .mgz #link {width: 75%;height: 25px;text-align: center;color: #FFF;line-height: 25px;/* float: right; */display: block;cursor: pointer;background-color: #6d6e72;border-radius: 4px;margin: 6px 0 0;} .mapArea {width: 69%;float: left;margin-right: 1px;} @media (max-width:991px){ .shopList { width: 100%; margin-bottom: 15px; border-bottom: 1px solid #dadada;padding-right: 5px; } .mapArea{ width: 100%; } }