From b7a88c6292c2e7bfffc3cdc4f7c7037922b3de25 Mon Sep 17 00:00:00 2001 From: Aubrey-Li <63608597+Aubrey-Li@users.noreply.github.com> Date: Mon, 6 Sep 2021 15:11:28 -0400 Subject: minor updates --- src/client/documents/Documents.ts | 4 ++-- src/client/views/nodes/MapBox/MapBox.tsx | 32 +++++++++++++++++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 1e2478c94..f112bad38 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -1376,8 +1376,8 @@ export namespace DocUtils { } proto.contentSize = result.contentSize; // exif gps data coordinates are stored in DMS (Degrees Minutes Seconds), the following operation converts that to decimal coordinates - proto.lat = getDecimalfromDMS(result.exifData?.data?.gps.GPSLatitude, result.exifData?.data?.gps.GPSLatitudeRef); - proto.lng = getDecimalfromDMS(result.exifData?.data?.gps.GPSLongitude, result.exifData?.data?.gps.GPSLongitudeRef); + proto.lat = getDecimalfromDMS(result.exifData?.data?.gps?.GPSLatitude, result.exifData?.data?.gps?.GPSLatitudeRef); + proto.lng = getDecimalfromDMS(result.exifData?.data?.gps?.GPSLongitude, result.exifData?.data?.gps?.GPSLongitudeRef); } generatedDocuments.push(doc); } diff --git a/src/client/views/nodes/MapBox/MapBox.tsx b/src/client/views/nodes/MapBox/MapBox.tsx index e62f835b2..0314aa419 100644 --- a/src/client/views/nodes/MapBox/MapBox.tsx +++ b/src/client/views/nodes/MapBox/MapBox.tsx @@ -85,6 +85,7 @@ export class MapBox extends ViewBoxAnnotatableComponent { // search for if the map marker exists, else create marker if (doc.lat !== undefined && doc.lng !== undefined) { - const marker = Docs.Create.MapMarkerDocument(NumCast(doc.lat), NumCast(doc.lng), [], {}) + const marker = Docs.Create.MapMarkerDocument(NumCast(doc.lat), NumCast(doc.lng), [doc], {}) this.allMarkers.push(marker) } }) @@ -160,6 +161,15 @@ export class MapBox extends ViewBoxAnnotatableComponent { + const markerPosition = marker.getPosition(); + const newMapMarker = Docs.Create.MapMarkerDocument(NumCast(markerPosition?.lat()), NumCast(markerPosition?.lng()), [], {}) + this.allMarkers.push(newMapMarker) } @action @@ -284,14 +294,6 @@ export class MapBox extends ViewBoxAnnotatableComponent { - new window.google.maps.Marker({ - position: location, - map: map - }); - } - public get SidebarKey() { return this.fieldKey + "-sidebar"; } @computed get sidebarHandle() { @@ -339,7 +341,7 @@ export class MapBox extends ViewBoxAnnotatableComponent func that private renderMarkers = () => { - this.allMarkers.map(place => ( + return this.allMarkers.map(place => ( { + private renderInfoWindow = () => { return this.infoWindowOpen && this.selectedPlace && (
- {// TODO need to figure out how to render these childDocs of the MapMarker in InfoWindow - marker.childDocs} + {/* {// TODO need to figure out how to render these childDocs of the MapMarker in InfoWindow + marker.childDocs} */}

@@ -403,8 +405,8 @@ export class MapBox extends ViewBoxAnnotatableComponent - {this.renderMarkers} - {this.renderInfoWindow} + {this.renderMarkers()} + {this.renderInfoWindow()}
{/* {/* */} -- cgit v1.2.3-70-g09d2