( function ( $, document, window, google, rwmb, i18n ) { 'use strict'; // Use function construction to store map & DOM elements separately for each instance var MapField = function ( $container ) { this.$container = $container; }; // Geocoder service. var geocoder = new google.maps.Geocoder(); // Autocomplete Service. var autocomplete = new google.maps.places.AutocompleteService(); // Use prototype for better performance MapField.prototype = { // Initialize everything init: function () { this.initDomElements(); this.initMapElements(); this.initMarkerPosition(); this.addListeners(); this.autocomplete(); }, // Initialize DOM elements initDomElements: function () { this.$canvas = this.$container.find( '.rwmb-map-canvas' ); this.canvas = this.$canvas[0]; this.$coordinate = this.$container.find( '.rwmb-map' ); this.addressField = this.$container.data( 'address-field' ); }, // Initialize map elements initMapElements: function () { var defaultLoc = this.$canvas.data( 'default-loc' ), latLng; defaultLoc = defaultLoc ? defaultLoc.split( ',' ) : [53.346881, - 6.258860]; latLng = new google.maps.LatLng( defaultLoc[0], defaultLoc[1] ); // Initial position for map this.map = new google.maps.Map( this.canvas, { center: latLng, zoom: 14, streetViewControl: 0, mapTypeId: google.maps.MapTypeId.ROADMAP } ); this.marker = new google.maps.Marker( {position: latLng, map: this.map, draggable: true} ); }, // Initialize marker position initMarkerPosition: function () { var coordinate = this.$coordinate.val(), location, zoom; if ( coordinate ) { location = coordinate.split( ',' ); this.marker.setPosition( new google.maps.LatLng( location[0], location[1] ) ); zoom = location.length > 2 ? parseInt( location[2], 10 ) : 14; this.map.setCenter( this.marker.position ); this.map.setZoom( zoom ); } else if ( this.addressField ) { this.geocodeAddress( false ); } }, // Add event listeners for 'click' & 'drag' addListeners: function () { var that = this; /* * Auto change the map when there's change in address fields. * Works only for multiple address fields as single address field has autocomplete functionality. */ if ( this.addressField.split( ',' ).length > 1 ) { var geocodeAddress = that.geocodeAddress.bind( that ); var addressFields = this.addressField.split( ',' ).forEach( function( part ) { var $field = that.findAddressField( part ); if ( null !== $field ) { $field.on( 'change', geocodeAddress ); } } ); } google.maps.event.addListener( this.map, 'click', function ( event ) { that.marker.setPosition( event.latLng ); that.updateCoordinate( event.latLng ); } ); google.maps.event.addListener( this.map, 'zoom_changed', function ( event ) { that.updateCoordinate( that.marker.getPosition() ); } ); google.maps.event.addListener( this.marker, 'drag', function ( event ) { that.updateCoordinate( event.latLng ); } ); /** * Custom event to refresh maps when in hidden divs. * @see https://developers.google.com/maps/documentation/javascript/reference ('resize' Event) */ var refresh = that.refresh.bind( this ); $( window ).on( 'rwmb_map_refresh', refresh ); // Refresh on meta box hide and show rwmb.$document.on( 'postbox-toggled', refresh ); // Refresh on sorting meta boxes $( '.meta-box-sortables' ).on( 'sortstop', refresh ); }, refresh: function () { if ( ! this.map ) { return; } var zoom = this.map.getZoom(), center = this.map.getCenter(); google.maps.event.trigger( this.map, 'resize' ); this.map.setZoom( zoom ); this.map.panTo( center ); }, // Autocomplete address autocomplete: function () { var that = this, $address = this.getAddressField(); if ( null === $address ) { return; } // If Meta Box Geo Location installed. Do not run autocomplete. if ( $( '.rwmb-geo-binding' ).length ) { var geocodeAddress = that.geocodeAddress.bind( that ); $address.on( 'selected_address', geocodeAddress ); return false; } $address.autocomplete( { source: function ( request, response ) { // if add region only search in that region var options = { 'input': request.term, 'componentRestrictions': { country: that.$canvas.data( 'region' ) } }; // Change Geocode to getPlacePredictions . autocomplete.getPlacePredictions( options, function ( results ) { if ( results == null || ! results.length ) { response( [ { value: '', label: i18n.no_results_string } ] ); return; } response( results.map( function ( item ) { return { label: item.description, value: item.description, placeid: item.place_id, }; } ) ); } ); }, select: function ( event, ui ) { geocoder.geocode( { 'placeId': ui.item.placeid }, function( responses, status ) { if ( status == 'OK' ) { var latLng = new google.maps.LatLng( responses[0].geometry.location.lat(), responses[0].geometry.location.lng() ); that.map.setCenter( latLng ); that.marker.setPosition( latLng ); that.updateCoordinate( latLng ); } } ); } } ); }, // Update coordinate to input field updateCoordinate: function ( latLng ) { var zoom = this.map.getZoom(); this.$coordinate.val( latLng.lat() + ',' + latLng.lng() + ',' + zoom ).trigger( 'change' ); }, // Find coordinates by address geocodeAddress: function ( notify ) { var address = this.getAddress(), that = this; if ( ! address ) { return; } if ( false !== notify ) { notify = true; } geocoder.geocode( {'address': address}, function ( results, status ) { if ( status !== google.maps.GeocoderStatus.OK ) { if ( notify ) { alert( i18n.no_results_string ); } return; } that.map.setCenter( results[0].geometry.location ); that.marker.setPosition( results[0].geometry.location ); that.updateCoordinate( results[0].geometry.location ); } ); }, // Get the address field. getAddressField: function() { // No address field or more than 1 address fields, ignore if ( ! this.addressField || this.addressField.split( ',' ).length > 1 ) { return null; } return this.findAddressField( this.addressField ); }, // Get the address value for geocoding. getAddress: function() { var that = this; return this.addressField.split( ',' ) .map( function( part ) { part = that.findAddressField( part ); return null === part ? '' : part.val(); } ) .join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' ); }, // Find address field based on its name attribute. Auto search inside groups when needed. findAddressField: function( fieldName ) { // Not in a group. var $address = $( 'input[name="' + fieldName + '"]'); if ( $address.length ) { return $address; } // If map and address is inside a cloneable group. $address = this.$container.closest( '.rwmb-group-clone' ).find( 'input[name*="[' + fieldName + ']"]' ); if ( $address.length ) { return $address; } // If map and address is inside a non-cloneable group. $address = this.$container.closest( '.rwmb-group-wrapper' ).find( 'input[name*="[' + fieldName + ']"]' ); if ( $address.length ) { return $address; } return null; } }; function createController() { var $this = $( this ), controller = $this.data( 'mapController' ); if ( controller ) { return; } controller = new MapField( $this ); controller.init(); $this.data( 'mapController', controller ); } function init( e ) { $( e.target ).find( '.rwmb-map-field' ).each( createController ); } function restart() { $( '.rwmb-map-field' ).each( createController ); } rwmb.$document .on( 'mb_ready', init ) .on( 'clone', '.rwmb-input', restart ); } )( jQuery, document, window, google, rwmb, RWMB_Map ); https://peterpolacek.sk/ 2025-01-15T16:59:29+00:00 https://peterpolacek.sk/clanky/ 2025-07-12T08:41:33+00:00 https://peterpolacek.sk/o-mne/ 2025-01-10T11:47:07+00:00 https://peterpolacek.sk/kontakt/ 2025-01-10T11:46:55+00:00 https://peterpolacek.sk/ucretsiz-rulet-oyunu-cevrimici-kumarhane-sahnesinde-hemen-baslayin-rulet-oyunu-hemen-oyna/ 2025-07-13T17:10:26+00:00 https://peterpolacek.sk/graj-w-najlepsze-gry-kasynowe-online-zarejestruj-sie-teraz-w-gransino-casino/ 2025-07-10T20:43:35+00:00 https://peterpolacek.sk/wildrobin-wspaniala-sposobnosc-grac-w-kasynie-online-w-polsce/ 2025-07-08T01:46:54+00:00 https://peterpolacek.sk/stastie-cierna-magia-a-pobytovy-seminar-v-bulharsku/ 2025-06-26T16:34:01+00:00 https://peterpolacek.sk/pobytovy-seminar-v-bulharsku-primorsko/ 2025-06-26T16:34:14+00:00 https://peterpolacek.sk/seminar-clovek-a-jeho-vedomie-byt-versus-mat/ 2025-06-26T16:34:27+00:00 https://peterpolacek.sk/seminar-na-temu-zivot-a-sloboda-cloveka/ 2025-06-26T16:34:39+00:00 https://peterpolacek.sk/svobodny-vysilac-svcs-studio-raj-janka-a-peter/ 2025-06-26T16:34:50+00:00 https://peterpolacek.sk/stvrta-cast-doslovu-knihy-sam-vojak-v-poli-2-trinasta-komnata-roztrhnutie-chramovej-opony-alebo-mudrost-z-trinastej-komnaty/ 2025-06-26T16:35:01+00:00 https://peterpolacek.sk/juraj-dobrotka-versus-matovicova-zlocinecka-vlada-3-cast/ 2025-06-26T16:35:11+00:00 https://peterpolacek.sk/juraj-dobrotka-versus-matovicova-zlocinecka-vlada-2-cast/ 2025-06-26T16:35:22+00:00 https://peterpolacek.sk/juraj-dobrotka-versus-matovicova-zlocinecka-vlada-1-cast/ 2025-06-26T16:35:32+00:00 https://peterpolacek.sk/50-kapitola-knihy-sam-vojak-v-poli-2-trinasta-komnata-zmena-nove-nebo-a-nova-zem-alebo-posledne-slova-autora-dokoncenie/ 2025-06-26T16:35:43+00:00 https://peterpolacek.sk/50-kapitola-knihy-sam-vojak-v-poli-2-trinasta-komnata-zmena-nove-nebo-a-nova-zem-alebo-posledne-slova-autora/ 2025-06-26T16:35:53+00:00 https://peterpolacek.sk/vianocne-posolstvo/ 2025-06-26T16:36:04+00:00 https://peterpolacek.sk/recenzia-viacurovnovej-trilogie-vedma-ved-ma-tretia-vyznamova-uroven/ 2025-06-26T16:36:13+00:00 https://peterpolacek.sk/recenzia-viacurovnovej-trilogie-vedma-ved-ma-druha-vyznamova-uroven/ 2025-06-26T16:36:23+00:00 https://peterpolacek.sk/inferno-laska-a-jedna-cesta/ 2025-06-26T16:36:33+00:00 https://peterpolacek.sk/do-roka-a-do-dna-alebo-lehota-dvadsiatich-styroch-starcov-2/ 2025-06-26T16:36:42+00:00 https://peterpolacek.sk/do-roka-a-do-dna-alebo-lehota-dvadsiatichstyroch-starcov/ 2025-06-26T16:36:51+00:00 https://peterpolacek.sk/celodenne-seminare-skoly-murosti/ 2025-06-26T16:37:00+00:00 https://peterpolacek.sk/sam-vojak-v-poli-1-zaciatky/ 2025-06-26T16:37:09+00:00 https://peterpolacek.sk/konceptualna-moc-a-peklo/ 2025-06-26T16:37:18+00:00 https://peterpolacek.sk/vernost-posledny-templarsky-velmajster-a-zlatovlaska/ 2025-06-26T16:37:28+00:00 https://peterpolacek.sk/svata-stolica-a-vrazda-reneho-balaka/ 2025-06-26T16:37:36+00:00 https://peterpolacek.sk/skola-mudrosti-skola-mimozmysloveho-vnimania/ 2025-06-26T16:37:45+00:00 https://peterpolacek.sk/ochorenia-ludskeho-tela-a-ich-liecenie-v-kontexte-ukoncovania-prevadzky-interaktivnej-simulacie-reality-zem/ 2025-06-26T16:37:55+00:00 https://peterpolacek.sk/nova-struktura-bytia-realita-vecneho-zivota-realita-slavienska-krajina/ 2025-06-26T16:38:04+00:00 https://peterpolacek.sk/recenzia-viacurovnovej-trilogie-vedma-ved-ma-prva-vyznamova-uroven/ 2025-06-26T16:38:13+00:00 https://peterpolacek.sk/v-mene-ducha-otca-i-syna-alebo-o-kostiach-krvi-a-mase/ 2025-06-26T16:38:22+00:00 https://peterpolacek.sk/vyhlasenie-o-obnoveni-nezavislosti-a-neutrality-slavienslej-slovenskej-krajiny-ktore-moze-sam-za-seba-vykonat-kazdy-kto-sa-s-nim-stotoznuje/ 2025-06-26T16:38:30+00:00 https://peterpolacek.sk/nezavisla-a-neutralna-slavienska-slovenska-krajina/ 2025-06-26T16:38:38+00:00 https://peterpolacek.sk/nedovolene-pouzivanie-nasilia-konceptualnou-mocou/ 2025-06-26T16:38:47+00:00 https://peterpolacek.sk/vyvoj-struktury-konceptualnej-moci/ 2025-06-26T16:38:55+00:00 https://peterpolacek.sk/konceptualna-moc-posobenie-piatej-kolony-a-nasilne-pokrestancovanie-na-uzemi-byvalej-slavienskej-krajiny/ 2025-06-26T16:39:03+00:00 https://peterpolacek.sk/peter-kolecek-recenzia-trilogie-vedma-ved-ma/ 2025-06-26T16:39:12+00:00 https://peterpolacek.sk/katarina-kapralova-recenzia-trilogie-vedma-ved-ma/ 2025-06-26T16:39:19+00:00 https://peterpolacek.sk/jan-rusnak-recenzia-trilogie-vedma-ved-ma/ 2025-06-26T16:39:27+00:00 https://peterpolacek.sk/plne-pochopenie-posledneho-kroku-reverzneho-vratneho-procesu-stvorenia-sveta/ 2025-06-26T16:39:35+00:00 https://peterpolacek.sk/posledny-krok-reverzneho-vratneho-procesu-stvorenia-sveta/ 2025-06-26T16:39:43+00:00 https://peterpolacek.sk/koniec-reverzny-vratny-proces-stvorenia/ 2025-06-26T16:39:51+00:00 https://peterpolacek.sk/pociatok-3-stvorenie-sveta/ 2025-06-26T16:39:59+00:00 https://peterpolacek.sk/pociatok-2-minulost-pritomnost-a-buducnost/ 2025-06-26T16:40:07+00:00 https://peterpolacek.sk/pociatok-1-identita-priestor-a-cas/ 2025-06-26T16:40:14+00:00 https://peterpolacek.sk/zabudnuty-vyznam-slov-slavien-slovan-krestan/ 2025-06-26T16:40:22+00:00 https://peterpolacek.sk/odhalovanie-utajovaneho-poznania-5-kriz-a-ukrizovanie/ 2025-06-26T16:40:30+00:00 https://peterpolacek.sk/odhalovanie-utajovaneho-poznania-4-osidlenie-reality-zem-a-krst/ 2025-06-26T16:40:37+00:00 https://peterpolacek.sk/odhalovanie-utajovaneho-poznania-3-dusa/ 2025-06-26T16:40:45+00:00 https://peterpolacek.sk/odhalovanie-utajovaneho-poznania-2-zivot-a-smrt/ 2025-06-26T16:40:52+00:00 https://peterpolacek.sk/odhalovanie-utajovaneho-poznania-1-konceptualna-moc/ 2025-06-26T16:40:59+00:00 https://peterpolacek.sk/meno-selmy-je-vedma/ 2025-06-26T16:41:07+00:00 https://peterpolacek.sk/posledne-proroctvo/ 2025-06-26T16:41:14+00:00 https://peterpolacek.sk/inferno-riesenie/ 2025-06-26T16:41:21+00:00 https://peterpolacek.sk/bytie-nebytie-inferno/ 2025-06-26T16:41:28+00:00 https://peterpolacek.sk/cit-lubosti-emocia-moci-inferno/ 2025-06-26T16:41:35+00:00 https://peterpolacek.sk/ty-si-ja-som-inferno/ 2025-06-26T16:41:42+00:00 https://peterpolacek.sk/ziva-voda-princip-volby/ 2025-06-26T16:41:49+00:00 https://peterpolacek.sk/bohatiersky-mec-princip-volby/ 2025-06-26T16:41:56+00:00 https://peterpolacek.sk/kriz-viery-princip-volby/ 2025-06-26T16:42:02+00:00 https://peterpolacek.sk/strom-zivota-svedectvo-pravdy/ 2025-06-26T16:42:09+00:00 https://peterpolacek.sk/zakliatie-svedectvo-pravdy/ 2025-06-26T16:42:16+00:00 https://peterpolacek.sk/zakazana-komnata/ 2025-06-26T16:42:23+00:00 https://peterpolacek.sk/vedma-ved-ma/ 2025-06-26T16:42:30+00:00 https://peterpolacek.sk/laska-koncepcia-ty-si/ 2025-06-26T16:42:37+00:00 https://peterpolacek.sk/radostna-zvest/ 2025-06-26T16:42:43+00:00 https://peterpolacek.sk/syn-cloveka/ 2025-06-26T16:42:51+00:00 https://peterpolacek.sk/systemova-zmena/ 2025-06-26T16:42:58+00:00 https://peterpolacek.sk/3-cast-nelegalna-predvolebna-kampan-alebo-co-odhalili-predvolebne-diskusie-kandidatov-na-primatora-bratislavy/ 2025-06-26T16:43:04+00:00 https://peterpolacek.sk/2-cast-nelegalna-predvolebna-kampan-alebo-co-odhalili-predvolebne-diskusie-kandidatov-na-primatora-bratislavy/ 2025-06-26T16:43:10+00:00 https://peterpolacek.sk/1-cast-nelegalna-predvolebna-kampan-alebo-co-odhalili-predvolebne-diskusie-kandidatov-na-primatora-bratislavy/ 2025-06-26T16:43:17+00:00 https://peterpolacek.sk/ty-si-peter-skala-alebo-ako-sa-kalila-skala-6-cast-dokoncenie-systemova-zmena-ma-cislo-6-kto-voli-zmenu-voli-cislo-6/ 2025-06-26T16:43:23+00:00 https://peterpolacek.sk/tv-joj-diskriminuje-kandidatov/ 2025-06-26T16:43:30+00:00 https://peterpolacek.sk/ty-si-peter-skala-alebo-ako-sa-kalila-skala-5-cast-za-primatora-bratislavy-kandidujem-pod-cislom-6/ 2025-06-26T16:43:36+00:00 https://peterpolacek.sk/ty-si-peter-skala-alebo-ako-sa-kalila-skala-4-cast-obrazom-cesty-mojho-zivota-je-cislo-6/ 2025-06-26T16:43:42+00:00 https://peterpolacek.sk/ty-si-peter-skala-alebo-ako-sa-kalila-skala-3-cast/ 2025-06-26T16:43:48+00:00 https://peterpolacek.sk/ty-si-peter-skala-alebo-ako-sa-kalila-skala-2-cast/ 2025-06-26T16:43:54+00:00 https://peterpolacek.sk/ty-si-peter-skala-alebo-ako-sa-kalila-skala-1-cast/ 2025-06-26T16:44:01+00:00 https://peterpolacek.sk/vizitka-profesionala/ 2025-06-26T16:44:07+00:00 https://peterpolacek.sk/prilivova-vlna-ako-sa-stat-mojim-spolupracovnikom/ 2025-06-26T16:44:13+00:00 https://peterpolacek.sk/navrh-zmluvy-medzi-mnou-a-ludom-mesta-bratislava/ 2025-06-26T16:44:18+00:00 https://peterpolacek.sk/financovanie-rychlodrahy-slavin-riesenie/ 2025-06-26T16:44:24+00:00 https://peterpolacek.sk/uvod-k-financovaniu-rychlodrahy-slavin-aktualny-stav-prava-v-slovenskej-republike/ 2025-06-26T16:44:30+00:00 https://peterpolacek.sk/financovanie-rychlodrahy-slavin-co-sa-skryva-za-pravnou-subjektivitou-slovenskej-republiky-2-cast-dokoncenie/ 2025-06-26T16:44:35+00:00 https://peterpolacek.sk/financovanie-rychlodrahy-slavin-co-sa-skryva-za-pravnou-subjektivitou-slovenskej-republiky-1-cast/ 2025-06-26T16:44:41+00:00 https://peterpolacek.sk/rychlodraha-slavin-priklad-wild-brucke/ 2025-06-26T16:44:46+00:00 https://peterpolacek.sk/ing-peter-polacek-novy-primator-bratislavy/ 2025-06-26T16:44:52+00:00 https://peterpolacek.sk/priprava-vystavby-rychlodrahy-slavin/ 2025-06-26T16:44:57+00:00 https://peterpolacek.sk/montaz-nosnej-konstrukcie-rychlodrahy-slavin/ 2025-06-26T16:45:02+00:00 https://peterpolacek.sk/nosna-konstrukcia-rychlodrahy-slavin/ 2025-06-26T16:45:09+00:00 https://peterpolacek.sk/rychlodraha-slavin-inteligentne-a-zelene-mesto/ 2025-06-26T16:45:14+00:00 https://peterpolacek.sk/riadiaci-system-rychlodrahy-slavin/ 2025-06-26T16:45:20+00:00 https://peterpolacek.sk/tbuilder-layout/stranky/ 2022-09-25T11:37:49+00:00 https://peterpolacek.sk/navrh-siete-rychlodrahy-slavin/ 2025-06-26T16:45:26+00:00 https://peterpolacek.sk/spolupracujem-a-volim-bratislavu/ 2025-06-26T16:45:31+00:00 https://peterpolacek.sk/tglobal-style/tb_gs28614/ 2022-09-20T07:53:28+00:00 https://peterpolacek.sk/financovanie-rychlodrahy-slavin/ 2025-06-26T16:45:37+00:00 https://peterpolacek.sk/naplnene-proroctvo-a-rychlodraha-slavin/ 2025-06-26T16:45:43+00:00 https://peterpolacek.sk/radikalna-zmena-systemu-vyrubovania-dane-z-nehnutelnosti-v-bratislave/ 2025-06-26T16:45:48+00:00 https://peterpolacek.sk/voda-a-zivot/ 2025-06-26T16:45:54+00:00 https://peterpolacek.sk/doprava-a-dopravna-infrastruktura/ 2025-06-26T16:45:59+00:00 https://peterpolacek.sk/recensione-gioco-plinko-a-soldi-veri-regole-consigli-e-dove-giocare/ 2025-07-07T09:35:40+00:00