return (stackedMap ? activeMap.save(null, true) : Promise.resolve()).then(L.bind(function() {
section_id = sref['.name'];
- var m = new CBIMap(parent.config, null, null),
- s = m.section(CBINamedSection, section_id, this.sectiontype);
+ var m;
+
+ if (parent instanceof CBIJSONMap)
+ m = new CBIJSONMap(parent.data.data, null, null);
+ else
+ m = new CBIMap(parent.config, null, null);
+
+ var s = m.section(CBINamedSection, section_id, this.sectiontype);
m.parent = parent;
m.section = section_id;