Well I need to rotate the icon image according to the header that arrives for me.
I'm trying to make several forms but none of them worked, let's go to the codes.
FIRST TRIAL
So the problem with this attempt is related to a svg with multiple paths rotate works perfectly.
SECOND TRY [SVG URL]
this.marker = new google.maps.Marker({
position: new google.maps.LatLng(location.coords.latitude, location.coords.longitude),
map: this.map,
optimized: false,
icon: {
url: 'assets/img/maps/if_map-marker_299087.svg',
anchor: new google.maps.Point(0, 0),
size: new google.maps.Size(32, 32)
},
});
In this option my problem is when I'm going to apply path
to the image, I'm doing this:
document.querySelector('.gmnoprint img').setAttribute('style', 'transform:rotate(-134deg);');
but it is not working as it should. It adds everything right in the html but at the moment of getting the command it stays as if the background of the image has been rotating but remained in the same place; In the image on the side we can see the blue square (when I place the mouse over the image) and the image itself, the square is rotating but the image does not.
THIRD TRYING [IMG URL]
In this attempt I used the same methods of try 2 using png image, the result was the same.
PROJECT INFORMATION
@angular: 5.0.2
@types/googlemaps: 3.30.0
typescript: ^2.6.1