Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cursor when in draw text mode? #1405

Closed
barchambeault-lightbox opened this issue Oct 19, 2023 · 2 comments · Fixed by #1410
Closed

Change cursor when in draw text mode? #1405

barchambeault-lightbox opened this issue Oct 19, 2023 · 2 comments · Fixed by #1410
Labels
fixed Issues that are fixed in develop or in a PR

Comments

@barchambeault-lightbox
Copy link

When you go into draw mode for lines, polygons, etc., the cursor changes to a crosshair, and there's a vertex circle that follows your crosshair around.

however, when you go into edit mode for Text, the cursor changes to a hand, and there's a vertex circle that follows your hand around. Is there a way to change that hand to something else? what about the vertex circle?

i found this: #779, which allows me to change the color of the vertex circle, but i haven't been able to find anything that allows me to change the cursor.

@Falke-Design
Copy link
Collaborator

Sorry for the late response.

With #1410 the crosshair cursor will be shown while Text Layer drawing. Also instead of changing the cursor over inline-css the class geoman-draw-cursor will be added then, so the cursor can be overwritten.

A workaround for now:

map.on('pm:drawstart',(e)=>{
    if(e.shape === 'Text'){
        map.getContainer().style.cursor = 'Crosshair';
    }
});
map.on('pm:drawend',(e)=>{
    if(e.shape === 'Text'){
        map.getContainer().style.cursor = '';
    }
});

@Falke-Design Falke-Design added the fixed Issues that are fixed in develop or in a PR label Nov 5, 2023
@barchambeault-lightbox
Copy link
Author

@Falke-Design thanks for the response. we ended up doing almost this exact workaround, but using a custom css class with DomUtil.addClass() and DomUtil.removeClass(). nice to hear that there will be a more "correct" way of doing this once that new feature is released. we use the "pro" version, which is behind the "free" version in terms of bug fixes and new features. any idea when the "pro" version will catch up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issues that are fixed in develop or in a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants