ngx-openlayers icon indicating copy to clipboard operation
ngx-openlayers copied to clipboard

Mouse issue on next build

Open achimha opened this issue 4 years ago • 6 comments

Using the current next branch, the map does not respond to mouse events when running the sample from git.

I have the same problem using the package in my application.

I tried pinning ol at version 5.3.3 with no change.

Angular is at 8.2.11 with the sample.

achimha avatar Mar 01 '20 09:03 achimha

I have the same issue in angular 9.07

Ghostbird avatar Mar 25 '20 14:03 Ghostbird

MapComponent seems to have these EventEmitters, couple of them are new

    olClick: EventEmitter<MapBrowserEvent>;
    dblClick: EventEmitter<MapBrowserEvent>;
    moveStart: EventEmitter<MapEvent>;
    moveEnd: EventEmitter<MapEvent>;
    pointerDrag: EventEmitter<MapBrowserEvent>;
    pointerMove: EventEmitter<MapBrowserEvent>;
    onpostrender: EventEmitter<RenderEvent>;
    postRender: EventEmitter<MapEvent>;
    onprerender: EventEmitter<RenderEvent>;
    propertyChange: EventEmitter<ObjectEvent>;
    singleClick: EventEmitter<MapBrowserEvent>;

I can successfully use singleClick to click some features

Hobbes1987 avatar Mar 25 '20 15:03 Hobbes1987

It seems onClick has been renamed to olClick.

Ghostbird avatar Mar 25 '20 15:03 Ghostbird

I have the same issue after moving from Angular 7 to 9, did anyone know how to fix? PS: when dragging or clicking on zoom in/ out the values are changed but the map stays the same. Should I override onClick in my ts file?

joenini avatar Apr 02 '20 13:04 joenini

Well, I don't know what causes your issues with the controls, but as mentioned above, the EventEmitter onClick was renamed to olClick.

Replace <aol-map onClick=... with <aol-map olClick=.... That should solve at least part of your problems.

Ghostbird avatar Apr 03 '20 11:04 Ghostbird

I have recently updated my project from Angular 8 and ngx-openlayers.next-11 to Angular9 and ngx-openlayers.next-15 (with ol 6.3.1), updated the event outputs to use the new names (olClick, moveEnd, etc) and am experiencing the same issue. Mouse events are not being triggered as they were previously. Browser I am using is Chrome.

I found the following was happening:

  • Clicking map does not fire (olClick)
  • Scrolling mouse wheel does not fire (mapMoveEnd) zoom the map, but setting aol-view [zoom] value does.
  • (pointerMove) is not fired when move moves over the map
  • Clicking and dragging the map fires the following event sequence: (pointerMove) -> (pointerDrag). The (moveEnd) event is not fired. Additionally if the mouse leaves the map area and then re-enters after dragging the map the (pointerMove) -> (pointerDrag) events are fired. This seems to only happen once (sometimes twice) after dragging the map.
  • (drawStart),(drawEnd), (modifyStart), (modifyEnd) events are not fired.

I reverted my project back to Angular 8 and tried using ngx-openlayers.next-13 and experienced similar issues.

Reverting back to Angular 8 and ngx-openlayers.next-11 and project was again working correctly.

panaaj avatar Jun 09 '20 03:06 panaaj