examples/measure.js
function(evt) {
  if (evt.dragging) {
    return;
  }
  /** @type {string} */
  let helpMsg = 'Click to start drawing';

  if (sketch) {
    const geom = sketch.getGeometry();
    if (geom instanceof Polygon) {
      helpMsg = continuePolygonMsg;
    } else if (geom instanceof LineString) {
      helpMsg = continueLineMsg;
    }
  }

  helpTooltipElement.innerHTML = helpMsg;
  helpTooltip.setPosition(evt.coordinate);

  helpTooltipElement.classList.remove('hidden');
}
function(evt) {
  if (evt.dragging) {
    return;
  }
  /** @type {string} */
  let helpMsg = 'Click to start drawing';

  if (sketch) {
    const geom = sketch.getGeometry();
    if (geom instanceof Polygon) {
      helpMsg = continuePolygonMsg;
    } else if (geom instanceof LineString) {
      helpMsg = continueLineMsg;
    }
  }

  helpTooltipElement.innerHTML = helpMsg;
  helpTooltip.setPosition(evt.coordinate);

  helpTooltipElement.classList.remove('hidden');
}
function ( evt ) { if ( evt . dragging ) { return ; } /** @type {string} */ let helpMsg = 'Click to start drawing' ; if ( sketch ) { const geom = sketch . getGeometry ( ) ; if ( geom instanceof Polygon ) { helpMsg = continuePolygonMsg ; } else if ( geom instanceof LineString ) { helpMsg = continueLineMsg ; } } helpTooltipElement . innerHTML = helpMsg ; helpTooltip . setPosition ( evt . coordinate ) ; helpTooltipElement . classList . remove ( 'hidden' ) ; }
Handle pointer move.
@param {import("../src/ol/MapBrowserEvent").default} evt The event.
Handle pointer move .