{"id":4586,"date":"2023-02-26T09:50:58","date_gmt":"2023-02-26T08:50:58","guid":{"rendered":"https:\/\/www.open-user-map.com\/?post_type=ht_kb&#038;p=4586"},"modified":"2024-11-10T17:26:59","modified_gmt":"2024-11-10T16:26:59","slug":"trigger-map-actions-with-javascript","status":"publish","type":"ht_kb","link":"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/trigger-map-actions-with-javascript\/","title":{"rendered":"D\u00e9clencher des actions sur la carte avec Javascript"},"content":{"rendered":"\n<p>You can trigger a number of Javascript functions. It is possible to add custom JS directly in the plugin settings. Go to <em>Open User Map &gt; Settings &gt; Advanced &gt; Custom JS<\/em>. <\/p>\n\n\n\n<p>Here are some possible use cases:<\/p>\n\n\n\n<div style=\"height:61px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Reload the map<\/h2>\n\n\n\n<p>This may be helpful if you are using a Caching or Page Preloading Plugin. Sometimes the preloading blocks the loading of the OUM map, so that it needs to be reloaded.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"oumMap.invalidateSize();\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">oumMap.<\/span><span style=\"color: #62E884\">invalidateSize<\/span><span style=\"color: #F6F6F4\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Fly to another location<\/h2>\n\n\n\n<p>Use the following JS function after your page has loaded. The necessary parameters are latitude, longitude and zoom.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"oumMap.flyTo([40.737, -73.923], 8);\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">oumMap.<\/span><span style=\"color: #62E884\">flyTo<\/span><span style=\"color: #F6F6F4\">(&#91;<\/span><span style=\"color: #BF9EEE\">40.737<\/span><span style=\"color: #F6F6F4\">, <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #BF9EEE\">73.923<\/span><span style=\"color: #F6F6F4\">&#93;, <\/span><span style=\"color: #BF9EEE\">8<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Fly to the current user position<\/h2>\n\n\n\n<p>Use the following JS function to trigger a click on the &#8220;Show me where I am&#8221; Button.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"document.querySelector('.leaflet-control-locate a').click();\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">document.<\/span><span style=\"color: #62E884\">querySelector<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">.leaflet-control-locate a<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">).<\/span><span style=\"color: #62E884\">click<\/span><span style=\"color: #F6F6F4\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Open the &#8220;Add location&#8221; form<\/h2>\n\n\n\n<p>Use the following JS function to trigger a click on the &#8220;+&#8221; Button to open the &#8220;Add location&#8221; form.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"jQuery(document).ready(function() {\n  document.querySelector('#open-add-location-overlay').click();\n});\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">jQuery<\/span><span style=\"color: #F6F6F4\">(document).<\/span><span style=\"color: #62E884\">ready<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #F286C4\">function<\/span><span style=\"color: #F6F6F4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  document.<\/span><span style=\"color: #62E884\">querySelector<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">#open-add-location-overlay<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">).<\/span><span style=\"color: #62E884\">click<\/span><span style=\"color: #F6F6F4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">});<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Activate\/Deactivate a Marker Category<\/h2>\n\n\n\n<p>Use the following JS function to trigger a click on a marker category. The number (e.g. &#8220;3&#8221;) is the position of the category in the category list. <\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"jQuery(document).ready(function() {\n  document.querySelector('.oum-filter-list label:nth-of-type(3)').click();\n});\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">jQuery<\/span><span style=\"color: #F6F6F4\">(document).<\/span><span style=\"color: #62E884\">ready<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #F286C4\">function<\/span><span style=\"color: #F6F6F4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  document.<\/span><span style=\"color: #62E884\">querySelector<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">.oum-filter-list label:nth-of-type(3)<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">).<\/span><span style=\"color: #62E884\">click<\/span><span style=\"color: #F6F6F4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">});<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:44px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To activate or deactivate all marker categories at the same time you can use this snippet:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"jQuery(document).ready(function() {\n  document.querySelectorAll('.oum-filter-list label').forEach((category) =&gt; {\n    category.click()\n  });\n});\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">jQuery<\/span><span style=\"color: #F6F6F4\">(document).<\/span><span style=\"color: #62E884\">ready<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #F286C4\">function<\/span><span style=\"color: #F6F6F4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  document.<\/span><span style=\"color: #62E884\">querySelectorAll<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">.oum-filter-list label<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">).<\/span><span style=\"color: #62E884\">forEach<\/span><span style=\"color: #F6F6F4\">((<\/span><span style=\"color: #FFB86C; font-style: italic\">category<\/span><span style=\"color: #F6F6F4\">) <\/span><span style=\"color: #F286C4\">=&gt;<\/span><span style=\"color: #F6F6F4\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    category.<\/span><span style=\"color: #62E884\">click<\/span><span style=\"color: #F6F6F4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  });<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">});<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:54px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To activate a specific marker category on page load you can use this snippet. Just add the parameter ?oum-category=3 to your URL on page load. The number (e.g. &#8220;3&#8221;) is the position of the category in the category list. See <a href=\"https:\/\/www.open-user-map.com\/demo\/?oum-category=2\">this example<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"\/\/ Function to get the value of a specific URL parameter\nfunction getQueryParam(param) {\n  const urlParams = new URLSearchParams(window.location.search);\n  return urlParams.get(param);\n}\n\n\/\/ Get the 'oum-category' parameter value from the URL\nconst categoryNumber = getQueryParam('oum-category');\n  \n\/\/ Check if the 'oum-category' parameter is present\nif (categoryNumber !== null) {\n  \/\/ Click all categories first\n  document.querySelectorAll('.oum-filter-list label').forEach((category) =&gt; {\n    category.click();\n  });\n\n  \/\/ Click specifically on the label based on the 'oum-category' value\n  \/\/ Convert categoryNumber to a 1-based index for :nth-child() selector\n  const categoryIndex = parseInt(categoryNumber, 10);\n  if (!isNaN(categoryIndex)) { \/\/ Ensure categoryNumber is a valid number\n    const targetLabel = document.querySelector(`.oum-filter-list label:nth-of-type(${categoryIndex})`);\n    if (targetLabel) {\n      targetLabel.click();\n    } else {\n      console.error('Specified category index is out of range.');\n    }\n  } else {\n    console.error('Invalid category number specified in the URL parameter.');\n  }\n}\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #7B7F8B\">\/\/ Function to get the value of a specific URL parameter<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">function<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">getQueryParam<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #FFB86C; font-style: italic\">param<\/span><span style=\"color: #F6F6F4\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #F286C4\">const<\/span><span style=\"color: #F6F6F4\"> urlParams <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4; font-weight: bold\">new<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">URLSearchParams<\/span><span style=\"color: #F6F6F4\">(window.location.search);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #F286C4\">return<\/span><span style=\"color: #F6F6F4\"> urlParams.<\/span><span style=\"color: #62E884\">get<\/span><span style=\"color: #F6F6F4\">(param);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #7B7F8B\">\/\/ Get the &#39;oum-category&#39; parameter value from the URL<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">const<\/span><span style=\"color: #F6F6F4\"> categoryNumber <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">getQueryParam<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">oum-category<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><\/span>\n<span class=\"line\"><span style=\"color: #7B7F8B\">\/\/ Check if the &#39;oum-category&#39; parameter is present<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">if<\/span><span style=\"color: #F6F6F4\"> (categoryNumber <\/span><span style=\"color: #F286C4\">!==<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">null<\/span><span style=\"color: #F6F6F4\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ Click all categories first<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  document.<\/span><span style=\"color: #62E884\">querySelectorAll<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">.oum-filter-list label<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">).<\/span><span style=\"color: #62E884\">forEach<\/span><span style=\"color: #F6F6F4\">((<\/span><span style=\"color: #FFB86C; font-style: italic\">category<\/span><span style=\"color: #F6F6F4\">) <\/span><span style=\"color: #F286C4\">=&gt;<\/span><span style=\"color: #F6F6F4\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    category.<\/span><span style=\"color: #62E884\">click<\/span><span style=\"color: #F6F6F4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  });<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ Click specifically on the label based on the &#39;oum-category&#39; value<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ Convert categoryNumber to a 1-based index for :nth-child() selector<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #F286C4\">const<\/span><span style=\"color: #F6F6F4\"> categoryIndex <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">parseInt<\/span><span style=\"color: #F6F6F4\">(categoryNumber, <\/span><span style=\"color: #BF9EEE\">10<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #F286C4\">if<\/span><span style=\"color: #F6F6F4\"> (<\/span><span style=\"color: #F286C4\">!<\/span><span style=\"color: #62E884\">isNaN<\/span><span style=\"color: #F6F6F4\">(categoryIndex)) { <\/span><span style=\"color: #7B7F8B\">\/\/ Ensure categoryNumber is a valid number<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    <\/span><span style=\"color: #F286C4\">const<\/span><span style=\"color: #F6F6F4\"> targetLabel <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> document.<\/span><span style=\"color: #62E884\">querySelector<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #E7EE98\">`.oum-filter-list label:nth-of-type(<\/span><span style=\"color: #F286C4\">${<\/span><span style=\"color: #F6F6F4\">categoryIndex<\/span><span style=\"color: #F286C4\">}<\/span><span style=\"color: #E7EE98\">)`<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    <\/span><span style=\"color: #F286C4\">if<\/span><span style=\"color: #F6F6F4\"> (targetLabel) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">      targetLabel.<\/span><span style=\"color: #62E884\">click<\/span><span style=\"color: #F6F6F4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    } <\/span><span style=\"color: #F286C4\">else<\/span><span style=\"color: #F6F6F4\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">      console.<\/span><span style=\"color: #62E884\">error<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">Specified category index is out of range.<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  } <\/span><span style=\"color: #F286C4\">else<\/span><span style=\"color: #F6F6F4\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    console.<\/span><span style=\"color: #62E884\">error<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">Invalid category number specified in the URL parameter.<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Auto-populate the subtitle field<\/h2>\n\n\n\n<p>When the user searches and clicks on a suggested address in the &#8220;Add Location&#8221; form, the subtitle field can be automatically populated with the name of that location:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">JavaScript<\/span><span role=\"button\" tabindex=\"0\" data-code=\"oumMap2.addEventListener('geosearch\/showlocation', function(e) { \n  document.querySelector('#oum_location_address').value = e.location.label;\n});\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">oumMap2.<\/span><span style=\"color: #62E884\">addEventListener<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">geosearch\/showlocation<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">, <\/span><span style=\"color: #F286C4\">function<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #FFB86C; font-style: italic\">e<\/span><span style=\"color: #F6F6F4\">) { <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  document.<\/span><span style=\"color: #62E884\">querySelector<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">#oum_location_address<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">).value <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> e.location.label;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">});<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Vous pouvez d\u00e9clencher un certain nombre de fonctions Javascript. Il est possible d'ajouter des JS personnalis\u00e9s directement dans les param\u00e8tres du plugin. Allez dans Open User Map &gt; Settings &gt; Advanced &gt; Custom JS. Voici quelques cas d'utilisation possibles : Recharger la carte Cela peut \u00eatre utile si vous utilisez un plugin de mise en cache ou de pr\u00e9chargement de page. ... <a href=\"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/trigger-map-actions-with-javascript\/\">Suite<\/a><\/p>","protected":false},"author":50,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[25],"ht-kb-tag":[29,76,75,74,77,78],"class_list":["post-4586","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-customization","ht_kb_tag-automation","ht_kb_tag-cache","ht_kb_tag-current-location","ht_kb_tag-js","ht_kb_tag-preloading","ht_kb_tag-rocket"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Trigger map actions with Javascript - Open User Map<\/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.open-user-map.com\/fr\/knowledge-base\/trigger-map-actions-with-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Trigger map actions with Javascript - Open User Map\" \/>\n<meta property=\"og:description\" content=\"You can trigger a number of Javascript functions. It is possible to add custom JS directly in the plugin settings. Go to Open User Map &gt; Settings &gt; Advanced &gt; Custom JS. Here are some possible use cases: Reload the map This may be helpful if you are using a Caching or Page Preloading Plugin. &hellip; Continued\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/trigger-map-actions-with-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Open User Map\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-10T16:26:59+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/\"},\"author\":{\"name\":\"Daniel Sch\u00f6nherr\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#\\\/schema\\\/person\\\/d9c8cbe470ae2702b6de61e0f73a7402\"},\"headline\":\"Trigger map actions with Javascript\",\"datePublished\":\"2023-02-26T08:50:58+00:00\",\"dateModified\":\"2024-11-10T16:26:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/\"},\"wordCount\":275,\"publisher\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#organization\"},\"inLanguage\":\"fr-FR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/\",\"url\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/\",\"name\":\"Trigger map actions with Javascript - Open User Map\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#website\"},\"datePublished\":\"2023-02-26T08:50:58+00:00\",\"dateModified\":\"2024-11-10T16:26:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/knowledge-base\\\/trigger-map-actions-with-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.open-user-map.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Trigger map actions with Javascript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#website\",\"url\":\"https:\\\/\\\/www.open-user-map.com\\\/\",\"name\":\"Open User Map\",\"description\":\"WordPress Map Plugin\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.open-user-map.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#organization\",\"name\":\"Open User Map\",\"url\":\"https:\\\/\\\/www.open-user-map.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.open-user-map.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/icon-256x256-1.png\",\"contentUrl\":\"https:\\\/\\\/www.open-user-map.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/icon-256x256-1.png\",\"width\":256,\"height\":256,\"caption\":\"Open User Map\"},\"image\":{\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.open-user-map.com\\\/#\\\/schema\\\/person\\\/d9c8cbe470ae2702b6de61e0f73a7402\",\"name\":\"Daniel Sch\u00f6nherr\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"D\u00e9clencher des actions de carte avec JavaScript - Open User 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.open-user-map.com\/fr\/knowledge-base\/trigger-map-actions-with-javascript\/","og_locale":"fr_FR","og_type":"article","og_title":"Trigger map actions with Javascript - Open User Map","og_description":"You can trigger a number of Javascript functions. It is possible to add custom JS directly in the plugin settings. Go to Open User Map &gt; Settings &gt; Advanced &gt; Custom JS. Here are some possible use cases: Reload the map This may be helpful if you are using a Caching or Page Preloading Plugin. &hellip; Continued","og_url":"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/trigger-map-actions-with-javascript\/","og_site_name":"Open User Map","article_modified_time":"2024-11-10T16:26:59+00:00","twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/#article","isPartOf":{"@id":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/"},"author":{"name":"Daniel Sch\u00f6nherr","@id":"https:\/\/www.open-user-map.com\/#\/schema\/person\/d9c8cbe470ae2702b6de61e0f73a7402"},"headline":"Trigger map actions with Javascript","datePublished":"2023-02-26T08:50:58+00:00","dateModified":"2024-11-10T16:26:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/"},"wordCount":275,"publisher":{"@id":"https:\/\/www.open-user-map.com\/#organization"},"inLanguage":"fr-FR"},{"@type":"WebPage","@id":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/","url":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/","name":"D\u00e9clencher des actions de carte avec JavaScript - Open User Map","isPartOf":{"@id":"https:\/\/www.open-user-map.com\/#website"},"datePublished":"2023-02-26T08:50:58+00:00","dateModified":"2024-11-10T16:26:59+00:00","breadcrumb":{"@id":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.open-user-map.com\/knowledge-base\/trigger-map-actions-with-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.open-user-map.com\/"},{"@type":"ListItem","position":2,"name":"Trigger map actions with Javascript"}]},{"@type":"WebSite","@id":"https:\/\/www.open-user-map.com\/#website","url":"https:\/\/www.open-user-map.com\/","name":"Open User Map","description":"Plugin WordPress Map","publisher":{"@id":"https:\/\/www.open-user-map.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.open-user-map.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/www.open-user-map.com\/#organization","name":"Open User Map","url":"https:\/\/www.open-user-map.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.open-user-map.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.open-user-map.com\/wp-content\/uploads\/2023\/09\/icon-256x256-1.png","contentUrl":"https:\/\/www.open-user-map.com\/wp-content\/uploads\/2023\/09\/icon-256x256-1.png","width":256,"height":256,"caption":"Open User Map"},"image":{"@id":"https:\/\/www.open-user-map.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.open-user-map.com\/#\/schema\/person\/d9c8cbe470ae2702b6de61e0f73a7402","name":"Daniel Sch\u00f6nherr"}]}},"_links":{"self":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb\/4586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/comments?post=4586"}],"version-history":[{"count":0,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb\/4586\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/media?parent=4586"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb-category?post=4586"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb-tag?post=4586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}