How do i set a custom image for the mouse cursor in a google map api v3 map

老子叫甜甜 提交于 2019-12-01 04:25:42

On mac it work perfectly on chrome, safari and firefox.

I simply use this:

map.setOptions({ draggableCursor : "url(http://s3.amazonaws.com/besport.com_images/status-pin.png), auto" })

ps: I read somewhere that you need your image to be under 64x64 on certain browser. Never have to try but maybe your problem is coming from that.

To back to the default cursor you can assing undefinded to draggableCursor variable:

map.setOptions({draggableCursor: undefined})

For those who are looking to set SVG as your draggableCursor. The solution us below.

 map.setOptions({ draggableCursor : "url(PATH_TO_YOUR_SVG.svg), pointer" });

Trust me its possible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!