UBA Form
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 23 KiB |
|
@ -17,8 +17,8 @@ class IMarker extends PureComponent {
|
||||||
latitude: parseFloat(data.latitude),
|
latitude: parseFloat(data.latitude),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.markerRef = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const duration = 500
|
const duration = 500
|
||||||
const oldCoord = {
|
const oldCoord = {
|
||||||
|
@ -32,21 +32,21 @@ class IMarker extends PureComponent {
|
||||||
if (oldCoord.longitude !== coord.longitude || oldCoord.latitude !== coord.latitude) {
|
if (oldCoord.longitude !== coord.longitude || oldCoord.latitude !== coord.latitude) {
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
if (this.markerRef) {
|
if (this.markerRef) {
|
||||||
this.markerRef._component.animateMarkerToCoordinate(
|
if(this.markerRef._component) {
|
||||||
coord,
|
this.markerRef._component.animateMarkerToCoordinate(
|
||||||
duration
|
coord,
|
||||||
);
|
duration
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*this.state.coordinate.timing({
|
/*this.state.coordinate.timing({
|
||||||
cord,
|
cord,
|
||||||
duration
|
duration
|
||||||
}).start();
|
}).start();
|
||||||
*/
|
*/}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startAnimation() {
|
startAnimation() {
|
||||||
const initialValue = 0
|
const initialValue = 0
|
||||||
const finalValue = 1
|
const finalValue = 1
|
||||||
|
@ -61,11 +61,9 @@ class IMarker extends PureComponent {
|
||||||
}
|
}
|
||||||
).start();
|
).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleViewRef = ref => this.view = ref;
|
handleViewRef = ref => this.view = ref;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {data, network, isSelected} = this.props;
|
const { data, network, isSelected } = this.props;
|
||||||
const color = isSelected ? "#F48FB1A0" : "transparent"
|
const color = isSelected ? "#F48FB1A0" : "transparent"
|
||||||
const colorSup = isSelected ? "#F06292A0" : "transparent"
|
const colorSup = isSelected ? "#F06292A0" : "transparent"
|
||||||
const display = isSelected ? "block" : "none";
|
const display = isSelected ? "block" : "none";
|
||||||
|
@ -73,10 +71,7 @@ class IMarker extends PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Marker.Animated
|
<Marker.Animated
|
||||||
coordinate={this.state.coordinate.longitude ? this.state.coordinate : {
|
coordinate={this.state.coordinate.longitude ? this.state.coordinate : { longitude: data.longitude, latitude: data.latitude }}
|
||||||
longitude: data.longitude,
|
|
||||||
latitude: data.latitude
|
|
||||||
}}
|
|
||||||
id={data.id}
|
id={data.id}
|
||||||
title={this.props.title}
|
title={this.props.title}
|
||||||
ref={(re) => {
|
ref={(re) => {
|
||||||
|
@ -92,10 +87,9 @@ class IMarker extends PureComponent {
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (<View/>)
|
return (<View />)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error(erro) {
|
error(erro) {
|
||||||
console.log("on error render image");
|
console.log("on error render image");
|
||||||
console.log(erro);
|
console.log(erro);
|
||||||
|
@ -107,14 +101,17 @@ class IMarker extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState, snapshot) {
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
||||||
if (this.props.isUser)
|
if (this.props.isUser) {
|
||||||
if (this.markerRef && this.props.isNeedFocus) {
|
if (this.markerRef && this.props.isNeedFocus) {
|
||||||
this.markerRef._component.showCallout()
|
if(this.markerRef._component)
|
||||||
|
this.markerRef._component.showCallout()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getImage(data) {
|
getImage(data) {
|
||||||
const {isUser, network} = this.props;
|
const { isUser, network } = this.props;
|
||||||
if (isUser) {
|
if (isUser) {
|
||||||
return userposi
|
return userposi
|
||||||
} else if (network && data.network === network.name) {
|
} else if (network && data.network === network.name) {
|
||||||
|
@ -124,7 +121,7 @@ class IMarker extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
getIcon(data) {
|
getIcon(data) {
|
||||||
const {isSelected} = this.props
|
const { isSelected } = this.props
|
||||||
return isSelected ? (
|
return isSelected ? (
|
||||||
<Animated.View style={{
|
<Animated.View style={{
|
||||||
width: 32,
|
width: 32,
|
||||||
|
@ -148,9 +145,9 @@ class IMarker extends PureComponent {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}}>
|
}}>
|
||||||
<Image style={{alignSelf: 'center'}} source={this.getImage(data)}/>
|
<Image style={{ alignSelf: 'center' }} source={this.getImage(data)} />
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
) : (<Image style={{alignSelf: 'center'}} source={this.getImage(data)}/>);
|
) : (<Image style={{ alignSelf: 'center' }} source={this.getImage(data)} />);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +163,7 @@ class IMarker extends PureComponent {
|
||||||
easing: Easing.linear(),
|
easing: Easing.linear(),
|
||||||
useNativeDriver: true
|
useNativeDriver: true
|
||||||
}
|
}
|
||||||
), {iteration: -1}).start();
|
), { iteration: -1 }).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +173,9 @@ const styles = StyleSheet.create({
|
||||||
width: 52,
|
width: 52,
|
||||||
height: 52
|
height: 52
|
||||||
},
|
},
|
||||||
ring: {}
|
ring: {
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default IMarker;
|
export default IMarker;
|