{"id":767,"date":"2024-03-19T18:01:15","date_gmt":"2024-03-19T22:01:15","guid":{"rendered":"https:\/\/www.deveblog.com\/?page_id=767"},"modified":"2024-03-19T18:01:16","modified_gmt":"2024-03-19T22:01:16","slug":"genius-map","status":"publish","type":"page","link":"https:\/\/www.deveblog.com\/index.php\/genius-map\/","title":{"rendered":"Genius Map"},"content":{"rendered":"\n<div class=\"open-user-map\">\n\n  \n  \n<div class=\"box-wrap map-size-default map-size-mobile-square \">\n  \n  <div class=\"map-wrap\">\n    <div id=\"map-20210929\" class=\"leaflet-map map-style_Esri.WorldStreetMap\"><\/div>\n    \n    \n    \n        \n      \n      \n        <div id=\"open-add-location-overlay\" class=\"open-add-location-overlay\" style=\"background-color: #e02aaf\"><span class=\"btn_icon\">+<\/span><span class=\"btn_text\">Add location<\/span><\/div>\n\n      \n    \n    \n    \n    <script type=\"text\/javascript\" data-category=\"functional\" class=\"cmplz-native\" id=\"oum-inline-js\">\n      var map_el = `map-20210929`;\n\n      if(document.getElementById(map_el)) {\n\n        var mapStyle = `Esri.WorldStreetMap`;\n        var oum_tile_provider_mapbox_key = ``;\n        var marker_icon_url = `https:\/\/www.deveblog.com\/wp-content\/plugins\/open-user-map\/src\/leaflet\/images\/marker-icon_default-2x.png`;\n        var marker_shadow_url = `https:\/\/www.deveblog.com\/wp-content\/plugins\/open-user-map\/src\/leaflet\/images\/marker-shadow.png`;\n        var oum_enable_scrollwheel_zoom_map = false;\n        var oum_enable_cluster = true;\n        var oum_enable_fullscreen = true;\n\n        var oum_enable_searchbar = true;\n        var oum_searchbar_type = `address`;\n\n        var oum_geosearch_selected_provider = ``; \n        var oum_geosearch_provider = `osm`;\n        var oum_geosearch_provider_geoapify_key = ``;\n        var oum_geosearch_provider_here_key = ``;\n        var oum_geosearch_provider_mapbox_key = ``;\n        \n        var oum_enable_searchaddress_button = true;\n        var oum_searchaddress_label = `Search for address`;\n\n        var oum_enable_searchmarkers_button = true;\n        var oum_searchmarkers_label = `Find marker`;\n        var oum_searchmarkers_zoom = `8`;\n\n        var oum_enable_currentlocation = false;\n        var oum_action_after_submit = `text`;\n        var thankyou_redirect = ``;\n        var start_lat = `39.1154506`;\n        var start_lng = `-77.5645607`;\n        var start_zoom = `8`;\n        var oum_enable_fixed_map_bounds = ``;\n        var oum_minimum_zoom_level = ``;\n        var oum_use_settings_start_location = false;\n        var oum_has_regions = false;\n\n        var oum_location = {};\n        var oum_custom_css = '';\n        var oum_custom_script = '';\n        var oumMap;\n        var oumMap2;\n\n        \/**\n         * Conditional Field Feature\n         * \n         * @param {string} sourceField - The source field selector\n         * @param {string} targetField - The target field selector\n         * @param {array} condShow - The values that should show the target field\n         * @param {array} condHide - The values that should hide the target field\n         *\/\n        var oumConditionalField = (sourceField, targetField, condShow, condHide) => {\n            const sourceElements = document.querySelectorAll(sourceField); \/\/ Select all radios\/checkboxes or single select\n            const targetElementWrapper = document.querySelector(targetField)?.parentElement; \/* works with custom fields only *\/\n\n            \/\/ Check if both sourceElements and targetElementWrapper exist\n            if (!sourceElements.length) {\n                console.warn(`OUM: Source field(s) not found: ${sourceField}`);\n                return;\n            }\n\n            if (!targetElementWrapper) {\n                console.warn(`OUM: Target field wrapper not found: ${targetField}`);\n                return;\n            }\n\n            \/* Event listener for change *\/\n            const onChangeHandler = function() {\n                \/\/ Get selected values for checkboxes and single selected value for radios\/select\n                const selectedValues = Array.from(sourceElements)\n                    .filter(element => element.checked || element.tagName === 'SELECT')\n                    .map(element => element.value);\n\n                const selectedValue = selectedValues[0]; \/\/ For radios and selects, we use only the first (and only) value\n\n                console.log('OUM: run condition', {selectedValue, sourceField, targetField, condShow, condHide});\n                \n                \/\/ Show or hide target field based on the selected value(s)\n                if (condShow.includes(selectedValue)) {\n                    targetElementWrapper.style.display = 'block';\n                } else if (condHide.includes(selectedValue)) {\n                    targetElementWrapper.style.display = 'none';\n                }\n            };\n\n            \/* Attach the event listener to each radio\/checkbox or select *\/\n            sourceElements.forEach(element => {\n                element.addEventListener('change', onChangeHandler);\n            });\n\n            \/* Trigger initially *\/\n            onChangeHandler(); \/\/ Call it directly to set initial state\n        };\n\n\n\n        \/* Transfer PHP array to JS json *\/\n        var oum_all_locations = [{\"title\":\"Svemir\",\"lat\":\"39.1154506\",\"lng\":\"-77.5645607\",\"content\":\"\\u003Cdiv class=\\u0022oum_location_image\\u0022\\u003E\\u003Cimg class=\\u0022skip-lazy\\u0022 src=\\u0022http:\/\/www.deveblog.com\/wp-content\/uploads\/oum-useruploads\/769.jpg\\u0022\\u003E\\u003C\/div\\u003E\\u003Cdiv class=\\u0022oum_location_text\\u0022\\u003E\\u003Cdiv class=\\u0022oum_location_date\\u0022\\u003E3\/19\/2024\\u003C\/div\\u003E\\u003Ch3 class=\\u0022oum_location_name\\u0022\\u003ESvemir\\u003C\/h3\\u003E\\u003Cdiv class=\\u0022oum_location_custom_fields\\u0022\\u003E\\u003C\/div\\u003E\\u003Cdiv class=\\u0022oum_location_description\\u0022\\u003ETest!\\u003C\/div\\u003E\\u003C\/div\\u003E\\u003Cdiv style=\\u0022display: none\\u0022\\u003Esvemir\\u003C\/div\\u003E\",\"icon\":\"https:\/\/www.deveblog.com\/wp-content\/plugins\/open-user-map\/src\/leaflet\/images\/marker-icon_default-2x.png\",\"types\":[],\"post_id\":\"769\",\"address\":\"\",\"text\":\"Test!\",\"image\":\"http:\/\/www.deveblog.com\/wp-content\/uploads\/oum-useruploads\/769.jpg\",\"audio\":\"\",\"video\":\"\",\"custom_fields\":[]}];\n\n\n        \/**\n         * Add Custom Styles\n         *\/\n        \n        \n          \/* custom color *\/\n          oum_custom_css += `\n            .open-user-map .add-location #close-add-location-overlay:hover {color: #e02aaf !important}\n            .open-user-map .box-wrap .map-wrap .oum-filter-controls .oum-filter-list .close-filter-list:hover {color: #e02aaf !important}\n            .open-user-map input.oum-switch[type=\"checkbox\"]:checked + label::before {background-color: #e02aaf !important}\n            .open-user-map .add-location .location-overlay-content #oum_add_location_thankyou h3 {color: #e02aaf !important}\n            .open-user-map .oum_location_text a {color: #e02aaf !important}\n            .open-user-map .oum-tabs {border-color: #e02aaf !important}\n            .open-user-map .oum-tabs .nav-item:hover {color: #e02aaf !important; border-color: #e02aaf !important}\n            .open-user-map .oum-tabs .nav-item.active {color: #e02aaf !important; border-color: #e02aaf !important}\n            .open-user-map .box-wrap .map-wrap .oum-attribution a {color: #e02aaf !important;}`;\n\n        \n        \n        \n        var custom_style = document.createElement('style');\n\n        if (custom_style.styleSheet) {\n          custom_style.styleSheet.cssText = oum_custom_css;\n        } else {\n          custom_style.appendChild(document.createTextNode(oum_custom_css));\n        }\n\n        document.getElementsByTagName('head')[0].appendChild(custom_style);\n\n      }\n    <\/script>\n\n  <\/div>\n\n<\/div>\n\n<\/div>","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-767","page","type-page","status-publish","hentry","post-archive"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Genius Map - deveblog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.deveblog.com\/index.php\/genius-map\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Genius Map - deveblog\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.deveblog.com\/index.php\/genius-map\/\" \/>\n<meta property=\"og:site_name\" content=\"deveblog\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-19T22:01:16+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.deveblog.com\/index.php\/genius-map\/\",\"url\":\"https:\/\/www.deveblog.com\/index.php\/genius-map\/\",\"name\":\"Genius Map - deveblog\",\"isPartOf\":{\"@id\":\"https:\/\/www.deveblog.com\/#website\"},\"datePublished\":\"2024-03-19T22:01:15+00:00\",\"dateModified\":\"2024-03-19T22:01:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.deveblog.com\/index.php\/genius-map\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.deveblog.com\/index.php\/genius-map\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.deveblog.com\/index.php\/genius-map\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.deveblog.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Genius Map\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.deveblog.com\/#website\",\"url\":\"https:\/\/www.deveblog.com\/\",\"name\":\"deveblog\",\"description\":\"This blog is recursive. See tagline for details.\",\"publisher\":{\"@id\":\"https:\/\/www.deveblog.com\/#\/schema\/person\/5269075d85da1c274f54c57dbdfd8ca7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.deveblog.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.deveblog.com\/#\/schema\/person\/5269075d85da1c274f54c57dbdfd8ca7\",\"name\":\"svemir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.deveblog.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/543dbf778ac75bc3ebec8366d50566e3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/543dbf778ac75bc3ebec8366d50566e3?s=96&d=mm&r=g\",\"caption\":\"svemir\"},\"logo\":{\"@id\":\"https:\/\/www.deveblog.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.deveblog.com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Genius Map - deveblog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.deveblog.com\/index.php\/genius-map\/","og_locale":"en_US","og_type":"article","og_title":"Genius Map - deveblog","og_url":"https:\/\/www.deveblog.com\/index.php\/genius-map\/","og_site_name":"deveblog","article_modified_time":"2024-03-19T22:01:16+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.deveblog.com\/index.php\/genius-map\/","url":"https:\/\/www.deveblog.com\/index.php\/genius-map\/","name":"Genius Map - deveblog","isPartOf":{"@id":"https:\/\/www.deveblog.com\/#website"},"datePublished":"2024-03-19T22:01:15+00:00","dateModified":"2024-03-19T22:01:16+00:00","breadcrumb":{"@id":"https:\/\/www.deveblog.com\/index.php\/genius-map\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.deveblog.com\/index.php\/genius-map\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.deveblog.com\/index.php\/genius-map\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.deveblog.com\/"},{"@type":"ListItem","position":2,"name":"Genius Map"}]},{"@type":"WebSite","@id":"https:\/\/www.deveblog.com\/#website","url":"https:\/\/www.deveblog.com\/","name":"deveblog","description":"This blog is recursive. See tagline for details.","publisher":{"@id":"https:\/\/www.deveblog.com\/#\/schema\/person\/5269075d85da1c274f54c57dbdfd8ca7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.deveblog.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.deveblog.com\/#\/schema\/person\/5269075d85da1c274f54c57dbdfd8ca7","name":"svemir","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.deveblog.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/543dbf778ac75bc3ebec8366d50566e3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/543dbf778ac75bc3ebec8366d50566e3?s=96&d=mm&r=g","caption":"svemir"},"logo":{"@id":"https:\/\/www.deveblog.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.deveblog.com\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/pages\/767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=767"}],"version-history":[{"count":1,"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/pages\/767\/revisions"}],"predecessor-version":[{"id":768,"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/pages\/767\/revisions\/768"}],"wp:attachment":[{"href":"https:\/\/www.deveblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}