This is a migrated thread and some comments may be shown as answers.

Change cursor type on OnShapeMouseEnter

5 Answers 98 Views
Map
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Iron
Iron
Veteran
David asked on 11 Jul 2018, 08:35 PM

I am trying to change cursor type to 'pointer' when hover over shape.

Any recommendations?

5 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 16 Jul 2018, 03:55 PM
Hi David,

You can change the visual appearance of the cursor by applying CSS to the specific shape.

I have used the Map - Shapes Layer demo as a base for modifying the cursor on hover over a circle. I have accessed the shape using the following CSS Selector: 
.RadMap .k-layer circle{
    cursor:pointer;
}

For further customization, you can follow the suggestions in the first two points of the Improve Your Debugging Skills with Chrome DevTools blog post. 

To get a better understanding on how to access specific elements on page and apply styling, the following articles may be very helpful:

Regards,
Tsvetomir
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
David
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 16 Jul 2018, 04:34 PM

Excellent!

Your post pointed me to solve it the following way:

 .RadMap .k-layer g {
            cursor:pointer;
        }

Thank you

 

0
Tsvetomir
Telerik team
answered on 17 Jul 2018, 08:18 AM
Hi David,

I would like to bring to your attention another possible approach. It involves using client-side events and JavaScript functions.

In the ClientEvents tag of the RadMap control there are two events you can subscribe to: OnShapeMouseEnter and OnShapeMouseLeave and use JavaScript to change the appearance of the cursor.
<ClientEvents OnShapeMouseEnter="shapeMouseEnter" OnShapeMouseLeave="shapeMouseLeave" . . . />

And the JavaScript functions:
  shapeMouseEnter: function(evt) {
    evt.originalEvent.target.style.cursor = "hand";
  },
   shapeMouseLeave: function(evt){
   evt.originalEvent.target.style.cursor = "cursor";
   }

Regards,
Tsvetomir
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
David
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 17 Jul 2018, 12:50 PM

Thank you Tsvetomir

I will keep this one in mind as well

0
Tsvetomir
Telerik team
answered on 19 Jul 2018, 06:46 AM
Hi David,

We are glad to hear that you have managed to resolve the issue. 

Should you need further assistance, do not hesitate to contact us.

Regards,
Tsvetomir
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Map
Asked by
David
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Tsvetomir
Telerik team
David
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or