Commit 05c2039b authored by Sebastian Trebunak's avatar Sebastian Trebunak
Browse files

some more code cleanup

parent 4a5fdadd
import React, { PureComponent } from "react";
import { StyleSheet, Text } from "react-native";
import { StyleSheet } from "react-native";
// import { withNavigation } from "react-navigation";
import MapView, { Marker } from "react-native-maps";
class BranchesMap extends PureComponent {
_onPress = () => {
this.props.navigation.navigate("BranchInfo", {
branch: this.state.selectedMarker
});
};
state = {
region: this.getInitialState()
// markers: this.getMarkersFromBranches(this.props.data),
// selectedMarker: null
};
getInitialState() {
return {
latitude: 48.723221,
region: {
atitude: 48.723221,
longitude: 21.256716,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421
};
}
// getMarkersFromBranches(branches) {
// return branches.map(b => {
// markers.push({
// title: `${b.address}, ${b.zip} ${b.city}`,
// latlng: { latitude: parseFloat(b.lat), longitude: parseFloat(b.long) },
// description: "Tatra banka",
// key: `${b.lat},${b.long}`
// });
// });
// }
}
};
render() {
const { data } = this.props;
......@@ -44,14 +21,6 @@ class BranchesMap extends PureComponent {
initialRegion={this.state.region}
loadingEnabled
>
{/* {this.state.markers.map(marker => (
<Marker
key={marker.key}
coordinate={marker.latlng}
title={marker.title}
description={marker.description}
/>
))} */}
<Marker
key="marker"
coordinate={{ latitude: data.lat, longitude: data.long }}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment