diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index b17d3b3a1..a48bba24c 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -802,8 +802,8 @@ export namespace Docs { return InstanceFromProto(Prototypes.get(DocumentType.WEB), new HtmlField(html), options); } - export function MapDocument(url: string, options: DocumentOptions = {}) { - return InstanceFromProto(Prototypes.get(DocumentType.MAP), new MapField(new URL(url)), options); + export function MapDocument(documents: Array<Doc>, options: DocumentOptions = {}) { + return InstanceFromProto(Prototypes.get(DocumentType.MAP), new List(documents), options); } export function KVPDocument(document: Doc, options: DocumentOptions = {}) { @@ -1158,7 +1158,7 @@ export namespace DocUtils { created = Docs.Create.StackingDocument(DocListCast(field), resolved); layout = CollectionView.LayoutString; } else if (field instanceof MapField) { - created = Docs.Create.MapDocument((field).url.href, resolved); + created = Docs.Create.MapDocument(DocListCast(field), resolved); layout = MapBox.LayoutString; } else { @@ -1192,11 +1192,12 @@ export namespace DocUtils { if (!options._width) options._width = 400; if (!options._height) options._height = (options._width as number) * 1200 / 927; } - if (type.indexOf("map") !== -1) { - ctor = Docs.Create.MapDocument; - if (!options._width) options._width = 800; - if (!options._height) options._height = (options._width as number) * 3 / 4; - } + //TODO:al+glr + // if (type.indexOf("map") !== -1) { + // ctor = Docs.Create.MapDocument; + // if (!options._width) options._width = 800; + // if (!options._height) options._height = (options._width as number) * 3 / 4; + // } if (type.indexOf("html") !== -1) { if (path.includes(window.location.hostname)) { const s = path.split('/'); @@ -1314,8 +1315,6 @@ export namespace DocUtils { fieldTemplate = Docs.Create.AudioDocument("http://www.cs.brown.edu", options); } else if (doc.data instanceof ImageField) { fieldTemplate = Docs.Create.ImageDocument("http://www.cs.brown.edu", options); - } else if (doc.data instanceof MapField) { - fieldTemplate = Docs.Create.MapDocument("http://www.cs.brown.edu", options); } const docTemplate = docLayoutTemplate || creator?.(fieldTemplate ? [fieldTemplate] : [], { title: customName + "(" + doc.title + ")", isTemplateDoc: true, _width: _width + 20, _height: Math.max(100, _height + 45) }); |