{"id":14516,"date":"2020-09-29T16:00:14","date_gmt":"2020-09-29T14:00:14","guid":{"rendered":"https:\/\/www.diocesiravennacervia.it\/?page_id=14516"},"modified":"2020-09-29T16:00:14","modified_gmt":"2020-09-29T14:00:14","slug":"territorio","status":"publish","type":"page","link":"https:\/\/www.diocesiravennacervia.it\/oldsite\/territorio\/","title":{"rendered":"Territorio"},"content":{"rendered":"\t<style>\n\t\t.pim_container ul {\n\t\t\tlist-style-type: none;\n\t\t\tpadding-left:0;\n\t\t\tmargin-left:0;\n\t\t}\n\t\tbutton.pim_button {\n\t\t\twidth:96%;\n\t\t\ttext-align:left;\n\t\t\tpadding:10px 15px;\n\t\t\tbackground:#f5f5f5;\n\t\t\tborder:0;\n\t\t\tborder-bottom:1px solid #e0e0e0;\n\t\t\tborder-radius:0;\n\t\t\tfont-size:16px;\n\t\t\tcolor:#0f0f0f;\n\t\t\tcursor:pointer;\n\t\t}\n\t\ta.pim_link_to_post {\n\t\t\twidth:4%;\n\t\t\tdisplay:inline-block;\n\t\t\tfloat:right;\n\t\t\ttext-align:center;\n\t\t\tline-height:15px;\n\t\t\tfont-size:18px;\n\t\t\tpadding:10px 0; \n\t\t\tcolor:#8f8f8f; \n\t\t\ttext-decoration: none;\n\t\t}\n\t\ta.pim_link_to_post:hover {\n\t\t\tcolor:#008EC2;\n\t\t}\n\t\tbutton.pim_button.pim_active {\n\n\t\t\tbackground:#fff;\n\t\t\tcolor:#000;\n\t\t}\n\t\tbutton.pim_button.pim_active li{\n\n\t\t\tbackground:#fff;\n\t\t\tcolor:#000;\n\t\t}\n\t\tbutton.pim_button:hover {\n\t\t\ttext-decoration: underline;\n\t\t\tbackground:#fff;\n\t\t}\n\t\tli.has_child ul {\n\t\t\tmargin-left:15px;\n\t\t}\n\t\t.pim_loading {\n\t\t\tpadding:10px;\n\t\t\tdisplay: inline-block;\n\n\t\t\tcolor:#5f5f5f;\n\t\t}\n\t\t.pim_tree ul{\n\t\t\tborder-left: 1px solid #e0e0e0;\n\n\t\t}\n\t\t.pim_container {\n\t\t\tbackground:#f0f0f0;\n\t\t\tborder:1px solid #e5e5e5;\n\t\t\tmargin:0 auto;\n\t\t\twidth:100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-flow: row wrap;\n\t\t\talign-items:stretch;\n\t\t\t-webkit-box-shadow: 0px 0px 12px 0px rgba(50, 50, 50, 0.46);\n\t\t\t-moz-box-shadow:    0px 0px 12px 0px rgba(50, 50, 50, 0.46);\n\t\t\tbox-shadow:         0px 0px 12px 0px rgba(50, 50, 50, 0.46);\n\t\t}\n\t\t.pim_map {\n\t\t\tbackground:#eaeaea;\n\t\t\theight:600px;\n\n\t\t}\n\t\t.pim_tree {\n\t\t\tbackground:#eaeaea;\n\t\t\theight:600px!important;\n\t\t}\n\t\t@media only screen and (max-width: 568px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {\n\t\t\t.pim_container {\n\t\t\t\theight:100vh!important;\n\t\t\t\twidth:100%!important;\n\n\t\t\t}\n\t\t\t.pim_map {\n\t\t\t\theight:50vh!important;\n\t\t\t\twidth:100%!important;\n\t\t\t}\n\t\t\t.pim_tree {\n\t\t\t\theight:45vh!important;\n\t\t\t\twidth:100%!important;\n\t\t\t}\n\t\t}\t\n\t<\/style>\n\t<script id=\"app_script_6a3b9bcfabdb0\">\n\t        app6a3b9bcfabdb0 = {\n\t            id: \"6a3b9bcfabdb0\",\n\t            config:{\"address\":\"\",\"post_parent\":\"14481\",\"post_type\":\"wd-annuario-enti\",\"kml\":\"\",\"loadBranchKml\":\"yes\",\"zoom\":10,\"tax\":\"\",\"terms\":\"\"},\n\t            container: null,\n\t            parentContainer: document.getElementById(\"app_script_6a3b9bcfabdb0\").parentNode,\n\t            cache: {},\n\t            init: function () {\n\t                app = app6a3b9bcfabdb0;\n\t                app.utility.prepareContainer();\n\t                app.map.init();\n\t                app.tree.init();\n\t                pimappstarted = true;\n\t                \/\/  console.log(app);\n\t            },\n\t            map: {\n\t                id: \"map_6a3b9bcfabdb0\",\n\t                container: null,\n\t                gmap: null,\n\t                kml: null,\n\t                bounds: null,\n\t                markers: {},\n\t                infowindows: {},\n\t                init: function () {\n\t                    app = app6a3b9bcfabdb0;\n\t\t\t\t                    var osmUrl = \"https:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png\";\n\t\t                    \/\/var osmUrl = \"http:\/\/toolserver.org\/tiles\/hikebike\/{z}\/{x}\/{y}.png\";\n\t\t                    \/\/var osmUrl = \"http:\/\/gsp2.apple.com\/tile?api=1&style=slideshow&layers=default&lang=it_IT&z={z}&x={x}&y={y}&v=9\";\n\t\t                    var osmAttrib = \"Map data \u00a9 <a href=\\\"https:\/\/openstreetmap.org\\\">OpenStreetMap<\/a> contributors\";\n\t\t                    var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 19, attribution: osmAttrib});\n\t\t                    app.map.gmap = L.map(app.map.id, {worldCopyJump: true});\n\t\t                    app.map.gmap.setView(new L.LatLng(41.902273, 12.483126), app.config.zoom);\n\t\t                    app.map.gmap.addLayer(osm);\n\t\t                    app.map.bounds = new L.LatLngBounds();\n\n\t\t                    if (app.config.address != \"\") {\n\t\t                        jQuery.ajax({\n\t\t                            url: 'https:\/\/nominatim.openstreetmap.org\/search?format=json&q=' + app.config.address,\n\t\t                            dataType: 'json',\n\t\t                            success: function (data) {\n\t\t                                app.map.gmap.panTo(new L.LatLng(data[0].lat, data[0].lon));\n\t\t                                app.map.gmap.setZoom(app.config.zoom);\n\t\t                            }\n\t\t                        });\n\t\t                    }\n\t\t\t                    if (app.config.kml != \"\") {\n\t                        app.map.drawKml(app.config.kml);\n\t                    }\n\n\t                },\n\t                removeMarkers: function () {\n\t                    app = app6a3b9bcfabdb0;\n\t                    for (marker in app.map.markers) {\n\t\t\t\t                        app.map.gmap.removeLayer(app.map.markers[marker]);\n\t\t\t                    }\n\t                },\n\t                drawMarker: function (entry) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    if (\n\t                            entry.geo &&\n\t                            entry.geo.lat &&\n\t                            entry.geo.lng\n\t                            ) {\n\t                        var icon = null;\n\t                        if (\n\t                                entry.custom_marker &&\n\t                                entry.custom_marker.url\n\t                                ) {\n\t                            icon = entry.custom_marker.url;\n\t                        }\n\n\t\t\t\t                        if (icon != null) {\n\t\t                            app.map.markers[entry.ID] = marker = new L.marker([parseFloat(entry.geo.lat), parseFloat(entry.geo.lng)], {icon: icon}).addTo(app.map.gmap);\n\t\t                        } else {\n\t\t                            app.map.markers[entry.ID] = marker = new L.marker([parseFloat(entry.geo.lat), parseFloat(entry.geo.lng)]).addTo(app.map.gmap);\n\t\t                        }\n\t\t                        app.map.markers[entry.ID].bindPopup(\"<a href=\\\"https:\/\/www.diocesiravennacervia.it\/oldsite\/?p=\" + entry.ID + \"&post_type=\" + entry.post_type + \"\\\">\" + entry.post_title + \"<\/a>\");\n\t\t                        app.map.gmap.panTo(new L.LatLng(entry.geo.lat, entry.geo.lng));\n\t\t                        app.map.bounds.extend(marker.getLatLng());\n\t\t                        app.map.gmap.fitBounds(app.map.bounds);\n\t\t\n\n\t                    }\n\t                },\n\t                drawKml: function (kml) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    app.map.removeKml();\n\t\t\n\t\t                    app.map.kml = omnivore.kml(kml).addTo(app.map.gmap);\n\n\t\t\t                },\n\t                removeKml: function () {\n\t                    app = app6a3b9bcfabdb0;\n\t                    if (app.map.kml != null) {\n\t\t\t\t                        app.map.gmap.removeLayer(app.map.kml);\n\t\t\t                        app.map.kml = null;\n\t                    }\n\t                },\n\t            },\n\t            tree: {\n\t                id: \"tree_6a3b9bcfabdb0\",\n\t                container: null,\n\t                branchContainer: null,\n\t                branches: {},\n\t                init: function () {\n\t                    app = app6a3b9bcfabdb0;\n\t                    app.utility.getEntries(\n\t                            {\n\t                                action: \"seed_localizzation_get_posts\",\n\t                                post_parent: app6a3b9bcfabdb0.config.post_parent,\n\t                                post_type: app6a3b9bcfabdb0.config.post_type,\n\t                                tax: app6a3b9bcfabdb0.config.tax,\n\t                                terms: app6a3b9bcfabdb0.config.terms\n\t                            },\n\t                            function (entries) {\n\t                                app = app6a3b9bcfabdb0;\n\t                                app.tree.drawBranches(entries, app.tree);\n\t                            }\n\t                    );\n\t                },\n\t                drawBranches: function (entries, tree) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    app.map.removeMarkers();\n\t                    if (tree.branchContainer.loader != null) {\n\t                        tree.branchContainer.removeChild(tree.branchContainer.loader);\n\t                        tree.branchContainer.loader = null;\n\t                    }\n\t                    entries.forEach(function (entry) {\n\t                        app = app6a3b9bcfabdb0;\n\t                        branch = app.tree.createBranch(entry, tree);\n\t                        app.map.drawMarker(entry);\n\t                        tree.branches[branch.ID] = branch;\n\n\t                    }, tree);\n\t                },\n\t                createBranch: function (entry, tree) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    var branch = app.tree.findBranch(tree, entry.ID);\n\t                    if (typeof branch === 'undefined') {\n\t                        branch = entry;\n\t                        branch.branches = {};\n\t                        branch.container = document.createElement(\"li\");\n\t                        branch.container.setAttribute(\"id\", app.tree.id + \"_branch_\" + entry.ID);\n\t                        var linknode = document.createElement(\"a\");\n\t                        linknode.classList.add(\"pim_link_to_post\");\n\t                        var linktextnode = document.createTextNode(\"\u25b8\");\n\t                        linknode.appendChild(linktextnode);\n\t                        linknode.title = branch.post_title;\n\t                        linknode.href = branch.permalink;\n\t                        branch.button = document.createElement(\"button\");\n\t                        branch.button.classList.add(\"pim_button\");\n\t                        if (branch.nchildren > 0) {\n\t                            branch.text = document.createTextNode(branch.post_title + \" (\" + branch.nchildren + \")\");\n\t                            branch.container.classList.add(\"has_child\");\n\t                        } else {\n\t                            branch.text = document.createTextNode(branch.post_title);\n\t                            branch.container.classList.add(\"no_child\");\n\t                        }\n\t                        \/\/ console.log (branch.guid);\n\n\t                        branch.button.appendChild(branch.text);\n\t                        branch.container.appendChild(linknode);\n\n\t                        branch.branchContainer = document.createElement(\"ul\");\n\t                        branch.branchContainer.loader = document.createElement(\"div\");\n\t                        branch.loading_text = document.createTextNode(\"Loading...\");\n\t                        branch.branchContainer.loader.appendChild(branch.loading_text);\n\t                        branch.branchContainer.loader.classList.add(\"pim_loading\");\n\t                        branch.branchContainer.setAttribute(\"id\", app.tree.id + \"_branchcontainer_\" + entry.ID);\n\t                        branch.branchContainer.appendChild(branch.branchContainer.loader);\n\t                        branch.container.appendChild(branch.button);\n\t                        branch.container.appendChild(branch.branchContainer);\n\t                        app.utility.setVisibility(branch.branchContainer, false);\n\t                        branch.button.onclick = function () {\n\t                            for (i = 0; i < document.getElementsByClassName(\"pim_button\").length; i++) {\n\t                                document.getElementsByClassName(\"pim_button\")[i].classList.remove(\"pim_active\");\n\t                            }\n\t                            this.classList.add(\"pim_active\");\n\t                            app = app6a3b9bcfabdb0;\n\t                            app.tree.onClickBranch(branch);\n\t                            \/\/    console.log(branch);\n\t                        }\n\t                        tree.branchContainer.appendChild(branch.container);\n\t                    }\n\t                    return branch;\n\t                },\n\t                onClickBranch: function (branch) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    if (branch.nchildren > 0) {\n\t                        app.map.removeKml();\n\t                        if (\n\t                                app.config.loadBranchKml == \"yes\" &&\n\t                                branch.kml != null &&\n\t                                branch.kml.url\n\t                                ) {\n\n\t                            app.map.drawKml(branch.kml.url);\n\t                        }\n\t                        app.utility.toggleVisibility(branch.branchContainer);\n\t                        app.utility.getEntries(\n\t                                {\n\t                                    action: \"seed_localizzation_get_posts\",\n\t                                    post_parent: branch.ID,\n\t                                    post_type: app.config.post_type,\n\t                                    tax: app.config.tax,\n\t                                    terms: app.config.terms\n\t                                },\n\t                                function (entries) {\n\t                                    app = app6a3b9bcfabdb0;\n\t                                    app.tree.drawBranches(entries, branch);\n\t                                }\n\t                        );\n\t                    } else {\n\t\t\t\t                        if (\n\t\t                                typeof app.map.markers[branch.ID] === 'undefined'\n\t\t                                ) {\n\t\t                            alert(\"\\\"\" + branch.post_title + \"\\\" non in mappa!\");\n\t\t                        } else {\n\t\t                            app.map.removeMarkers();\n\t\t                            app.map.drawMarker(branch);\n\t\t                            app.map.markers[branch.ID].openPopup();\n\t\t                        }\n\t\t\t                    }\n\t                    return false;\n\t                },\n\t                findBranch: function (tree, branchID) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    for (branch in tree.branches) {\n\t                        if (tree.branches[branch].ID == branchID) {\n\t                            return tree.branches[branch];\n\t                        } else {\n\t                            app.tree.findBranch(tree.branches[branch], branchID);\n\t                        }\n\t                    }\n\t                },\n\t            },\n\t            utility: {\n\t                prepareContainer: function () {\n\t                    app = app6a3b9bcfabdb0;\n\n\t                    app.container = document.createElement(\"div\");\n\t                    app.container.classList.add(\"pim_container\");\n\n\t                    app.map.container = document.createElement(\"div\");\n\t                    app.map.container.setAttribute(\"id\", app.map.id);\n\t                    app.map.container.classList.add(\"pim_map\");\n\n\t                    app.map.container.style.minHeight = \"400px\";\n\t                    app.map.container.style.width = \"60%\";\n\t                    app.map.container.style.float = \"left\";\n\n\t                    app.tree.container = document.createElement(\"div\");\n\t                    app.tree.container.setAttribute(\"id\", app.tree.id);\n\t                    app.tree.container.classList.add(\"pim_tree\");\n\t                    app.tree.branchContainer = document.createElement(\"ul\");\n\t                    app.tree.branchContainer.setAttribute(\"id\", app.tree.id + \"_branchcontainer\");\n\n\t                    app.tree.branchContainer.loader = document.createElement(\"li\");\n\t                    app.tree.branchContainer.loading_text = document.createTextNode(\"Loading...\");\n\t                    app.tree.branchContainer.loader.appendChild(app.tree.branchContainer.loading_text);\n\n\t                    app.tree.branchContainer.loader.classList.add(\"pim_loading_main\");\n\n\t                    app.tree.branchContainer.appendChild(app.tree.branchContainer.loader);\n\t                    app.tree.container.appendChild(app.tree.branchContainer);\n\t                    app.tree.container.style.height = \"400px\";\n\t                    app.tree.container.style.overflow = \"auto\";\n\t                    app.tree.container.style.width = \"40%\";\n\t                    app.tree.container.style.float = \"left\";\n\n\t                    app.container.appendChild(app.map.container);\n\t                    app.container.appendChild(app.tree.container);\n\n\t                    app.parentContainer.appendChild(app.container);\n\t                },\n\t                getEntries: function (args, f) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    var cacheIndex = JSON.stringify(args);\n\t                    if (typeof app.cache[cacheIndex] !== \"undefined\") {\n\t                        f(app.cache[cacheIndex]);\n\t                        return;\n\t                    }\n\t                    jQuery.get(\n\t                            'https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-admin\/admin-ajax.php',\n\t                            args,\n\t                            function (response, status) {\n\t                                app = app6a3b9bcfabdb0;\n\t                                if (status == 'success') {\n\t                                    app.cache[cacheIndex] = entries = JSON.parse(response);\n\t                                    f(entries);\n\t                                }\n\t                            }\n\t                    );\n\n\t                },\n\t                setVisibility: function (element, status) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    element.style.display = (status) ? (\"inherit\") : (\"none\");\n\t                },\n\t                getVisibility: function (element) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    return ((element.style.display == \"inherit\") ? (true) : (false));\n\t                },\n\t                toggleVisibility: function (element) {\n\t                    app = app6a3b9bcfabdb0;\n\t                    app.utility.setVisibility(element, !app.utility.getVisibility(element));\n\t                }\n\t            }\n\t        };\n\n\t        document.addEventListener(\"DOMContentLoaded\", function () {\n\t            app6a3b9bcfabdb0.init();\n\t        });\n\t<\/script>\n\t\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ip_address":"","user_agent":"","level":"","revision":"","cookie_id":"","page_referer":"","html_form":"","footnotes":""},"class_list":["post-14516","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/pages\/14516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/comments?post=14516"}],"version-history":[{"count":1,"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/pages\/14516\/revisions"}],"predecessor-version":[{"id":14517,"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/pages\/14516\/revisions\/14517"}],"wp:attachment":[{"href":"https:\/\/www.diocesiravennacervia.it\/oldsite\/wp-json\/wp\/v2\/media?parent=14516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}