Jump to content

How to set the background cursor icon in UniMap


Alex S

Recommended Posts

Hello,

I'm unable to set the background cursor icon in UniMap. It always remains the hand icon.
The UniMap.Cursor property does not seem to be linked? Is there another property, or method to use?

I want to capture some vectors, and want to switch to a cross-hair icon during the capturing, switching back to the default hand icon, at the end.
Currently using UniGUI 1.90.0.1534 from Delphi 10.3

Thanks,
Alex

Link to comment
Share on other sites

I was able to add these two public procedures to TUniMap in uniMap.pas:

procedure TUniMap.SetCrossHairCursor;
begin
  JSCallGlobal('$("#'+FMapJSName+'").css', ['cursor','crosshair'])
end;

procedure TUniMap.ResetCursor;
begin
  JSCallGlobal('$("#'+FMapJSName+'").css', ['cursor','']);
end;

And calling them works.

Reference: https://stackoverflow.com/questions/14106687/how-do-i-change-the-default-cursor-in-leaflet-maps

Not sure if this is the best way, but seems to work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...