react-native-maps Bug with children components keep moving location?
https://ufile.io/1bdoq
Bug:
Mapview wrapped children components may or may not leave the parent component when app loads.
Simulator:
iOS iPhone 6
xCode 10
Environment :
react-native-cli: 2.0.1
react-native: 0.57.0
"react-native-maps": "^0.22.1",
import React, Component from 'react';
import View, Text, TouchableOpacity from 'react-native'
import MapView from 'react-native-maps';
import SearchBar from 'react-native-elements'
import FontAwesome5 from 'react-native-vector-icons/dist/FontAwesome5'
export default class Search extends Component
static navigationOptions =
title: 'Search',
header: null
;
constructor(props)
super(props);
this.state =
region:
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
,
onRegionChange(region)
this.setState( region );
render()
return(
<View style=flex:1>
<MapView
style=flex: 1
onRegionChange=(region) => this.onRegionChange(region)
initialRegion=this.state.region
>
<SearchBar
containerStyle=backgroundColor: 'rgba(0,0,0,0)', borderTopWidth: 0, borderBottomWidth: 0, marginLeft: 10, marginRight: 10
inputStyle=backgroundColor: 'white', marginTop: 30
icon=type: 'material', color: '#86939e', name: 'search',style:marginTop: 22, zIndex: 9999999
lightTheme
/>
<TouchableOpacity style= height: 30, width: 150, backgroundColor:'white', justifyContent: 'center', paddingLeft: 10, paddingRight: 10>
<Text style=textAlign: 'center'>Current Location</Text>
</TouchableOpacity>
<TouchableOpacity style= height: 30, width: 30, backgroundColor:'blue', justifyContent: 'center'>
<FontAwesome5 name="location-arrow" size=20 color="white"/>
</TouchableOpacity>
</MapView>
</View>
)
react-native react-native-ios react-native-maps
add a comment |
https://ufile.io/1bdoq
Bug:
Mapview wrapped children components may or may not leave the parent component when app loads.
Simulator:
iOS iPhone 6
xCode 10
Environment :
react-native-cli: 2.0.1
react-native: 0.57.0
"react-native-maps": "^0.22.1",
import React, Component from 'react';
import View, Text, TouchableOpacity from 'react-native'
import MapView from 'react-native-maps';
import SearchBar from 'react-native-elements'
import FontAwesome5 from 'react-native-vector-icons/dist/FontAwesome5'
export default class Search extends Component
static navigationOptions =
title: 'Search',
header: null
;
constructor(props)
super(props);
this.state =
region:
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
,
onRegionChange(region)
this.setState( region );
render()
return(
<View style=flex:1>
<MapView
style=flex: 1
onRegionChange=(region) => this.onRegionChange(region)
initialRegion=this.state.region
>
<SearchBar
containerStyle=backgroundColor: 'rgba(0,0,0,0)', borderTopWidth: 0, borderBottomWidth: 0, marginLeft: 10, marginRight: 10
inputStyle=backgroundColor: 'white', marginTop: 30
icon=type: 'material', color: '#86939e', name: 'search',style:marginTop: 22, zIndex: 9999999
lightTheme
/>
<TouchableOpacity style= height: 30, width: 150, backgroundColor:'white', justifyContent: 'center', paddingLeft: 10, paddingRight: 10>
<Text style=textAlign: 'center'>Current Location</Text>
</TouchableOpacity>
<TouchableOpacity style= height: 30, width: 30, backgroundColor:'blue', justifyContent: 'center'>
<FontAwesome5 name="location-arrow" size=20 color="white"/>
</TouchableOpacity>
</MapView>
</View>
)
react-native react-native-ios react-native-maps
try givingposition:"absolute"
to themapView
children
– Naveed Sheriffdeen
Nov 14 '18 at 4:31
i have tried that, doesn't change a thing.
– Valerio Zhang
Nov 14 '18 at 5:03
try wrapping the children within a view, so only one main child is within the MapView
– Naveed Sheriffdeen
Nov 14 '18 at 5:18
then the gestures won't be registered by the mapview - and also the text still leaves the <View/>
– Valerio Zhang
Nov 14 '18 at 5:19
add a comment |
https://ufile.io/1bdoq
Bug:
Mapview wrapped children components may or may not leave the parent component when app loads.
Simulator:
iOS iPhone 6
xCode 10
Environment :
react-native-cli: 2.0.1
react-native: 0.57.0
"react-native-maps": "^0.22.1",
import React, Component from 'react';
import View, Text, TouchableOpacity from 'react-native'
import MapView from 'react-native-maps';
import SearchBar from 'react-native-elements'
import FontAwesome5 from 'react-native-vector-icons/dist/FontAwesome5'
export default class Search extends Component
static navigationOptions =
title: 'Search',
header: null
;
constructor(props)
super(props);
this.state =
region:
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
,
onRegionChange(region)
this.setState( region );
render()
return(
<View style=flex:1>
<MapView
style=flex: 1
onRegionChange=(region) => this.onRegionChange(region)
initialRegion=this.state.region
>
<SearchBar
containerStyle=backgroundColor: 'rgba(0,0,0,0)', borderTopWidth: 0, borderBottomWidth: 0, marginLeft: 10, marginRight: 10
inputStyle=backgroundColor: 'white', marginTop: 30
icon=type: 'material', color: '#86939e', name: 'search',style:marginTop: 22, zIndex: 9999999
lightTheme
/>
<TouchableOpacity style= height: 30, width: 150, backgroundColor:'white', justifyContent: 'center', paddingLeft: 10, paddingRight: 10>
<Text style=textAlign: 'center'>Current Location</Text>
</TouchableOpacity>
<TouchableOpacity style= height: 30, width: 30, backgroundColor:'blue', justifyContent: 'center'>
<FontAwesome5 name="location-arrow" size=20 color="white"/>
</TouchableOpacity>
</MapView>
</View>
)
react-native react-native-ios react-native-maps
https://ufile.io/1bdoq
Bug:
Mapview wrapped children components may or may not leave the parent component when app loads.
Simulator:
iOS iPhone 6
xCode 10
Environment :
react-native-cli: 2.0.1
react-native: 0.57.0
"react-native-maps": "^0.22.1",
import React, Component from 'react';
import View, Text, TouchableOpacity from 'react-native'
import MapView from 'react-native-maps';
import SearchBar from 'react-native-elements'
import FontAwesome5 from 'react-native-vector-icons/dist/FontAwesome5'
export default class Search extends Component
static navigationOptions =
title: 'Search',
header: null
;
constructor(props)
super(props);
this.state =
region:
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
,
onRegionChange(region)
this.setState( region );
render()
return(
<View style=flex:1>
<MapView
style=flex: 1
onRegionChange=(region) => this.onRegionChange(region)
initialRegion=this.state.region
>
<SearchBar
containerStyle=backgroundColor: 'rgba(0,0,0,0)', borderTopWidth: 0, borderBottomWidth: 0, marginLeft: 10, marginRight: 10
inputStyle=backgroundColor: 'white', marginTop: 30
icon=type: 'material', color: '#86939e', name: 'search',style:marginTop: 22, zIndex: 9999999
lightTheme
/>
<TouchableOpacity style= height: 30, width: 150, backgroundColor:'white', justifyContent: 'center', paddingLeft: 10, paddingRight: 10>
<Text style=textAlign: 'center'>Current Location</Text>
</TouchableOpacity>
<TouchableOpacity style= height: 30, width: 30, backgroundColor:'blue', justifyContent: 'center'>
<FontAwesome5 name="location-arrow" size=20 color="white"/>
</TouchableOpacity>
</MapView>
</View>
)
react-native react-native-ios react-native-maps
react-native react-native-ios react-native-maps
edited Nov 14 '18 at 4:09
Valerio Zhang
asked Nov 14 '18 at 4:03
Valerio ZhangValerio Zhang
154115
154115
try givingposition:"absolute"
to themapView
children
– Naveed Sheriffdeen
Nov 14 '18 at 4:31
i have tried that, doesn't change a thing.
– Valerio Zhang
Nov 14 '18 at 5:03
try wrapping the children within a view, so only one main child is within the MapView
– Naveed Sheriffdeen
Nov 14 '18 at 5:18
then the gestures won't be registered by the mapview - and also the text still leaves the <View/>
– Valerio Zhang
Nov 14 '18 at 5:19
add a comment |
try givingposition:"absolute"
to themapView
children
– Naveed Sheriffdeen
Nov 14 '18 at 4:31
i have tried that, doesn't change a thing.
– Valerio Zhang
Nov 14 '18 at 5:03
try wrapping the children within a view, so only one main child is within the MapView
– Naveed Sheriffdeen
Nov 14 '18 at 5:18
then the gestures won't be registered by the mapview - and also the text still leaves the <View/>
– Valerio Zhang
Nov 14 '18 at 5:19
try giving
position:"absolute"
to the mapView
children– Naveed Sheriffdeen
Nov 14 '18 at 4:31
try giving
position:"absolute"
to the mapView
children– Naveed Sheriffdeen
Nov 14 '18 at 4:31
i have tried that, doesn't change a thing.
– Valerio Zhang
Nov 14 '18 at 5:03
i have tried that, doesn't change a thing.
– Valerio Zhang
Nov 14 '18 at 5:03
try wrapping the children within a view, so only one main child is within the MapView
– Naveed Sheriffdeen
Nov 14 '18 at 5:18
try wrapping the children within a view, so only one main child is within the MapView
– Naveed Sheriffdeen
Nov 14 '18 at 5:18
then the gestures won't be registered by the mapview - and also the text still leaves the <View/>
– Valerio Zhang
Nov 14 '18 at 5:19
then the gestures won't be registered by the mapview - and also the text still leaves the <View/>
– Valerio Zhang
Nov 14 '18 at 5:19
add a comment |
2 Answers
2
active
oldest
votes
please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.
add a comment |
I would rather choose a visual testing framework in such cases to help me detect those visual differences.
So far I've been using Applitools and they are powerful in their support to many frameworks out there. The most recent feature they offer is the Root Cause Analysis (RCA) which saves you a lot of time by detecting the DOM and CSS style differences, all that you have to do then is just fix the problem without having to waste your time trying to find the problem.
I believe in your case, RCA is the best fit!
Give it a try.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293030%2freact-native-maps-bug-with-children-components-keep-moving-location%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.
add a comment |
please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.
add a comment |
please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.
please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.
answered Nov 14 '18 at 6:00
Valerio ZhangValerio Zhang
154115
154115
add a comment |
add a comment |
I would rather choose a visual testing framework in such cases to help me detect those visual differences.
So far I've been using Applitools and they are powerful in their support to many frameworks out there. The most recent feature they offer is the Root Cause Analysis (RCA) which saves you a lot of time by detecting the DOM and CSS style differences, all that you have to do then is just fix the problem without having to waste your time trying to find the problem.
I believe in your case, RCA is the best fit!
Give it a try.
add a comment |
I would rather choose a visual testing framework in such cases to help me detect those visual differences.
So far I've been using Applitools and they are powerful in their support to many frameworks out there. The most recent feature they offer is the Root Cause Analysis (RCA) which saves you a lot of time by detecting the DOM and CSS style differences, all that you have to do then is just fix the problem without having to waste your time trying to find the problem.
I believe in your case, RCA is the best fit!
Give it a try.
add a comment |
I would rather choose a visual testing framework in such cases to help me detect those visual differences.
So far I've been using Applitools and they are powerful in their support to many frameworks out there. The most recent feature they offer is the Root Cause Analysis (RCA) which saves you a lot of time by detecting the DOM and CSS style differences, all that you have to do then is just fix the problem without having to waste your time trying to find the problem.
I believe in your case, RCA is the best fit!
Give it a try.
I would rather choose a visual testing framework in such cases to help me detect those visual differences.
So far I've been using Applitools and they are powerful in their support to many frameworks out there. The most recent feature they offer is the Root Cause Analysis (RCA) which saves you a lot of time by detecting the DOM and CSS style differences, all that you have to do then is just fix the problem without having to waste your time trying to find the problem.
I believe in your case, RCA is the best fit!
Give it a try.
answered Feb 1 at 9:50
BillBill
1,67543786
1,67543786
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293030%2freact-native-maps-bug-with-children-components-keep-moving-location%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try giving
position:"absolute"
to themapView
children– Naveed Sheriffdeen
Nov 14 '18 at 4:31
i have tried that, doesn't change a thing.
– Valerio Zhang
Nov 14 '18 at 5:03
try wrapping the children within a view, so only one main child is within the MapView
– Naveed Sheriffdeen
Nov 14 '18 at 5:18
then the gestures won't be registered by the mapview - and also the text still leaves the <View/>
– Valerio Zhang
Nov 14 '18 at 5:19