{"id":997,"date":"2019-10-03T07:11:18","date_gmt":"2019-10-03T07:11:18","guid":{"rendered":"https:\/\/www.fla-shop.com\/blog\/?p=997"},"modified":"2022-05-24T20:26:21","modified_gmt":"2022-05-24T20:26:21","slug":"example-js-script-for-flashing-cities-on-a-map","status":"publish","type":"post","link":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/","title":{"rendered":"Example JS script for flashing cities on a map"},"content":{"rendered":"\n<div class=\"wp-block-group article_md_block\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"> <!-- start Fla-shop.com HTML5 Map --> <div class='usaHtml5Mapbottom htmlMapResponsive' style='max-width:980px; width: 100%'><div id='usa-html5-map-map-container_0' class='usaHtml5MapContainer' data-map-variable='usahtml5map_map_0'><\/div><div style='clear:both; height: 20px;'><\/div> <style> #usa-html5-map-map-container_0 { } #usa-html5-map-map-container_0 .fm-tooltip-name { color: #000000; font-size: 20px; } #usa-html5-map-map-container_0 .fm-tooltip-comment { font-size: 12px; } #usa-html5-map-map-container_0 .fm-tooltip-comment p { font-size: 12px; } @media only screen and (max-width: 480px) { #usa-html5-map-map-container_0 { float: none; width: 100%; } } <\/style><script type=\"text\/javascript\"> jQuery(function(){ var hightlighted = null; usahtml5map_map_0 = new FlaShopUSAMap(usahtml5map_map_cfg_11); usahtml5map_map_0.draw('usa-html5-map-map-container_0'); usahtml5map_map_0.on('mousein', function(ev, sid, map) { if (hightlighted && sid != hightlighted) { map.stateHighlightOut(hightlighted); hightlighted = null; } }); (function (map, containerId, mapId) { var INTERVAL = 1; var ORDER = 'random'; \/* Otherwise - direct *\/ var points = Object.keys(map.mapConfig.points); var canShow = true; var currentI = null; var enTimer = false; var hidePoints = function () { for (var i = 0; i < points.length; i++) { if (i !== currentI) map.hideState(points[i]); } }; var showPoints = function () { for (var i = 0; i < points.length; i++) { if (i !== currentI) map.showState(points[i]); } }; var showNextPoint = function () { var curPid; if ( ! canShow) return; if (currentI === null) { currentI = ORDER === 'random' ? Math.floor(Math.random()*1000) % points.length : 0; } else { hideCurrentPoint(); if (ORDER === 'random') { do { var cI = Math.floor(Math.random()*1123) % points.length; } while (cI === currentI); currentI = cI; } else { currentI = currentI == points.length - 1 ? 0 : currentI + 1; } } showCurrentPoint(); }; var showCurrentPoint = function () { if (currentI === null) return; var curPid; curPid = points[currentI]; map.showState(curPid); map.stateHighlightIn(curPid); }; var hideCurrentPoint = function (onlyTt) { if (currentI === null) return; var curPid; curPid = points[currentI]; map.stateHighlightOut(curPid); if (onlyTt) return; map.hideState(curPid); }; hidePoints(); setInterval(showNextPoint, INTERVAL * 1000); showNextPoint(); jQuery('#'+containerId).on('mouseenter', function (ev) { if (enTimer) { clearTimeout(enTimer); enTimer = false; } hideCurrentPoint(true); showPoints(); canShow = false; }); jQuery('#'+containerId).on('mouseleave', function (ev) { if (enTimer) { clearTimeout(enTimer); enTimer = false; } enTimer = setTimeout(function () { canShow = true; hidePoints(); showCurrentPoint(); }, 300); }); })(usahtml5map_map_0, 'usa-html5-map-map-container_0', 11); var html5map_onclick = function(ev, sid, map) { var cfg = usahtml5map_map_cfg_11; var link = map.fetchStateAttr(sid, 'link'); var is_group = map.fetchStateAttr(sid, 'group'); var popup_id = map.fetchStateAttr(sid, 'popup-id'); var is_group_info = false; if (typeof cfg.map_data[sid] !== 'undefined') jQuery('#usa-html5-map-selector_0').val(sid); else jQuery('#usa-html5-map-selector_0').val(''); if (is_group==undefined) { if (sid.substr(0,1)=='p') { popup_id = map.fetchPointAttr(sid, 'popup_id'); link = map.fetchPointAttr(sid, 'link'); } } else if (typeof cfg.groups[is_group]['ignore_link'] == 'undefined' || ! cfg.groups[is_group].ignore_link) { link = cfg.groups[is_group].link; popup_id = cfg.groups[is_group]['popup_id']; is_group_info = true; } if (link=='#popup') { if (typeof SG_POPUP_DATA == \"object\") { if (popup_id in SG_POPUP_DATA) { SGPopup.prototype.showPopup(popup_id,false); } else { jQuery.ajax({ type: 'POST', url: 'https:\/\/www.fla-shop.com\/blog\/' + 'index.php' + '?map_id=11' + '&usahtml5map_get_popup', data: {popup_id:popup_id}, }).done(function(data) { jQuery('body').append(data); SGPopup.prototype.showPopup(popup_id,false); }); } } else if (typeof SGPBPopup == \"function\") { var popup = SGPBPopup.createPopupObjById(popup_id); popup.prepareOpen(); popup.open(); } return false; } if (link == '#info') { var id = is_group_info ? is_group : (sid.substr(0,1)=='p' ? sid : map.fetchStateAttr(sid, 'id')); jQuery('#usa-html5-map-state-info_0').html('Loading...'); jQuery.ajax({ type: 'POST', url: (is_group_info ? 'https:\/\/www.fla-shop.com\/blog\/' + 'index.php' + '?map_id=11' + '&usahtml5map_get_group_info=' : 'https:\/\/www.fla-shop.com\/blog\/' + 'index.php' + '?map_id=11' + '&usahtml5map_get_state_info=') + id, success: function(data, textStatus, jqXHR){ jQuery('#usa-html5-map-state-info_0').html(data); }, dataType: 'text' }); return false; } if (ev===null && link!='') { if (!jQuery('.html5dummilink').length) { jQuery('body').append('<a href=\"#\" class=\"html5dummilink\" style=\"display:none\"><\/a>'); } jQuery('.html5dummilink').attr('href',link).attr('target',(map.fetchStateAttr(sid, 'isNewWindow') ? '_blank' : '_self'))[0].click(); } }; usahtml5map_map_0.on('click',html5map_onclick); }); <\/script><div id='usa-html5-map-state-info_0' class='usaHtml5MapStateInfo'><\/div> <\/div> <div style='clear: both'><\/div> <!-- end HTML5 Map --> \n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group article_sm_block\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p>This example uses the <a href=\"https:\/\/www.fla-shop.com\/products\/wp-plugins\/united-states\/us\/\">US Map for WordPress plugin<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code for the &#8220;Custom JS&#8221; section in the plugin settings<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\nvar INTERVAL = 1;\nvar ORDER = 'random'; \/* Otherwise - direct *\/\n\nvar points = Object.keys(map.mapConfig.points);\n\nvar canShow = true;\nvar currentI = null;\nvar enTimer = false;\n\nvar hidePoints = function () {\n    for (var i = 0; i &lt; points.length; i++) {\n        if (i !== currentI)\n            map.hideState(points&#x5B;i]);\n    }\n};\n\nvar showPoints = function () {\n    for (var i = 0; i &lt; points.length; i++) {\n        if (i !== currentI)\n            map.showState(points&#x5B;i]);\n    }\n};\n\nvar showNextPoint = function () {\n    var curPid;\n    if ( ! canShow)\n        return;\n    if (currentI === null) {\n        currentI = ORDER === 'random' ? Math.floor(Math.random()*1000) % points.length : 0;\n    } else {\n        hideCurrentPoint();\n        if (ORDER === 'random') {\n            do {\n                var cI = Math.floor(Math.random()*1123) % points.length;\n            } while (cI === currentI);\n            currentI = cI;\n        } else {\n            currentI = currentI == points.length - 1 ? 0 : currentI + 1;\n        }\n    }\n    showCurrentPoint();\n};\n\nvar showCurrentPoint = function () {\n    if (currentI === null)\n        return;\n    var curPid;\n    curPid = points&#x5B;currentI];\n    map.showState(curPid);\n    map.stateHighlightIn(curPid);\n};\n\nvar hideCurrentPoint = function (onlyTt) {\n    if (currentI === null)\n        return;\n    var curPid;\n    curPid = points&#x5B;currentI];\n    map.stateHighlightOut(curPid);\n    if (onlyTt) return;\n    map.hideState(curPid);\n};\n\nhidePoints();\n\nsetInterval(showNextPoint, INTERVAL * 1000);\nshowNextPoint();\n\njQuery('#'+containerId).on('mouseenter', function (ev) {\n    if (enTimer) {\n        clearTimeout(enTimer);\n        enTimer = false;\n    }\n    hideCurrentPoint(true);\n    showPoints();\n    canShow = false;\n});\n\njQuery('#'+containerId).on('mouseleave', function (ev) {\n    if (enTimer) {\n        clearTimeout(enTimer);\n        enTimer = false;\n    }\n    enTimer = setTimeout(function () {\n        canShow = true;\n        hidePoints();\n        showCurrentPoint();\n    }, 300);\n});\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">How to add Custom JS code in the plugin?<\/h2>\n\n\n\n<p>On the Tools tab in the plugin settings there is a &#8220;Custom JavaScript&#8221; field where you can insert JS code.<br>See the following screenshot.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/01\/tools-tab-custom-js.png\" alt=\"Tools tab\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Examples of other scripts to extend the functionality<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.fla-shop.com\/blog\/examples-of-custom-js-scripts\/\">How to highlight the state when you click on the map<\/a><\/li><\/ul>\n\n\n\n<p>If you have any ideas for customization, we&#8217;d appreciate it if you&#8217;d share it with us.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group article_sm_block\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"has-text-align-center\"><a class=\"greenbutton\" href=\"https:\/\/www.fla-shop.com\/products\/wp-plugins\/united-states\/us\/\">Get try-for-free customizable US map for WordPress<\/a><\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Another example of using a script for a plugin with a map of the USA. JS code randomly shows one of the added points. When you hover over the map, all points are displayed, which allows you to click on any point.<\/p>\n","protected":false},"author":1,"featured_media":1336,"comment_status":"open","ping_status":"open","sticky":false,"template":"post1.php","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-997","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-empowerment-with-custom-js"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Example JS script for flashing cities on a map - Fla-Shop.com<\/title>\n<meta name=\"description\" content=\"Copy a working example of the script for the WordPress Map Plugin to make the markers appear randomly on the map.\" \/>\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.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Example JS script for flashing cities on a map - Fla-Shop.com\" \/>\n<meta property=\"og:description\" content=\"Copy a working example of the script for the WordPress Map Plugin to make the markers appear randomly on the map.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/\" \/>\n<meta property=\"og:site_name\" content=\"Fla-Shop.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/flashopcom\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-03T07:11:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-24T20:26:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/10\/flashing-cities.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@flashop\" \/>\n<meta name=\"twitter:site\" content=\"@flashop\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#\\\/schema\\\/person\\\/16214725e757dd92d37dbfe3e2a5db1e\"},\"headline\":\"Example JS script for flashing cities on a map\",\"datePublished\":\"2019-10-03T07:11:18+00:00\",\"dateModified\":\"2022-05-24T20:26:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/\"},\"wordCount\":108,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/flashing-cities.png\",\"articleSection\":[\"Empowerment with Custom JS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/\",\"url\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/\",\"name\":\"Example JS script for flashing cities on a map - Fla-Shop.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/flashing-cities.png\",\"datePublished\":\"2019-10-03T07:11:18+00:00\",\"dateModified\":\"2022-05-24T20:26:21+00:00\",\"description\":\"Copy a working example of the script for the WordPress Map Plugin to make the markers appear randomly on the map.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/flashing-cities.png\",\"contentUrl\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/flashing-cities.png\",\"width\":600,\"height\":315,\"caption\":\"Map with cities\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/example-js-script-for-flashing-cities-on-a-map\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Example JS script for flashing cities on a map\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/\",\"name\":\"Fla-Shop.com\",\"description\":\"Interactive Maps, HTML5, WordPress, Map Use-cases \u2013 Fla-shop.com blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#organization\",\"name\":\"Fla-shop.com\",\"url\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/fla-shop_twitter_logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/fla-shop_twitter_logo.jpg\",\"width\":128,\"height\":128,\"caption\":\"Fla-shop.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/flashopcom\\\/\",\"https:\\\/\\\/x.com\\\/flashop\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/flashopcom\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.fla-shop.com\\\/blog\\\/#\\\/schema\\\/person\\\/16214725e757dd92d37dbfe3e2a5db1e\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3bd8fdbd458f1b6c6dc6d8d2dc471f4986c4680b9492a7410ba0cc65f54527c7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3bd8fdbd458f1b6c6dc6d8d2dc471f4986c4680b9492a7410ba0cc65f54527c7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3bd8fdbd458f1b6c6dc6d8d2dc471f4986c4680b9492a7410ba0cc65f54527c7?s=96&d=mm&r=g\",\"caption\":\"admin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Example JS script for flashing cities on a map - Fla-Shop.com","description":"Copy a working example of the script for the WordPress Map Plugin to make the markers appear randomly on the map.","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.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/","og_locale":"en_US","og_type":"article","og_title":"Example JS script for flashing cities on a map - Fla-Shop.com","og_description":"Copy a working example of the script for the WordPress Map Plugin to make the markers appear randomly on the map.","og_url":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/","og_site_name":"Fla-Shop.com","article_publisher":"https:\/\/www.facebook.com\/flashopcom\/","article_published_time":"2019-10-03T07:11:18+00:00","article_modified_time":"2022-05-24T20:26:21+00:00","og_image":[{"width":600,"height":315,"url":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/10\/flashing-cities.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@flashop","twitter_site":"@flashop","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#article","isPartOf":{"@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/"},"author":{"name":"admin","@id":"https:\/\/www.fla-shop.com\/blog\/#\/schema\/person\/16214725e757dd92d37dbfe3e2a5db1e"},"headline":"Example JS script for flashing cities on a map","datePublished":"2019-10-03T07:11:18+00:00","dateModified":"2022-05-24T20:26:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/"},"wordCount":108,"commentCount":0,"publisher":{"@id":"https:\/\/www.fla-shop.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/10\/flashing-cities.png","articleSection":["Empowerment with Custom JS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/","url":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/","name":"Example JS script for flashing cities on a map - Fla-Shop.com","isPartOf":{"@id":"https:\/\/www.fla-shop.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#primaryimage"},"image":{"@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/10\/flashing-cities.png","datePublished":"2019-10-03T07:11:18+00:00","dateModified":"2022-05-24T20:26:21+00:00","description":"Copy a working example of the script for the WordPress Map Plugin to make the markers appear randomly on the map.","breadcrumb":{"@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#primaryimage","url":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/10\/flashing-cities.png","contentUrl":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2019\/10\/flashing-cities.png","width":600,"height":315,"caption":"Map with cities"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fla-shop.com\/blog\/example-js-script-for-flashing-cities-on-a-map\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.fla-shop.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Example JS script for flashing cities on a map"}]},{"@type":"WebSite","@id":"https:\/\/www.fla-shop.com\/blog\/#website","url":"https:\/\/www.fla-shop.com\/blog\/","name":"Fla-Shop.com","description":"Interactive Maps, HTML5, WordPress, Map Use-cases \u2013 Fla-shop.com blog","publisher":{"@id":"https:\/\/www.fla-shop.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fla-shop.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.fla-shop.com\/blog\/#organization","name":"Fla-shop.com","url":"https:\/\/www.fla-shop.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fla-shop.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2017\/06\/fla-shop_twitter_logo.jpg","contentUrl":"https:\/\/www.fla-shop.com\/blog\/wp-content\/uploads\/2017\/06\/fla-shop_twitter_logo.jpg","width":128,"height":128,"caption":"Fla-shop.com"},"image":{"@id":"https:\/\/www.fla-shop.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/flashopcom\/","https:\/\/x.com\/flashop","https:\/\/www.youtube.com\/user\/flashopcom"]},{"@type":"Person","@id":"https:\/\/www.fla-shop.com\/blog\/#\/schema\/person\/16214725e757dd92d37dbfe3e2a5db1e","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3bd8fdbd458f1b6c6dc6d8d2dc471f4986c4680b9492a7410ba0cc65f54527c7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3bd8fdbd458f1b6c6dc6d8d2dc471f4986c4680b9492a7410ba0cc65f54527c7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3bd8fdbd458f1b6c6dc6d8d2dc471f4986c4680b9492a7410ba0cc65f54527c7?s=96&d=mm&r=g","caption":"admin"}}]}},"_links":{"self":[{"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/posts\/997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":13,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"predecessor-version":[{"id":1647,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/posts\/997\/revisions\/1647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/media\/1336"}],"wp:attachment":[{"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fla-shop.com\/blog\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}