Skip to content

Image dosent display on the map #1

@SlavaC7

Description

@SlavaC7

When I display a picture on the map in the marker component, it is not shown on the map

code:

import { Image, View } from 'react-native'


 <MapView
        ref={mainMapRef}
        style={S.styles.map}
        toolbarEnabled={false}
        provider={MapProvider}
        userInterfaceStyle={'light'}
        maxZoomLevel={21}
        cameraZoomRange={{
          maxCenterCoordinateDistance: 1000000,
          animated: true,
        }}
        initialRegion={initialRegion}>
....
 <Marker
              tracksViewChanges={false}
              anchor={{ x: 0.5, y: 0.5 }}
              coordinate={location}>
              <View style={{ backgroundColor: 'blue' }}>
                <Image
                  source={DefaultImage}
                  // pngSource={DefaultImage}
                  style={{
                    width: 30,
                    height: 30,
                    backgroundColor: 'red',
                    zIndex: 1000,
                  }}
                />
              </View>

              <Icon name={'UserPin'} />
            </Marker>

screenshot

Image

The map shows the component (SVG) and View is displayed on the map on the coordinates, but the image is not. I could not find a solution to the problem. I have tried many ways to display the image but I can only see the red background of the image and that's it.

I also managed to display the image by interlacing the marker image={{{uri}}}. But it cannot be edited in any way (dimensions, BorderRadius, etc.).

if there are any solutions, please help me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions