Skip to content

Commit

Permalink
Fix map preview not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadjaur committed Aug 25, 2024
1 parent 8686361 commit 325e30d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
7 changes: 2 additions & 5 deletions packages/app/components/card/LargeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,10 @@ const loadStyles = (theme: any) => {
flexDirection: 'column',
alignItems: 'center',
textAlign: 'center',
padding:
Platform.OS === 'web'
? currentTheme.size.cardPadding
: currentTheme.size.mobilePadding,
padding: Platform.OS === 'web' ? '5%' : currentTheme.size.mobilePadding,
paddingHorizontal: currentTheme.padding.paddingInside,
marginBottom: 20,
height: Platform.OS === 'web' ? 650 : '23%',
height: Platform.OS === 'web' ? 'calc(min( 80vh, 80vw))' : '23%',
minHeight: 350,
overflow: 'hidden',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/map/src/Map.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
import MapButtonsOverlay from './MapButtonsOverlay';

import { gpx as toGeoJSON } from '@tmcw/togeojson';
import { useNativeMap } from 'app/hooks/map/useNativeMap';
import { useNativeMap } from './hooks/useNativeMap';
import * as DocumentPicker from 'expo-document-picker';
import * as FileSystem from 'expo-file-system';
import { DOMParser } from 'xmldom';
Expand Down
2 changes: 1 addition & 1 deletion packages/map/src/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const WebMap: FC<MapProps> = ({ shape: shapeProp }) => {
const handleGpxUpload = useGpxUpload(setShape);

const element = (
<View style={[styles.container, { height: showModal ? '100%' : 400 }]}>
<View style={[styles.container, { height: '100%' }]}>
{showModal || isPolygonOrMultiPolygon(shape) ? (
<View
key="map"
Expand Down
1 change: 1 addition & 0 deletions packages/map/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const Map: React.FC<MapProps> = ({
<View
style={{
width: '100%',
flex: 1,
paddingHorizontal: 5,
marginBottom: 20,
}}
Expand Down
6 changes: 2 additions & 4 deletions server/src/controllers/mapPreview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ const getMapPreview = async (ctx: Context) => {
}

const newResponse = new Response(response.body, {
status: 200,
headers: {
'Content-Type': 'image/png',
},
});

console.log('newResponse', newResponse);

// return newResponse;
return ctx.json(newResponse, 200);
return newResponse;
} catch (error) {
console.log(error);
return ctx.json({ error: error.message }, 400);
Expand Down

0 comments on commit 325e30d

Please sign in to comment.