Select to view content in your preferred language

ArcGIS JS 4.5 Change Cursor On Map Drag

3250
5
Jump to solution
12-05-2017 02:52 PM
MalcolmGruber
Emerging Contributor

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
Frequent 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 Emeritus

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
Emerging Contributor

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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Well that is what I thought. 

Maybe Thomas will have an idea.

TSolow-esristaff

0 Kudos
ThomasSolow
Frequent Contributor

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

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

MalcolmGruber
Emerging Contributor

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

0 Kudos