diff --git a/packages/geoview-core/public/templates/demos/demo-osdp-integration.html b/packages/geoview-core/public/templates/demos/demo-osdp-integration.html index 584021a36cd..8eeb08b529a 100644 --- a/packages/geoview-core/public/templates/demos/demo-osdp-integration.html +++ b/packages/geoview-core/public/templates/demos/demo-osdp-integration.html @@ -93,7 +93,7 @@

OSDP Integration

return new Promise (resolve => { removeMap('Map1') .then(() => { - cgpv.api.createMapFromConfig('Map1', JSON.stringify(mapConfig).replace(/'/g, "\\'"), 800) + cgpv.api.createMapFromConfig('Map1', JSON.stringify(mapConfig), 800) .then(() => { resolve(); }); diff --git a/packages/geoview-core/src/app.tsx b/packages/geoview-core/src/app.tsx index 37b17a96c76..417d8816a69 100644 --- a/packages/geoview-core/src/app.tsx +++ b/packages/geoview-core/src/app.tsx @@ -189,7 +189,7 @@ export async function initMapDivFromFunctionCall(mapDiv: HTMLElement, mapConfig: // Create a data-config attribute and set config value on the div const att = document.createAttribute(url ? 'data-config-url' : 'data-config'); // Clean apostrophes in the config - att.value = JSON.stringify(mapConfig).replace(/'/g, "\\'"); + att.value = mapConfig.replaceAll("'", "\\'"); mapDiv.setAttributeNode(att); // Set the geoview-map class on the div so that this class name is standard for all maps (either created via init or via func call)