I can help you fix this - I’ve resolved this exact issue for multiple clients after zs-2022 theme updates. Your problem involves all three areas: CORS policy enforcement, widget embed configuration, and UI theme compatibility.
CORS Policy Enforcement:
The new theme in zs-2022 implements stricter Content Security Policy (CSP) rules. You need to update your app’s manifest.json to explicitly whitelist your map CDN:
"contentSecurityPolicy": {
"connect-src": ["https://maps-cdn.example.com"]
}
Additionally, modify your fetch request to include credentials mode:
fetch('https://maps-cdn.example.com/api', {
mode: 'cors',
credentials: 'omit'
})
Widget Embed Configuration:
The new theme changed the required data attributes for custom widgets. Update your widget container HTML:
<div class="custom-widget-container"
data-widget-type="map"
data-theme-compatible="v2">
</div>
Your widget initialization also needs updating to work with the new theme’s component lifecycle:
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initMapWidget);
} else {
initMapWidget();
}
UI Theme Compatibility:
The new theme uses CSS Grid instead of Flexbox for layout, which affects widget positioning. Add these CSS overrides to your widget:
.custom-widget-container {
display: block !important;
position: relative !important;
z-index: 100;
min-height: 400px;
}
The theme also introduced new CSS custom properties. Update your widget styles to use theme variables:
.map-widget {
background: var(--theme-background-primary);
border: 1px solid var(--theme-border-color);
}
Complete Fix Checklist:
- Update manifest.json with CSP rules for your map CDN
- Modify widget HTML with new data attributes (data-theme-compatible=“v2”)
- Add CSS overrides for display and positioning
- Wrap initialization in proper DOM ready check
- Update fetch calls with explicit CORS mode
- Use theme CSS variables for styling consistency
Testing Steps:
- Clear browser cache completely
- Verify manifest changes deployed successfully
- Check browser console for remaining CSP violations
- Test widget loading with network throttling to catch timing issues
The root cause is that zs-2022’s new theme enforces modern web security standards that weren’t required in older themes. Your widget code needs updating to comply with these standards while also adapting to the new DOM structure and CSS framework.
After implementing these changes, your territory assignment map should load correctly. The key is addressing all three compatibility layers simultaneously - security policy, embed configuration, and theme styling.