You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using mapbox gl in my react app. And for the vehicle I am having a car icon as a marker. With each lat and lon which I am receiving as prop , I am feeding that data to the marker element and adding it to map like below,
const markerElement = document.createElement('div');
markerElement.style.backgroundImage = url(${markerImgUrl})
markerElement.style.transform = rotate(${direction}deg); // direction is the angle getting received from geolocation api
const marker = new mapboxgl.Marker({ element: markerElement }).setLngLat(lnglat).addTo(map);
However, the transform property over the marker is not working and the vehicle marker is not rotating according to the direction provided in the transform property. Please guide how to resolve this issue.
The text was updated successfully, but these errors were encountered:
I am using mapbox gl in my react app. And for the vehicle I am having a car icon as a marker. With each lat and lon which I am receiving as prop , I am feeding that data to the marker element and adding it to map like below,
const markerElement = document.createElement('div');
markerElement.style.backgroundImage =
url(${markerImgUrl})
markerElement.style.transform =
rotate(${direction}deg)
; // direction is the angle getting received from geolocation apiconst marker = new mapboxgl.Marker({ element: markerElement }).setLngLat(lnglat).addTo(map);
However, the transform property over the marker is not working and the vehicle marker is not rotating according to the direction provided in the transform property. Please guide how to resolve this issue.
The text was updated successfully, but these errors were encountered: