Skip to content

Commit b66db7b

Browse files
committed
new setup for mapped resources
1 parent 4378f43 commit b66db7b

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

dist/breinify-assets.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,19 @@
217217
});
218218
},
219219

220-
refreshMappedResource: function ($el) {
220+
refreshMappedResource: function ($el, settings) {
221221
const data = $el.data(this.marker.mappedResourceData.settings);
222222

223223
// mapId was no string and empty
224224
if (!$.isPlainObject(data) || typeof data.mapId !== 'string' || data.mapId === '') {
225225
return;
226226
}
227227

228-
const source = this._createSource(data.mapId);
228+
const source = this._createSource(data.mapId, settings);
229229
$el.removeAttr('src');
230230
$el.attr('src', source);
231+
232+
data.source = source;
231233
},
232234

233235
_renderMappedResource: function ($el) {
@@ -303,7 +305,7 @@
303305
}
304306
},
305307

306-
_createSource: function (mapId) {
308+
_createSource: function (mapId, settings) {
307309

308310
// add the date instance (format yyyyMMdd HHmmss)
309311
const curDate = new Date();
@@ -331,7 +333,7 @@
331333
browserId: browserId
332334
}
333335
}
334-
}, user);
336+
}, user, $.isPlainObject(settings) ? settings : {});
335337

336338
// encode the data instance
337339
let suffix = '/J/';
@@ -737,8 +739,8 @@
737739
}
738740
},
739741

740-
refreshMapResource: function ($el) {
741-
_private.refreshMappedResource($el);
742+
refreshMapResource: function ($el, settings) {
743+
_private.refreshMappedResource($el, settings);
742744
},
743745

744746
areDataTagsEnabled: function () {

0 commit comments

Comments
 (0)