diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2020-04-15 14:04:13 -0700 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-04-15 14:04:13 -0700 |
commit | 7d3b2880bebf034607b946360c3e08338cf1d115 (patch) | |
tree | 4e8a932006a415be61ba161bcffc6f0bb9661531 | |
parent | 4d1782cbb359de2b672786df24985fbcf4be238a (diff) |
fixed fieldKey errors:
-rw-r--r-- | src/client/views/collections/CollectionMapView.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionMapView.tsx b/src/client/views/collections/CollectionMapView.tsx index 2cb25fd9a..c80555a2e 100644 --- a/src/client/views/collections/CollectionMapView.tsx +++ b/src/client/views/collections/CollectionMapView.tsx @@ -99,8 +99,9 @@ class CollectionMapView extends CollectionSubView<MapSchema, Partial<MapProps> & } private renderMarkerIcon = (layout: Doc) => { - const { Document, fieldKey } = this.props; - const iconUrl = StrCast(Document.mapIconUrl, null); + const { Document } = this.props; + const fieldKey = Doc.LayoutFieldKey(layout); + const iconUrl = StrCast(layout.mapIconUrl, StrCast(Document.mapIconUrl)); if (iconUrl) { const iconWidth = NumCast(layout[`${fieldKey}-iconWidth`], 45); const iconHeight = NumCast(layout[`${fieldKey}-iconHeight`], 45); @@ -114,7 +115,7 @@ class CollectionMapView extends CollectionSubView<MapSchema, Partial<MapProps> & } private renderMarker = (layout: Doc) => { - const location = this.getLocation(layout, this.props.fieldKey); + const location = this.getLocation(layout, Doc.LayoutFieldKey(layout)); return !location ? (null) : <Marker key={layout[Id]} @@ -175,10 +176,10 @@ class CollectionMapView extends CollectionSubView<MapSchema, Partial<MapProps> & } @computed get reactiveContents() { - const { fieldKey } = this.props; this.responders.forEach(({ location, address }) => { location(); address(); }); this.responders = []; return this.childLayoutPairs.map(({ layout }) => { + const fieldKey = Doc.LayoutFieldKey(layout); const id = layout[Id]; this.responders.push({ location: computed(() => ({ lat: layout[`${fieldKey}-lat`], lng: layout[`${fieldKey}-lng`] })) @@ -207,7 +208,7 @@ class CollectionMapView extends CollectionSubView<MapSchema, Partial<MapProps> & const { Document, fieldKey, active, google } = this.props; let center = this.getLocation(Document, `${fieldKey}-mapCenter`, false); if (center === undefined) { - center = childLayoutPairs.map(({ layout }) => this.getLocation(layout, fieldKey, false)).find(layout => layout); + center = childLayoutPairs.map(({ layout }) => this.getLocation(layout, Doc.LayoutFieldKey(layout), false)).find(layout => layout); if (center === undefined) { center = defaultLocation; } |