Skip to content

Custom Marker issue #5640

@PabloHernan2000

Description

@PabloHernan2000

Summary

Hello.

Reproducible sample code

import { View, Image } from 'react-native'
import React, { memo, useState } from 'react'
import { Marker } from 'react-native-maps'

const BusMarkerComponent = memo(({ coordinates, route, direction, arrow, rotate }) => {

    return (
        <Marker
            coordinate={coordinates}
            title={path}
            centerOffset={{ x: 0.5, y: 0.5 }}
            anchor={{ x: 0.45, y: 0.45 }}
        >
            <View style={{ justifyContent: 'center', alignItems: 'center' }}>
                <Image source={direction} style={{ width: 70, height: 70, transform: [{ rotate: rotate }] }} />
<Image source={arrow} style={{ maxWidth: 14, maxHeight: 14, width: 14, height: 14, position: 'absolute', top: 20, left: 10, tintColor: 'black' }} resizeMode={'contain'} />
</View>
</Marker>
)
})

export default AutobusMarkerComponent;

Steps to reproduce

In my react native app I am using markers as follows

On iOS, the images are displayed correctly, but on Android, it doesn't show anything. Only if I press it, it shows me the text in the title.

Am I doing something wrong?

Expected result

Has anyone had the same problem? Is there a solution? How?

Actual result

I've been trying and haven't been able to come up with a solution.

React Native Maps Version

1.24.10

What platforms are you seeing the problem on?

Android

React Native Version

0.80.1

What version of Expo are you using?

Not using Expo

Device(s)

Android Simulator

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions