Skip to content

Improve TouchCursor UX: center-aligned crosshair, larger hit area #1155

@fg5002

Description

@fg5002

Hello, first of all — thanks for this life-saver extension to OpenLayers.

While working with TouchCursor and TouchCursorDraw, I’d like to propose some improvements on mobile/touch devices:

  • Align the interaction coordinate to the top-center of the cursor. Currently, the cursor shifts the interaction point to the top-left corner of the visual handle. This is not ideal, especially for left-handed users.
  • Use a larger cursor area by default (~ 80px). The current handle is too small for convenient finger placement.
  • Change default crosshair to something more visible (e.g. a dot or circle).

Below is the code for my Leaflet-based cursor that I've been using on mobile for years.

let divicon = L.divIcon({ iconSize: null, className: "w-2 h-2 border rounded-full border-black border-solid z-40 bg-orange-400", iconAnchor: [4, 4], html: "<div class="h-20 w-20 bg-transparent border-4 border-solid rounded-2xl mt-4 -ml-10 border-orange-400"/>"}); cursor = map() && L.marker(cursorPosition, { icon: divicon, draggable: true, autoPan: true, autoPanSpeed: 20})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions