ArcGIS JS 4.5 Change Cursor On Map Drag

1680
5
Jump to solution
12-05-2017 02:52 PM
MalcolmGruber
New Contributor II

I'm looking for a way to change the cursor on map drag and prevent ArcGIS from overriding it. Currently we're changing the cursor with CSS and this works for everything except for when we drag the map. ArcGIS overrides that and we're not sure where that is happening.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ThomasSolow
Regular Contributor

Try setting your CSS rule on view.surface rather than view.container.

ie view.surface.style.cursor = "pointer";

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

The API internally changes the cursor. I have not tested but have you tried to add a !Important on the css rule?

0 Kudos
MalcolmGruber
New Contributor II

We have done that, but it doesn't seem to make any difference.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Well that is what I thought. 

Maybe Thomas will have an idea.

TSolow-esristaff

0 Kudos
ThomasSolow
Regular Contributor

Try setting your CSS rule on view.surface rather than view.container.

ie view.surface.style.cursor = "pointer";

MalcolmGruber
New Contributor II

That totally worked! We saw an answer similar, but setting the "data-cursor" property and that didn't work.

0 Kudos