{"id":11074,"date":"2020-10-20T10:55:43","date_gmt":"2020-10-20T08:55:43","guid":{"rendered":"https:\/\/ebroh.es\/punti-vendita\/"},"modified":"2023-04-27T11:09:49","modified_gmt":"2023-04-27T09:09:49","slug":"punti-vendita","status":"publish","type":"page","link":"https:\/\/ebroh.eu\/it\/punti-vendita\/","title":{"rendered":"Punti vendita"},"content":{"rendered":"<p><div>     \n    <input id=\"pac-input\" class=\"controls\" type=\"text\" placeholder=\"Buscar...\">\n    <div class=\"container\" id=\"map-canvas\" style=\"height:400px;\"><\/div>\n<\/div>\n\n\n<script type=\"text\/javascript\">\n    var gmarkers = [];\n    var infoWindows = [];\n    \n    function initialize()\n    {\n        var lat_lng = {lat: 40.4637, lng: 3.7492};\n        var lat_lang_count = 0;\n        var default_zoom = 5;\n        var default_lat_settings = '39.8581';\n        var default_lang_settings = '-4.02263';\n\t\t\n                        default_zoom = 5        \n        if (default_lat_settings !== '' && default_lang_settings !== '')\n        {\n            map = new google.maps.Map(document.getElementById('map-canvas'), {\n                zoom: default_zoom,\n                center: new google.maps.LatLng(default_lat_settings, default_lang_settings),\n                mapTypeId: google.maps.MapTypeId.ROADMAP,\n                disableDefaultUI: true\n            });\n        }\n        else\n        {\n            map = new google.maps.Map(document.getElementById('map-canvas'), {\n                zoom: default_zoom,\n                center: lat_lng,\n                mapTypeId: google.maps.MapTypeId.ROADMAP,\n                disableDefaultUI: true\n            });\n        }\n          \n          \n        var searchBox = new google.maps.places.SearchBox(document.getElementById('pac-input'));\n        map.controls[google.maps.ControlPosition.TOP_CENTER].push(document.getElementById('pac-input'));\n        \n        google.maps.event.addListener(map, 'click', function() {\n            infowindow.close();\n        });\n\n        google.maps.event.addListener(searchBox, 'places_changed', function () {\n            searchBox.set('map', null);\n            var places = searchBox.getPlaces();\n\n            var bounds = new google.maps.LatLngBounds();\n            var i, place;\n            for (i = 0; place = places[i]; i++) {\n                (function (place) {\n                    var marker = new google.maps.Marker({\n                    });\n                    marker.bindTo('map', searchBox, 'map');\n                    google.maps.event.addListener(marker, 'map_changed', function () {\n                        if (!this.getMap()) {\n                            this.unbindAll();\n                        }\n                    });\n                    bounds.extend(place.geometry.location);\n\n\n                }(place));\n\n            }\n            map.fitBounds(bounds);\n            searchBox.set('map', map);\n            map.setZoom(Math.min(map.getZoom(), 12));\n\n        });\n\t\t\n\t\tjQuery(function() {\n\t\t\n\t\t});\n    \n        if(lat_lang_count>0)\n        {\n            google.maps.event.addListener(marker, 'click', function() {\n                infowindow.open(map,marker);\n            });\n\n            google.maps.event.addListener(map, 'click', function() {\n                infowindow.close();\n            });\n\n        }\n         \n    }\n    \n    \n    function bindInfoWindow(marker, map, infowindow, html,latLng) {\n        marker.addListener('click', function () {\n            infowindow.setContent(html);\n            infowindow.open(map, this);\n            infowindow.setPosition(latLng);\n        });\n    }\n\ninitialize();\n<\/script><br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-11074","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/pages\/11074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/comments?post=11074"}],"version-history":[{"count":1,"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/pages\/11074\/revisions"}],"predecessor-version":[{"id":13150,"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/pages\/11074\/revisions\/13150"}],"wp:attachment":[{"href":"https:\/\/ebroh.eu\/it\/wp-json\/wp\/v2\/media?parent=11074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}