React Native Maps: Markers image doesn't show using Custom Marker in react-native-maps

后端 未结 10 1819
别那么骄傲
别那么骄傲 2021-02-05 16:52

I\'m using react-native-maps but I faced a problem that after a lot of googling without answer makes me ask it here. I\'m trying to use Custom Marker for the marker

10条回答
  •  隐瞒了意图╮
    2021-02-05 17:18

    I had the same problem.

    When you first load an application, the image does not show, but for later loading, this problem is resolved and show image.

    Just enough after the image is loaded call this.forceUpdate()

    const defaultEmployeeLogo = require("../../../assets/defualtEmployee.png");
    
     this.forceUpdate()}>
        {Math.random()}
    
    

    You can track this:

    https://github.com/react-community/react-native-maps/issues/924

提交回复
热议问题