Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker icon SVG #4196

Closed
danieldanielecki opened this issue Apr 22, 2022 · 2 comments
Closed

Marker icon SVG #4196

danieldanielecki opened this issue Apr 22, 2022 · 2 comments

Comments

@danieldanielecki
Copy link

Feature request

Allow an icon prop of the <Marker /> component to accept .svg files.

Why it is needed

We could have a scalable icon, which wouldn't lose quality on zoom in.

Possible implementation

<Marker icon={require("../assets/images/sample.svg")} />

Code sample

Currently, pointing to .svg file would display the default marker.
<Marker icon={require("../assets/images/sample.svg")} />

screenshot

@galechus
Copy link

galechus commented Apr 28, 2022

Hi @danieldanielecki,
have you tried:

<Marker>
    <View style={{ width: 40, height: 56 }}>
        <Svg width="100%" height="100%" viewBox="0 0 40 56">
            <Path d="M19.7 0c-10.9 .2-19.7 9.1-19.7 20v.1c0 .1 0 .2 0 .3c.1 7.6 4.5 14.1 10.7 17.4c1.8 .9 3.1 2.4 3.8 4.3l5.5 13.9l5.5-14c.7-1.8 2.1-3.3 3.8-4.2c6.4-3.4 10.7-10.1 10.7-17.8c0-11-9-20-20-20c-0.1 0-0.2 0-0.3 0Z" fill={fill} />
        </Svg>
    </View>
</Marker

@affansk
Copy link

affansk commented May 1, 2022

@danieldanielecki just convert SVG to react component and use it

@react-native-maps react-native-maps locked and limited conversation to collaborators Jul 2, 2022
@monholm monholm converted this issue into discussion #4298 Jul 2, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants