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),
|
||||
}
|
||||
}
|
||||
this.markerRef = null;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const duration = 500
|
||||
const oldCoord = {
|
||||
|
@ -32,21 +32,21 @@ class IMarker extends PureComponent {
|
|||
if (oldCoord.longitude !== coord.longitude || oldCoord.latitude !== coord.latitude) {
|
||||
if (Platform.OS === 'android') {
|
||||
if (this.markerRef) {
|
||||
if(this.markerRef._component) {
|
||||
this.markerRef._component.animateMarkerToCoordinate(
|
||||
coord,
|
||||
duration
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*this.state.coordinate.timing({
|
||||
cord,
|
||||
duration
|
||||
}).start();
|
||||
*/
|
||||
*/}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
startAnimation() {
|
||||
const initialValue = 0
|
||||
const finalValue = 1
|
||||
|
@ -61,9 +61,7 @@ class IMarker extends PureComponent {
|
|||
}
|
||||
).start();
|
||||
}
|
||||
|
||||
handleViewRef = ref => this.view = ref;
|
||||
|
||||
render() {
|
||||
const { data, network, isSelected } = this.props;
|
||||
const color = isSelected ? "#F48FB1A0" : "transparent"
|
||||
|
@ -73,10 +71,7 @@ class IMarker extends PureComponent {
|
|||
|
||||
return (
|
||||
<Marker.Animated
|
||||
coordinate={this.state.coordinate.longitude ? this.state.coordinate : {
|
||||
longitude: data.longitude,
|
||||
latitude: data.latitude
|
||||
}}
|
||||
coordinate={this.state.coordinate.longitude ? this.state.coordinate : { longitude: data.longitude, latitude: data.latitude }}
|
||||
id={data.id}
|
||||
title={this.props.title}
|
||||
ref={(re) => {
|
||||
|
@ -95,7 +90,6 @@ class IMarker extends PureComponent {
|
|||
return (<View />)
|
||||
|
||||
}
|
||||
|
||||
error(erro) {
|
||||
console.log("on error render image");
|
||||
console.log(erro);
|
||||
|
@ -107,12 +101,15 @@ class IMarker extends PureComponent {
|
|||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState, snapshot) {
|
||||
if (this.props.isUser)
|
||||
if (this.props.isUser) {
|
||||
if (this.markerRef && this.props.isNeedFocus) {
|
||||
if(this.markerRef._component)
|
||||
this.markerRef._component.showCallout()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getImage(data) {
|
||||
const { isUser, network } = this.props;
|
||||
if (isUser) {
|
||||
|
@ -176,7 +173,9 @@ const styles = StyleSheet.create({
|
|||
width: 52,
|
||||
height: 52
|
||||
},
|
||||
ring: {}
|
||||
ring: {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
export default IMarker;
|