react-native-maps Bug with children components keep moving location?










0















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>
)












share|improve this question
























  • 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











  • 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
















0















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>
)












share|improve this question
























  • 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











  • 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














0












0








0








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>
)












share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 4:09







Valerio Zhang

















asked Nov 14 '18 at 4:03









Valerio ZhangValerio Zhang

154115




154115












  • 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











  • 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











  • 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













2 Answers
2






active

oldest

votes


















0














please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.






share|improve this answer






























    0














    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.






    share|improve this answer






















      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
      );



      );













      draft saved

      draft discarded


















      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









      0














      please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.






      share|improve this answer



























        0














        please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.






        share|improve this answer

























          0












          0








          0







          please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.






          share|improve this answer













          please close. READ THE DOCS do not wrap your components within the mapview, but put it underneath, and use absolute.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 6:00









          Valerio ZhangValerio Zhang

          154115




          154115























              0














              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.






              share|improve this answer



























                0














                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.






                share|improve this answer

























                  0












                  0








                  0







                  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.






                  share|improve this answer













                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 1 at 9:50









                  BillBill

                  1,67543786




                  1,67543786



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      這個網誌中的熱門文章

                      How to read a connectionString WITH PROVIDER in .NET Core?

                      Node.js Script on GitHub Pages or Amazon S3

                      Museum of Modern and Contemporary Art of Trento and Rovereto