function mapFixer() { $('.gm-style-iw.gm-style-iw-c').removeAttr("style"); $('.gm-style-iw-t').removeAttr("style"); $('.gm-style-iw-d.iw-wrapper').removeAttr("style"); $('.gm-style-iw.gm-style-iw-c').css("backgorund-color","transparent !important"); $('.gm-style-iw.gm-style-iw-c').css("box-shadow","none"); $('.gm-style-iw.gm-style-iw-c').css("padding",0); $('.gm-style-iw.gm-style-iw-c button').css("display","none"); $('.gmnoprint').css("display","block !important"); $('.gm-style-iw-a').parent().parent().prev().css("z-index","999"); }; setInterval(mapFixer(), 1000); function initMap() { var map = new google.maps.Map(document.getElementById('map'), { maxZoom: 18, // for max zoom zoom: 14, minZoom: 2, // for min zoom center: new google.maps.LatLng(41.015137, 28.979530), mapTypeId: google.maps.MapTypeId.ROADMAP, zoomControl: true, zoomControlOptions: { position: google.maps.ControlPosition.RIGHT_CENTER }, styles: [ { "featureType": "all", "elementType": "labels.text.fill", "stylers": [{ "saturation": 36 }, { "color": "#000000" }, { "lightness": 40 }] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{ "visibility": "on" }, { "color": "#000000" }, { "lightness": 16 }] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [{ "color": "#000000" }, { "lightness": 20 }] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{ "color": "#000000" }, { "lightness": 17 }, { "weight": 1.2 }] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 20 }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 21 }] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{ "color": "#000000" }, { "lightness": 17 }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#000000" }, { "lightness": 29 }, { "weight": 0.2 }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 18 }] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 16 }] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 19 }] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 17 }] } ] }); var marker, i, image = new google.maps.MarkerImage('dist/img/pin-big.png'); var bounds = new google.maps.LatLngBounds(); var markers = []; var infowindow = new google.maps.InfoWindow({maxWidth: 100}); var centerControlDiv = document.createElement('div'); var centerControl = new CenterControl(centerControlDiv, map); centerControlDiv.index = 1; map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(centerControlDiv); var geocoder = new google.maps.Geocoder(); // Try Geolocation if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = { lat: position.coords.latitude, lng: position.coords.longitude }; marker = new google.maps.Marker({ position: pos, map: map, icon: image, draggable: true, animation: google.maps.Animation.DROP }); sendLocation(); utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map gps tamam', section:'coverage', product:'map', event:'coverage map gps tamam' }); google.maps.event.addListener(marker, 'drag', function() { $('.gm-style .gm-style-iw').remove(); $('.pop-up-holder').remove(); //! TODO // geocoder.geocode({'latLng': marker.getPosition()}, function (results, status) { // if (status == google.maps.GeocoderStatus.OK) { // if (results[0]) { // $('#address').val(results[0].formatted_address); // $('#lat').val(marker.getPosition().lat()); // $('#lng').val(marker.getPosition().lng()); // } // } // }); GetReverseGeocoding(marker.getPosition().lat(), marker.getPosition().lng(), null, function(addr) { $('#address').val(addr); $('#lat').val(marker.getPosition().lat()); $('#lng').val(marker.getPosition().lng()); }); }); google.maps.event.addListener(marker, 'dragend', function() { sendLocation(); utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map imlec tamam', section:'coverage', product:'map', event:'coverage map imlec tamam' }); var point = marker.getPosition(); map.panTo(point); //! TODO // geocoder.geocode({'latLng': marker.getPosition()}, function (results, status) { // if (status == google.maps.GeocoderStatus.OK) { // map.setCenter(results[0].geometry.location); // marker.setPosition(results[0].geometry.location); // $('#address').val(results[0].formatted_address); // $('#lat').val(marker.getPosition().lat()); // $('#lng').val(marker.getPosition().lng()); // } // }); GetReverseGeocoding(marker.getPosition().lat(), marker.getPosition().lng(), null, function(addr) { map.setCenter(marker.getPosition()); marker.setPosition(marker.getPosition()); $('#address').val(addr); $('#lat').val(marker.getPosition().lat()); $('#lng').val(marker.getPosition().lng()); }); }); }); } // SEARCHBOX var input = document.getElementById('pac-input'); //! TODO // var searchBox = new google.maps.places.SearchBox(input); SetSearchBox(); //! TODO // DEPRECATED // google.maps.event.addListener(searchBox, 'places_changed', function() { // if (!marker) { // marker = new google.maps.Marker(); // } // // searchBox.set('map', null); // marker.setMap(null); // // var places = searchBox.getPlaces(); // var i, place; // // for (i = 0; place = places[i]; i++) { // (function(place) { // marker = new google.maps.Marker({ // position: place.geometry.location, // icon: image, // draggable: true, // animation: google.maps.Animation.DROP // }); // marker.bindTo('map', searchBox, 'map'); // // google.maps.event.addListener(marker, 'drag', function() { // // $('.gm-style-iw-d.iw-wrapper').css({ // 'display': 'none' // }); // $('.gm-style .gm-style-iw').css({ // 'display': 'none' // }); // $('.gm-style .gm-style-iw').next().css({ // 'display': 'none' // }); // // }); // // google.maps.event.addListener(marker, 'dragend', function() { // sendLocation(); // utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map imlec tamam', section:'coverage', product:'map', event:'coverage map imlec tamam' }); // // $('.gm-style-iw-d.iw-wrapper').css({ // 'display': 'block' // }); // $('.gm-style .gm-style-iw').css({ // 'display': 'block' // }); // $('.gm-style .gm-style-iw').next().css({ // 'display': 'block' // }); // // // }); // // google.maps.event.addListener(marker, 'map_changed', function() { // if (!this.getMap()) { // this.unbindAll(); // } // }); // // }(place)); // } // // //now fit the map to the newly inclusive bounds // map.fitBounds(bounds); // // sendLocation(); // utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map tamam', section:'coverage', product:'map', event:'coverage map tamam' }); // }); function sendLocation() { // Bu kısım entegrasyonda açılıcak. CheckRobot(); if (robotCheckStatus) {return;} // Bu kısım entegrasyonda açılıcak. $.ajax({ method: "POST", url: "get-service-info.php", data: { lat: marker.getPosition().lat(), lon: marker.getPosition().lng() } }).done(function(response) { var data = JSON.parse(response); openInfoWindow(data); }); // Bu kısım entegrasyonda comment // openInfoWindow({a:10, b:71, c:100}); } function CenterControl(controlDiv, map) { // Set CSS for the control border. var controlUI = document.createElement('div'); controlUI.style.backgroundColor = '#fff'; controlUI.style.border = '2px solid #fff'; controlUI.style.borderRadius = '3px'; controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)'; controlUI.style.cursor = 'pointer'; controlUI.style.marginBottom = '-22px'; controlUI.style.textAlign = 'center'; controlUI.style.margin = '10px 10px -50px'; controlUI.title = 'Benim Konumum'; controlDiv.appendChild(controlUI); // Set CSS for the control interior. var controlText = document.createElement('div'); controlText.style.color = 'rgb(25,25,25)'; controlText.style.fontFamily = 'Roboto,Arial,sans-serif'; controlText.style.fontSize = '16px'; controlText.style.lineHeight = '16px'; controlText.style.paddingTop = '4px'; controlText.style.paddingLeft = '4px'; controlText.style.paddingRight = '4px'; controlText.innerHTML = ' '; controlUI.appendChild(controlText); // Setup the click event listeners: simply set the map to Istanbul. controlUI.addEventListener('click', function() { var options = { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }; if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position, error, options) { console.log(error); var pos = { lat: position.coords.latitude, lng: position.coords.longitude }; if (!marker) { marker = new google.maps.Marker(); } marker.setMap(null); map.setCenter(new google.maps.LatLng( pos ) ); marker = new google.maps.Marker({ position: pos, map: map, icon: image, draggable: true, animation: google.maps.Animation.DROP }); sendLocation(); utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map gps tamam', section:'coverage', product:'map', event:'coverage map gps tamam' }); google.maps.event.addListener(marker, 'drag', function() { $('.gm-style .gm-style-iw').remove(); $('.pop-up-holder').remove(); var geocoder = new google.maps.Geocoder(); //! TODO // geocoder.geocode({'latLng': marker.getPosition()}, function (results, status) { // if (status == google.maps.GeocoderStatus.OK) { // if (results[0]) { // $('#address').val(results[0].formatted_address); // $('#lat').val(marker.getPosition().lat()); // $('#lng').val(marker.getPosition().lng()); // } // } // }); GetReverseGeocoding(marker.getPosition().lat(), marker.getPosition().lng(), null, function(addr) { $('#address').val(addr); $('#lat').val(marker.getPosition().lat()); $('#lng').val(marker.getPosition().lng()); }); }); google.maps.event.addListener(marker, 'dragend', function() { sendLocation(); utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map imlec tamam', section:'coverage', product:'map', event:'coverage map imlec tamam' }); var point = marker.getPosition(); map.panTo(point); //! TODO // geocoder.geocode({'latLng': marker.getPosition()}, function (results, status) { // if (status == google.maps.GeocoderStatus.OK) { // map.setCenter(results[0].geometry.location); // marker.setPosition(results[0].geometry.location); // $('#address').val(results[0].formatted_address); // $('#lat').val(marker.getPosition().lat()); // $('#lng').val(marker.getPosition().lng()); // } // }); GetReverseGeocoding(marker.getPosition().lat(), marker.getPosition().lng(), null, function(addr) { map.setCenter(marker.getPosition()); marker.setPosition(marker.getPosition()); $('#address').val(addr); $('#lat').val(marker.getPosition().lat()); $('#lng').val(marker.getPosition().lng()); }); }); }); } }); } function openInfoWindow(data) { bounds = new google.maps.LatLngBounds(); bounds.extend(marker.position); var active2G, active3G, active45G; active2G = 'passive'; active3G = 'passive'; active45G = 'passive'; if (data.lte == '1') { active45G = 'active'; // active3G = 'active'; // active2G = 'active'; } if (data.umts == '1') { // active45G = 'passive'; active3G = 'active'; // active2G = 'active'; } if (data.gsm == '1') { // active45G = 'passive'; // active3G = 'passive'; active2G = 'active'; } var descr = ''; if (data.netflix == '1' || data.spotify == '1' || data.twitter == '1' || data.youtube == '1' || data.whatsapp == '1' || data.facebook == '1' || data.instagram == '1') descr = 'Bulunduğunuz noktada aşağıdaki hizmetlere ulaşabilirsiniz:
'; var services = []; var serviceStr = ''; if (data.facebook == '1') services.push('Facebook'); if (data.netflix == '1') services.push('Netflix'); if (data.spotify == '1') services.push('Spotify'); if (data.twitter == '1') services.push('Twitter'); if (data.youtube == '1') services.push('Youtube'); if (data.whatsapp == '1') services.push('WhatsApp'); if (data.instagram == '1') services.push('Instagram'); for (var i=0; i'; if (data.volte == '1') descr = 'Bulunduğunuz noktada HD ses kalitesi ile konuşabilir, aşağıdaki hizmetlerden faydalanabilirsiniz'; infowindow.setContent('
' + '
' + '
' + '
2G
' + '
3G
' + '
4.5G
' + '
' + '
'+descr+'
' + '' + '
' + '
'); infowindow.open(map, marker); setTimeout(function() { $('.gm-style-iw').parent().parent().prev().children().addClass('pin-content'); PinLeft = $('.pin-content').css("left"); PinTop = $('.pin-content').css("top"); //contentTop = $('.pin-content').parent().next().css("top"); contentLeft = $('.pin-content').parent().next().css("left"); PinLeft = parseInt(PinLeft); PinTop = parseInt(PinTop); $('#iw-container').parent().parent().addClass('iw-wrapper'); contentWidth = $('.iw-wrapper').width(); contentHeight = $('.iw-wrapper').height(); contentLeft = (PinLeft - contentWidth + 534); contentTop = (PinTop - contentHeight / 6); $('.pin-content').parent().css('z-index', '99999'); }, 1500); google.maps.event.addListener(infowindow, 'domready', function() { var iwOuter = $('.gm-style-iw'); var iwBackground = iwOuter.prev(); // Removes background shadow DIV iwBackground.children(':nth-child(2)').css({ 'display': 'none' }); // Removes white background DIV iwBackground.children(':nth-child(4)').css({ 'display': 'none' }); // Moves the infowindow iwOuter.parent().parent().css({ left: '-150px', top: '140px' }); // Moves the shadow of the arrow 76px to the left margin. iwBackground.children(':nth-child(1)').attr('style', function(i, s) { return s + 'left: 76px !important;' }); // Moves the arrow 76px to the left margin. iwBackground.children(':nth-child(3)').attr('style', function(i, s) { return s + 'left: 76px !important;' }); // Changes the desired tail shadow color. iwBackground.children(':nth-child(3)').find('div').children().css({ 'box-shadow': 'rgba(72, 181, 233, 0.6) 0px 1px 6px', 'z-index': '1' }); iwOuter.prev().css({ display: 'none' }); // Reference to the div that groups the close button elements. var iwCloseBtn = iwOuter.next(); // Apply the desired effect to the close button iwCloseBtn.css({ opacity: '0', right: '58px', top: '3px', border: '7px solid red', 'border-radius': '13px' }); // If the content of infowindow not exceed the set maximum height, then the gradient is removed. if ($('.iw-content').height() < 140) { $('.iw-bottom-gradient').css({ display: 'none' }); } // The API automatically applies 0.7 opacity to the button after the mouseout event. This function reverses this event to the desired value. iwCloseBtn.mouseout(function() { $(this).css({ opacity: '1' }); }); }); map.fitBounds(bounds); // searchBox.set('map', map); map.addListener('zoom_changed', function() { // 3 seconds after the center of the map has changed, pan back to the // marker. window.setTimeout(function() { map.panTo(marker.getPosition()); map.panBy(0,-90); }, 1000); window.setTimeout(function() { mapFixer(); }, 2000); }); map.setZoom(Math.min(map.getZoom(),17)); } function SelectAddress(markerPoint) { if (!marker) { marker = new google.maps.Marker(); } marker.setMap(null); marker = new google.maps.Marker({ position: new google.maps.LatLng(markerPoint[0], markerPoint[1]), icon: image, draggable: true, animation: google.maps.Animation.DROP, map: map }); // marker.bindTo('map', searchBox, 'map'); google.maps.event.addListener(marker, 'drag', function() { $('.gm-style-iw-d.iw-wrapper').css({ 'display': 'none' }); $('.gm-style .gm-style-iw').css({ 'display': 'none' }); $('.gm-style .gm-style-iw').next().css({ 'display': 'none' }); }); google.maps.event.addListener(marker, 'dragend', function() { sendLocation(); utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map imlec tamam', section:'coverage', product:'map', event:'coverage map imlec tamam' }); $('.gm-style-iw-d.iw-wrapper').css({ 'display': 'block' }); $('.gm-style .gm-style-iw').css({ 'display': 'block' }); $('.gm-style .gm-style-iw').next().css({ 'display': 'block' }); }); google.maps.event.addListener(marker, 'map_changed', function() { if (!this.getMap()) { this.unbindAll(); } }); //now fit the map to the newly inclusive bounds map.fitBounds(bounds); sendLocation(); utag.view({ page_name:'Bireysel:Internet:vodafone 4 5g:coverage map tamam', section:'coverage', product:'map', event:'coverage map tamam' }); } function SetSearchBox() { var startTime = 0; var bloodhoundSuggestions = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: 'https://bms.basarsoft.com.tr/Service/api/v1/autosuggestion/Search?accId=lxS_SUqNVkC4POsgg1lHrQ&appCode=N_OCib9NGEGS5PqAQJlm7w&limit=5&type=5', prepare: function(query, settings) { settings.beforeSend = (function() { startTime = Date.now(); })(); settings.data = {words: query}; return settings; }, // rateLimitBy: 'throttle', // rateLimitWait: 10, transform: function(response) { // log results var dur = Date.now() - startTime; var dsent = $('#pac-input').val(); var drecv = response; var sts; if (drecv == '' || !response) { sts = 'error'; } else if (response.length == 0) { sts = 'noresult'; } else { sts = 'ok'; } var results = []; if (sts == 'ok') { response.forEach(function(suggestion) { results.push({ "name": suggestion[0], "lat": suggestion[8], "lon": suggestion[7] }); }); } console.log('results', results); return results; } } }); $("#pac-input").typeahead("destroy"); $('#pac-input').typeahead({ hint: true, highlight: true, minLength: 1 }, { name: 'suggestions', displayKey: 'name', source: bloodhoundSuggestions, limit: 10 }).on('typeahead:selected', function($e, datum) { var lat = datum.lat; var lon = datum.lon; // ClearSearchMarkers(); SelectAddress([lat, lon]); }); $("#pac-input").unbind('keydown'); $("#pac-input").keydown(function(e) { if (e.which == 13) { console.log('SetSearchBox keyword 13'); if ($("#pac-input").length > 0) { var v; var markerPoint = []; GetGeocoding($("#pac-input").val(), v, null, function(v) { if (v.lat != '' && v.lng != '') { var markerPoint = [v.lat, v.lng]; console.log('markerPoint', markerPoint); // ClearSearchMarkers(); SelectAddress(markerPoint); } }); } else { //there are no suggestions } } }); } function GetGeocoding(address, v, out, callback) { $.getJSON( 'https://bms.basarsoft.com.tr/Service/api/v1/Geocode2extUavt?accId=lxS_SUqNVkC4POsgg1lHrQ&appCode=N_OCib9NGEGS5PqAQJlm7w&q=' + encodeURIComponent(address), function(data) { if (data && data.sonuc_kumesi && data.sonuc_kumesi.length > 0) { if (data.sonuc_kumesi[0]) { v = { in : address, addr: data.sonuc_kumesi[0].posta_adresi, lat: data.sonuc_kumesi[0].enlem, lng: data.sonuc_kumesi[0].boylam }; if (out) { $('#' + out).val($('#' + out).val() + "\n" + JSON.stringify(v)); } if (callback) { callback(v); } sts = 'ok'; } else { console.log('No results found'); } } else { console.log('Geocoder failed due to: ' + status); } } ); } function GetReverseGeocoding(lat, lon, id, callback) { var addr = ''; $.getJSON( 'https://bms.basarsoft.com.tr/Service/api/v1/ReverseGeocodeUAVT?accId=lxS_SUqNVkC4POsgg1lHrQ&appCode=N_OCib9NGEGS5PqAQJlm7w&Max=1000&Lat=' + encodeURIComponent(lat) + '&Lon=' + encodeURIComponent(lon), function(data) { if (data != '') { if (data.CS_ID != '') { addr = ''; if (data.Mahalle_Adi) { addr += ' ' + data.Mahalle_Adi + ' Mh. '; } if (data.Yol_Adi) { addr += ' ' + data.Yol_Adi; } if (data.KapiNo) { addr += ' No: ' + data.KapiNo; } if (data.Il_Adi) { addr += ' ' + data.Il_Adi; } if (data.Ilce_Adi) { addr += ' ' + data.Ilce_Adi; } if (id) { $('#' + id).html(addr); } if (callback) { callback(addr); } return addr; } else { console.log('No results found'); } } else { console.log('Geocoder failed due to: ' + status); } } ); } } $(document).ready(function(){ var mobileSize = function(){ var windowWidth = $(window).width(); if(windowWidth<820){ $('input').click(function(){ $('.head-holder p').slideUp(); $('.head-holder').css('height', '26vw') $('.wrap-map .map').css('height', '520px'); }); } } mobileSize(); // Bu kısım entegrasyonda açılıcak. $('body').on('click', '#btnCaptcha', function(e) { e.preventDefault(); $.getJSON('check-robot.php?task=validate&captcha=' + $('#txtCaptcha').val(), function(data) { CheckRobot(); }); }); window.setTimeout(function() { mapFixer(); }, 3000); }); $(window).resize(function() { // mobileSize(); mapFixer(); }); /* ROBOT CHECK */ var robotCheckInProgress = false; var robotCheckStatus = false; function CheckRobot() { if (robotCheckInProgress) return; robotCheckInProgress = true; $.getJSON('check-robot.php', function(data) { if (data.status && !data.maxLimitStatus) { var contentString = '\
\ Lütfen aşağıdaki kodu giriniz.

\
\
\
\
\
\
'; $('#robot-check').html(contentString) $('#robot-check').css('display', 'table-cell'); robotCheckStatus = true; } else if (data.status && data.maxLimitStatus) { var contentString = '\
\ Günlük kullanım limitini aştınız.
\ Lütfen daha sonra yeniden deneyiniz. \
'; $('#robot-check').html(contentString) $('#robot-check').css('display', 'table-cell'); robotCheckStatus = true; } else { $('#robot-check').html('') $('#robot-check').css('display', 'none'); robotCheckStatus = false; } robotCheckInProgress = false; }); }