Browse Source

Adding image inside MapMarker callout

master
GabrielTrettel 4 years ago
parent
commit
a2ac4e71f1
  1. 19
      src/app/components/MapMarker.js
  2. 4
      src/package.json
  3. 4453
      src/yarn.lock

19
src/app/components/MapMarker.js

@ -2,8 +2,9 @@ import React, { useState } from "react";
import { View, StyleSheet, Image, Text } from "react-native"; import { View, StyleSheet, Image, Text } from "react-native";
import MapView, { Callout } from "react-native-maps"; import MapView, { Callout } from "react-native-maps";
import colors from "../config/colors"; import colors from "../config/colors";
import assets from "../config/assets";
import { dimensions, screen_height, screen_width } from "../config/dimensions"; import { dimensions, screen_height, screen_width } from "../config/dimensions";
import { Svg, Image as ImageSvg } from "react-native-svg";
const markerSize = 30; const markerSize = 30;
export default function MapMarker({ export default function MapMarker({
@ -25,11 +26,14 @@ export default function MapMarker({
<View style={styles.container}> <View style={styles.container}>
<Text>{"Título: \t" + title}</Text> <Text>{"Título: \t" + title}</Text>
<Text>{"Descrição: \t" + description}</Text> <Text>{"Descrição: \t" + description}</Text>
<Image
style={{ width: 200, height: 200 }}
resizeMode="stretch"
source={{ uri: JSON.parse(pictures)[0] }}
/>
<Svg width={240} height={120}>
<ImageSvg
width={"100%"}
height={"100%"}
preserveAspectRatio="xMidYMid stretch"
href={{ uri: JSON.parse(pictures)[0] }}
/>
</Svg>
</View> </View>
<View style={styles.arrow}></View> <View style={styles.arrow}></View>
</View> </View>
@ -62,8 +66,7 @@ const styles = StyleSheet.create({
borderBottomWidth: 4, borderBottomWidth: 4,
borderRightWidth: 4, borderRightWidth: 4,
padding: 15, padding: 15,
width: screen_width * 0.95,
height: screen_height * 0.2,
height: 200,
}, },
markerPoint: { markerPoint: {
alignSelf: "center", alignSelf: "center",

4
src/package.json

@ -33,6 +33,7 @@
"react": "16.13.1", "react": "16.13.1",
"react-dom": "16.13.1", "react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz", "react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
"react-native-elements": "^3.2.0",
"react-native-flash-message": "^0.1.18", "react-native-flash-message": "^0.1.18",
"react-native-gesture-handler": "~1.7.0", "react-native-gesture-handler": "~1.7.0",
"react-native-keyboard-aware-scroll-view": "^0.9.3", "react-native-keyboard-aware-scroll-view": "^0.9.3",
@ -41,7 +42,8 @@
"react-native-safe-area-context": "3.1.4", "react-native-safe-area-context": "3.1.4",
"react-native-screens": "~2.10.1", "react-native-screens": "~2.10.1",
"react-native-simple-dialogs": "^1.4.0", "react-native-simple-dialogs": "^1.4.0",
"react-native-svg": "12.1.0",
"react-native-svg": "^12.1.0",
"react-native-walkthrough-tooltip": "^1.1.11",
"react-native-web": "~0.13.12", "react-native-web": "~0.13.12",
"react-navigation": "^4.4.3", "react-navigation": "^4.4.3",
"react-navigation-tabs": "^2.10.1", "react-navigation-tabs": "^2.10.1",

4453
src/yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save