diff --git a/addons/website/static/src/snippets/s_map/options.js b/addons/website/static/src/snippets/s_map/options.js index bccc2c6ff99fe668cf35fd635f23aa20558a66d0..b79f4acabd124afbbd7deed7e9080f4e30975f99 100644 --- a/addons/website/static/src/snippets/s_map/options.js +++ b/addons/website/static/src/snippets/s_map/options.js @@ -9,9 +9,15 @@ options.registry.Map = options.Class.extend({ * @override */ onBuilt() { - const iframeEl = generateGMapIframe(); - this.$target[0].querySelector('.s_map_color_filter').before(iframeEl); - this._updateSource(); + // The iframe is added here to the snippet when it is dropped onto the + // page. However, in the case where a custom snippet saved by the user + // is dropped, the iframe already exists and doesn't need to be added + // again. + if (!this.$target[0].querySelector('.s_map_embedded')) { + const iframeEl = generateGMapIframe(); + this.$target[0].querySelector('.s_map_color_filter').before(iframeEl); + this._updateSource(); + } }, //--------------------------------------------------------------------------