5

I want to trigger an event when the user hovers over a geometry that they drew. I know how to set up hover events for DOM objects, but not for graphic elements within the map window.

7

The GraphicsLayer has an onMouseOver event (doc). Not sure if that's what you're looking for.

6
dojo.connect(yourLayer, "onMouseOver", function(evt) {

    map.setMapCursor("pointer");
});

dojo.connect(map.graphics, "onMouseOut", function(evt) {
    map.graphics.clear();
    map.setMapCursor("default");
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.