teovillanueva / react-native-web-maps

Cross platform maps for react & react-native 🗺
https://teovillanueva.github.io/react-native-web-maps/
MIT License
54 stars 14 forks source link

Marker anchor property not working #11

Closed sdevansh96 closed 1 year ago

sdevansh96 commented 1 year ago

Hi

I am unable to change the marker pin offset using the anchor={{x: -0.5, y: -0.9}} property.

teovillanueva commented 1 year ago

Hey! Are you trying to center the marker?

sdevansh96 commented 1 year ago

Hi,

Used a hack to fix it.

Also is there a way to implement the UrlTile feature?

teovillanueva commented 1 year ago

Ive done my research in the past and I believe that google maps js sdk does not support loading tiles from static of external sources.

Edit: Would you mind sharing the hack you used? Maybe it's useful for someone else :)

sdevansh96 commented 1 year ago

I wanted to use SVG icon so created a component in the Marker but the icon position was not coming correct as of the default marker pin.

For ios/android we have centerOffset/anchor property to adjust the position of the maker pin but It was not working for the web.

So gave position absolute to the SVG component to centre it to the correct position.