Google Maps API v3 draggableCursor options such as

2019-08-12 05:06发布

This is a long shot, but I was wondering if there were any settings in Google Maps API v3 that would allow me to set where on my custom "draggableCursor" the tip/end (for lack of a better word) of the cursor should be. The default settings seem to be that the top left hand corner of the image is the cursor point, but I want it to be the bottom left hand side.

Here is my code so far:

map.setOptions({ draggableCursor: 'url(images/markers/you_marker.cur), default' });

2条回答
做个烂人
2楼-- · 2019-08-12 05:18

Andrew Leach's answer is correct in that the cursor hotspot is defined in the .cur file, except Google Maps won't recognize it.

For a custom cursor in Google Maps you can change the hotspot by setting the coordinates in a CSS rule:

map.setOptions({ draggableCursor: 'url(images/markers/you_marker.cur) 16 16, default' });
查看更多
Bombasti
3楼-- · 2019-08-12 05:23

The hotspot for a cursor should be defined in the .cur file. It defaults to the top-left in the absence of any other position being specified. The API simply specifies which cursor file to use.

http://www.axialis.com/tutorials/what-is-a-cursor.html#t8 (other cursor design programs are available).

查看更多
登录 后发表回答