-1

I know that the usage of path is the only way to rotate the marker based on documentation they have. So I create my own PNG image for marker, but the problem I never succeed when overriding CSS of the marker.

I also tried to override the marker using DOM

document.querySelectorAll('img[src="@/assets/logo.png]')[0].parentNode.style.transform = "rotate(35deg)"

But it doesn't rotate the marker.

Any suggestion how can I rotate my customized marker?

  • You probably should not try to rotate the markers via CSS... The API supports rotation on Symbols and SVG markers. – MrUpsidown May 19 '21 at 07:03
  • Duplicate of https://stackoverflow.com/questions/49595076/google-maps-api-rotation-with-a-custom-marker-icon – MrUpsidown May 19 '21 at 07:04
  • possible duplicate of [rotate a .gif image on google maps api v3?](https://stackoverflow.com/questions/38723573/rotate-a-gif-image-on-google-maps-api-v3) – geocodezip May 20 '21 at 02:53

1 Answers1

-1

When we want to apply the css to a child component, then we need to make use of v-deep which helps in passing the css to the child.

For example: Suppose we have a component like this:

<template>
  <div>
    <child></child>
  </div>
</template>

And in the child component we have a div with id main. Then in this case, we need to make use of v-deep on the parent component to style the main tag of child component.

::v-deep .main {
  ...style-goes-here
}
Yash Maheshwari
  • 1,842
  • 2
  • 7
  • 16
  • should I put the class="main" in
    ?
    – Gerard Mendiola May 19 '21 at 03:48
  • I am just giving an example, the `main` here should be the name of the class/id whose css style you want to update. Also, it will be good if you will share some code or will create a codepen or fiddle, so that we can understand better what you want to achieve. – Yash Maheshwari May 19 '21 at 03:53