Commit Graph

53 Commits

Author SHA1 Message Date
Andreas Hocevar
33ce206bab Get rid of MapBrowserPointerEvent 2020-05-10 16:54:34 +02:00
Tim Schaub
054af09032 Make code prettier
This updates ESLint and our shared eslint-config-openlayers to use Prettier.  Most formatting changes were automatically applied with this:

    npm run lint -- --fix

A few manual changes were required:

 * In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
 * In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason.  While editing this, I reworked `ExampleBuilder` to be a class.
 * In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
2020-04-06 12:54:09 -06:00
Thomas Chandelle
33a8466913 Add API method abortDrawing and dispatch a DRAWABORT event 2020-02-13 17:22:39 +01:00
Otto Pellinen
0b3bd0721e Add dedicated tests for appendCoordinates 2020-02-10 16:48:12 +01:00
Matt Walker
eeec2b9e7d Lint: remove unused imports 2020-01-13 11:32:40 +00:00
Matt Walker
5ce532e3e4 Mock PointerEvent in tests to include target
The `target` Event property is readonly as it is set internally when an
event is dispatched. This change uses a plain object with the essential
properties that a PointerEvent has which is sufficent for map event handling
2020-01-13 10:46:40 +00:00
mike-000
2e544cb677 Circles and custom geometry in user coordinates
Pass the view projection to the geometry function so circles and other custom geometry can be given the expected shape/size in the view while being defined in user coordinates.

Add tests to draw circles in a user projection and along both axes
Draw regular polygon in a user projection
Draw box in a user projection
2019-12-10 19:47:37 +00:00
Frederic Junod
51c9b56254 Remove all the sketch features in abortDrawing 2019-11-06 14:18:55 +01:00
Tim Schaub
7c8b2215d4 Remove unused code 2019-09-29 07:05:48 -06:00
Tim Schaub
3b02f5597e Remove called assert extension 2019-09-28 18:55:38 +02:00
ahocevar
74e8e013cf Use pepjs instead of our own pointerevent polyfill 2019-08-29 18:58:53 +02:00
ahocevar
409c962caf Reset lastDragTime when condition is not met 2018-12-21 22:26:05 +01:00
ahocevar
8ab1589f9a Add getOverlay method to access sketch and selection layers 2018-08-15 10:59:38 +02:00
ahocevar
c74b9c1d55 Do not prevent default on pointermove
Instead, only prevent default on handled pointerdown events. This makes 
the `focus` condition work with interactions that involve dragging on 
touch devices.
2018-07-31 08:33:15 +02:00
ahocevar
45cf296ed4 Simplify calculation and add tests 2018-07-21 10:22:42 +02:00
Frederic Junod
35158efbf0 Fix spelling 2018-03-12 15:18:58 +01:00
Tim Schaub
f81f3e2e9f Remove static members from Draw interaction 2018-02-21 15:55:22 -08:00
Marc Jansen
6e764a20b3 Import events conditions explicitly 2018-02-05 20:36:42 +01:00
Frederic Junod
70b0d5d1cc Check if the sketch feature is defined in finishDrawing
Fixes #7035
2018-01-30 09:57:05 +01:00
Tim Schaub
7e7631c42a Named exports from ol/events 2018-01-24 10:09:57 -07:00
Andreas Hocevar
276194d554 Add tests for vertex drag 2018-01-15 13:21:07 +01:00
Andreas Hocevar
fbf951f005 Stop handling events immediately when click tolerance is exceeded 2018-01-14 23:26:28 +01:00
Tim Schaub
ad62739a6e Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
2018-01-12 00:50:30 -07:00
Tim Schaub
8cba211ecd Rename _ol_pointer_PointerEvent_ to PointerEvent 2018-01-11 13:44:45 -07:00
Tim Schaub
ca6ea355e6 Rename _ol_source_Vector_ to VectorSource 2018-01-10 09:36:28 -07:00
Tim Schaub
45c6e43b42 Rename _ol_layer_Vector_ to VectorLayer 2018-01-10 09:36:23 -07:00
Tim Schaub
1c1f008238 Rename _ol_View_ to View 2018-01-10 09:35:42 -07:00
Tim Schaub
22fce4f97b Rename _ol_Feature_ to Feature 2018-01-10 09:35:35 -07:00
Ron Young
9fa59d0735 rename map in tests 2017-12-21 23:11:42 -07:00
Marc Jansen
02002082bf Named exports from ol/array module 2017-12-19 17:22:58 +01:00
Marc Jansen
4868098495 Rename _ol_interaction_Draw_ to Draw 2017-12-15 09:43:58 -07:00
Marc Jansen
4a1d50730b Rename _ol_interaction_Interaction_ to Interaction 2017-12-15 09:39:10 -07:00
Marc Jansen
ec64789940 Rename _ol_MapBrowserPointEvent_ to MapBrowserPointerEvent 2017-12-15 16:18:32 +01:00
Tim Schaub
ac7985a5ad Rename _ol_geom_Circle_ to Circle 2017-12-14 08:57:52 -07:00
Tim Schaub
9d396280b0 Rename _ol_geom_MultiPolygon_ to MultiPolygon 2017-12-14 08:56:51 -07:00
Tim Schaub
c502f016f7 Rename _ol_geom_Polygon_ to Polygon 2017-12-14 08:56:12 -07:00
Tim Schaub
3c78cb7872 Rename _ol_geom_MultiLineString_ to MultiLineString 2017-12-14 08:55:33 -07:00
Tim Schaub
f7b3876c1b Rename _ol_geom_LineString_ to LineString 2017-12-14 08:54:53 -07:00
Tim Schaub
ad5806c29d Rename _ol_geom_MultiPoint_ to MultiPoint 2017-12-14 08:51:53 -07:00
Tim Schaub
eadec38ae2 Rename _ol_geom_Point_ to Point 2017-12-14 08:49:10 -07:00
Tim Schaub
7f47883c48 Transformed 2017-12-12 06:53:18 -07:00
Matt Walker
90d8224a08 Fix Draw.removeLastPoint exception when no points to remove 2017-12-01 15:50:21 +00:00
Tim Schaub
a3e3e99baa Get rid of useless test exports 2017-08-17 15:16:58 -04:00
Tim Schaub
46bcce464f Add missing requires to tests 2017-08-16 13:43:28 -04:00
Frederic Junod
d97d5e5164 Update finishCoordinate in ol.interaction.Draw#removeLastPoint
And don't crash if the function is called but no feature is drawn
2017-04-10 12:34:49 +02:00
Frederic Junod
392cbcc138 Enforces spacing around commas 2016-12-14 13:42:47 +01:00
Andreas Hocevar
fb1a8335ac Do not draw circle when pointer not moved 2016-11-03 12:59:36 +01:00
Björn Harrtell
9d5453a927 Test to validate sketch polygon 2016-10-27 18:56:11 +02:00
Tim Schaub
9b12cac5c6 Convenience function for drawing box-shaped polygons 2016-10-16 15:54:15 -06:00
Tim Schaub
8f57ebd2c6 Finish drawing on pointerup when in freehand mode 2016-10-15 13:47:34 -06:00