@@ -147,43 +147,38 @@ export function Page() {
147147 zoom : 10
148148 } ;
149149
150- // LngLatCoords(LngLatProps);
151-
152-
153150 // if photo exists
154- if ( imageExists ( "https://rockd.org/api/v1/protected/image/" + checkin . person_id + "/thumb_large/" + observation . photo ) ) {
155- observations . push (
156- h ( 'div' , { className : 'observation' } , [
157- h ( BlankImage , { className : 'observation-img' , src : "https://rockd.org/api/v1/protected/image/" + checkin . person_id + "/thumb_large/" + observation . photo } ) ,
158- h ( 'h4' , { className : 'observation-header' } , observation . rocks . strat_name ?. strat_name_long ) ,
159- h ( 'div' , { className : 'observation-details' } , [
160- h ( 'p' , { className : 'observation-detail' } , observation . rocks . strat_name ?. strat_name_long ) ,
161- h ( 'p' , { className : 'observation-detail' } , observation . rocks . map_unit ?. unit_name ) ,
162- h ( 'p' , { className : 'observation-detail' } , observation . age_est . name + " (" + observation . age_est . b_age + " - " + observation . age_est . t_age + ")" ) ,
163- h ( 'p' , { className : 'observation-detail' } , liths ) ,
164- h ( 'p' , { className : 'observation-detail' } , observation . orientation . feature ?. name ) ,
165- h ( 'p' , { className : 'observation-detail' } , "Coords: " + observation . lat + ", " + observation . lng ) ,
166- ] ) ,
167- ] )
168- ) ;
169- } else {
170- observations . push (
171- h ( 'div' , { className : 'observation' } , [
172- h ( BlankImage , { className : 'observation-img' , src : "https://storage.macrostrat.org/assets/rockd/rockd.jpg" } ) ,
173- h ( 'h4' , { className : 'observation-header' } , observation . rocks . strat_name ?. strat_name_long ) ,
174- h ( 'div' , { className : 'observation-details' } , [
175- h ( 'p' , { className : 'observation-detail' } , observation . rocks . strat_name ?. strat_name_long ) ,
176- h ( 'p' , { className : 'observation-detail' } , observation . rocks . map_unit ?. unit_name ) ,
177- h ( 'p' , { className : 'observation-detail' } , observation . age_est . name + " (" + observation . age_est . b_age + " - " + observation . age_est . t_age + ")" ) ,
178- h ( 'p' , { className : 'observation-detail' } , liths ) ,
179- h ( 'p' , { className : 'observation-detail' } , observation . orientation . feature ?. name ) ,
180- ] ) ,
181- ] )
182- ) ;
183- }
151+ let imageSrc ;
152+ imageSrc = imageExists ( "https://rockd.org/api/v1/protected/image/" + checkin . person_id + "/thumb_large/" + observation . photo ) ? "https://rockd.org/api/v1/protected/image/" + checkin . person_id + "/thumb_large/" + observation . photo : "https://storage.macrostrat.org/assets/rockd/rockd.jpg" ;
153+ let obsAge = observation . age_est ? observation . age_est . name + " (" + observation . age_est . b_age + " - " + observation ?. age_est ?. t_age + ")" : null ;
154+
155+ console . log ( "PRINTING" , observation . age_est ) ;
156+ observations . push (
157+ h ( 'div' , { className : 'observation' } , [
158+ h ( BlankImage , { className : 'observation-img' , src : imageSrc } ) ,
159+ h ( 'h4' , { className : 'observation-header' } , observation . rocks . strat_name ?. strat_name_long ) ,
160+ h ( 'div' , { className : 'observation-details' } , [
161+ h ( 'p' , { className : 'observation-detail' } , observation . rocks . strat_name ?. strat_name_long ) ,
162+ h ( 'p' , { className : 'observation-detail' } , observation . rocks . map_unit ?. unit_name ) ,
163+ h ( 'p' , { className : 'observation-detail' } , obsAge ) ,
164+ h ( 'p' , { className : 'observation-detail' } , liths ) ,
165+ h ( 'p' , { className : 'observation-detail' } , observation . orientation . feature ?. name ) ,
166+ LngLatCoords ( LngLatProps )
167+ ] ) ,
168+ ] )
169+ ) ;
184170 }
185171 }
186172
173+ let LngLatProps = {
174+ position : {
175+ lat : checkin . lat ,
176+ lng : checkin . lng
177+ } ,
178+ precision : 3 ,
179+ zoom : 10
180+ } ;
181+
187182 return h ( 'div' , [
188183 h ( 'div' , { className : 'main' } , [
189184 h ( 'h1' , { className : "checkin-header" } , checkin . description ) ,
@@ -196,6 +191,7 @@ export function Page() {
196191 h ( 'p' , { className : 'location' } , [
197192 h ( 'p' , "Near " + checkin . near ) ,
198193 ] ) ,
194+ LngLatCoords ( LngLatProps ) ,
199195 h ( 'h3' , { className : 'rating' } , ratingArr ) ,
200196 ] ) ,
201197 ] ) ,
0 commit comments