by
// the time this runs - it only does when this template is rendered as part of a normal
// full page load. When it's instead rendered into an AJAX-loaded fragment (e.g. a story
// box / inline edit widget - confirmed happening for this field, "ESGeoMap is not
// defined" 2026-08-24), there's no fresh for that queued script to flush into, but
// this inline block still runs as part of the fragment's own HTML regardless. Loading the
// dependency ourselves here works in both cases.
//
// Whatever else goes wrong here, this is a read-only map *preview* - it must never be able
// to throw an uncaught error, since EasySocial.ready() appears to run as one shared queue
// (confirmed 2026-08-24: a failure here was blocking the rest of the profile edit form
// from initializing at all, not just this widget). try/catch is the actual fix for that;
// everything else here just tries to make the preview work correctly in the common case.
try {
var geomapUrl = "https:\/\/mein-treff.de\/media\/com_easysocial\/scripts\/geomap.js";
var geomapCssUrl = "https:\/\/mein-treff.de\/media\/com_easysocial\/styles\/geomap.css";
function renderMap() {
var container = document.getElementById("es-geomap-field-97");
if (!container) {
return;
}
ESGeoMap.renderSingle(container, 47.5545072, 9.7049386, {
provider: "osm" });
}
function ensureGeoMap(callback) {
if (window.ESGeoMap) {
callback();
return;
}
if (!document.querySelector('link[href="' + geomapCssUrl + '"]')) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = geomapCssUrl;
document.head.appendChild(link);
}
var script = document.createElement('script');
script.src = geomapUrl;
script.onload = callback;
document.head.appendChild(script);
}
EasySocial.ready(function() {
ensureGeoMap(renderMap);
});
} catch (err) {
console.error('[ESGeoMap field]', err);
}
}());