0

I am trying to change a marker image on hover in here maps. Im doing in this way:

     noiseMarker.addEventListener('pointerenter', changeMarker);

 function changeMarker(evt) {
        evt.target.getIcon().c.src = activeMarker;
}

In my marker object I can see that the image source has been changed, but on the map it is not showed. Is there anyone with experience in here maps that can help me?

Markie Doe
  • 115
  • 1
  • 9
  • Possible duplicate of [How to reload/refresh an element(image) in jQuery](https://stackoverflow.com/questions/2104949/how-to-reload-refresh-an-elementimage-in-jquery) – Greedo Sep 03 '19 at 09:07

1 Answers1

1

Can you try to use the setIcon function? You have to pass it a abstractMarker.

function changeMarker(evt) {
    evt.target.setIcon(activeMarker);
}

Documentation on markers: https://developer.here.com/documentation/maps/topics_api/h-map-marker.html

Emil
  • 147
  • 2
  • 9
  • what if i have two hyperlink for two marker on the map and i am showing the first marker using setCenter. Second marker is far from first one. If I hover on the second hyperlink, how do i shift the map position to that marker using the above facility – Rahul Gupta Jul 14 '20 at 09:56