Commit Graph

96 Commits

Author SHA1 Message Date
Tim Schaub
85ddded15c Only remove the vertex feature if it exists
When deleting a vertex shared by multiple features, we iterate through drag segments and only need to remove the vertex feature once.
2015-08-03 22:44:22 -06:00
Tobias Bieniek
c3f51c676a interaction/modify: Fix identation issue 2015-08-01 22:05:44 +02:00
Tobias Bieniek
968c8aa34e interaction/modify: Replace lastNewVertexPixel with ignoreNextSingleClick
The previous approach did not work on mobile devices where no `pointermove`
event is sent except from dragging.

Logic now is: Upon vertex creation due to `pointerdown` we will ignore
the next `singleclick` event unless there is a `pointerdrag` event, which will
not lead to a `singleclick` event following the vertex creation.

Resolves #3935
2015-08-01 22:00:41 +02:00
Tobias Bieniek
b001a48567 interaction/modify: Simplify lastNewVertexPixel condition 2015-08-01 21:12:59 +02:00
Peter Robins
c53aa7e8d5 Correct minor typo in modifyinteraction 2015-07-05 10:57:59 +01:00
Björn Harrtell
c69ba6a3dd Create vertex on boundary single click 2015-07-03 10:26:38 +02:00
Björn Harrtell
f81e36d8e0 Add mapBrowserPointerEvent property to ModifyEvent 2015-07-03 10:11:24 +02:00
Björn Harrtell
f7d62f054c High level Modify interaction events 2015-07-03 10:11:24 +02:00
Andreas Hocevar
f645a9e1e4 Make unmanaged vector layers behave more like ol.FeatureOverlay
* Skipped features need to be hit-detected on unmanaged layers.
* updateWhileAnimating and updateWhileInteracting are recommended to
  achieve the same instant visual feedback that ol.FeatureOverlay had.
2015-06-19 13:06:29 +02:00
Andreas Hocevar
fad3cf9672 Merge pull request #3758 from ahocevar/remove-featureoverlay
Removal of ol.FeatureOverlay
2015-06-10 14:33:28 +02:00
Andreas Hocevar
53d5d8c1d9 Get rid of ol.FeatureOverlay
This also introduces a wrapX option to the Draw, Modify and Select
interaction.
2015-06-09 15:44:31 +02:00
Peter Robins
282fdafad7 Standardise draw/modify descriptions 2015-06-05 07:54:22 +00:00
Marc Jansen
73b103a19c Add basic docs for modifyinteraction 2015-04-22 14:20:06 +02:00
Bart van den Eijnden
47ce127a10 Add assert messages for all assertions up until ol.renderer.vector. 2015-03-30 22:55:23 +02:00
Frederic Junod
6a770f03b8 Move the compare function out of ol.interaction.Modify.handleDownEvent_ 2015-03-25 14:41:40 +01:00
Fran Peručić
56067d1cda Prevent unnecessary function calls
handlePointerMove_ doesn't need to be called when dragging.
handleDragEvent_ takes care of the event in that case.

in handleDragEvent_, createOrUpdateVertexFeature_ doesn't need to be called for each dragged segment. it can be called only once with current vertex.

fixes made to pass the build
2015-03-25 11:19:24 +01:00
Fran Peručić
279d1829bb fix: ol.interaction.Select conflict
Prevent vertexFeature_ from ol.interaction.Modify from being selected by ol.interaction.Select.
The bug occurs when an delete attempt fails. ex: clicikng on the first or last node of LineString,
or clicking a line segment between two nodes.
2015-03-25 10:52:29 +01:00
Fran Peručić
eb6d61e6d1 fix: modifying the closed LineString
This commit fixes the bug that occurs when trying to modify
a closed LineString by clicking on the starting/ending node.

Such a closed line is added to the modify-test example.
2015-03-25 10:44:35 +01:00
Fran Peručić
7dff739bce Deleting a duplicate node
Fix a bug in ol.interaction.Modify when trying to delete nodes
on a geometry that has duplicate nodes. A bug occurs when
clicking on the duplicate node.
2015-03-25 10:34:36 +01:00
Éric Lemoine
6b46d5c76a Make shouldStopEvent default to the identity func 2014-12-18 14:13:44 +01:00
Éric Lemoine
711ec705b7 Add handle*Event options to ol.interaction.Pointer
More specifically: handleDownEvent, handleDragEvent, handleMoveEvent, and handleUpEvent.
2014-12-18 14:13:44 +01:00
Éric Lemoine
86561e5ef2 Merge pull request #3032 from elemoine/custom-components
Extension points for custom controls and interactions
2014-12-15 13:41:56 +01:00
Éric Lemoine
d07185e8f2 Add an "handleEvent" interaction option 2014-12-12 18:30:31 +01:00
Antoine Abt
e7db23761c Respect geometry stride in modify interaction 2014-12-12 11:22:15 +01:00
Frederic Junod
a3b3e044f5 Remove unused distinctFeatures object in ol.interaction.Modify#handlePointerDown
The object is filled but never used.
2014-09-30 15:08:15 +02:00
Frederic Junod
aaeb2b6938 Remove unnecessary parentheses 2014-09-29 09:05:22 +02:00
Peter Robins
ed2f2befdf Move createDefaultEditingStyles() to ol.style 2014-08-11 15:39:21 +00:00
Frederic Junod
0277026624 Stricter typing for ol.Collection 2014-07-30 09:38:16 +02:00
Antoine Abt
60f1874766 Give precedence to feature style 2014-07-16 11:25:16 +02:00
Tim Schaub
4cf5ab4620 Use @api annotation instead of @todo api 2014-07-05 15:41:14 -04:00
tsauerwein
b8ab6fd771 Add stable tags to interactions 2014-07-03 14:19:16 +02:00
Frederic Junod
9b2a874282 Use getInExtent instead of forEachInExtent 2014-06-17 08:58:04 +02:00
Peter Robins
41d9f0360a Add @classdesc to classes 2014-06-09 12:10:19 -04:00
Andreas Hocevar
fbdbbfb7a7 Get rid of stability annotations and document stability with api
This change adds a stability value to the api annotation, with
'experimental' as default value.

enum, typedef and event annotations are never exportable, but
api annotations are needed there to make them appear in the
docs.

Nested typedefs are no longer inlined recursively, because the
resulting tables get too wide with the current template.
2014-04-29 09:53:07 -06:00
Andreas Hocevar
c17ac0cae3 Greatly simplify and document the usage of JSDoc
This commit simplifies the exports.js plugin so it only relies
on the stability notes to generate the documentation, which
completely decouples it from the exportable API.

As a rule of thumb, whenever something has an 'api' annotation,
it should also have a 'stability' annotation. A more verbose
documentation of ol3 specific annotation usage is available in
the new 'apidoc/readme.md' file.

This commit also modifies all source files to implement these
usage suggestions.
2014-04-29 09:53:06 -06:00
Tim Schaub
fb497f5288 Annotations for exports 2014-04-29 09:53:05 -06:00
Tim Schaub
e72b383976 Required return from event handler 2014-04-10 06:32:27 -06:00
Éric Lemoine
baca25ed95 Fix bug at modify interaction construction time
This fixes a bug that occurs when the modify interaction is configured with a non-empty collection of features.
2014-04-10 11:00:00 +02:00
Éric Lemoine
ce0b1d2a47 Use goog.functions.identity where it makes sense 2014-04-07 16:59:04 +02:00
ahocevar
bf06129256 Initialize snappedToVertex_ 2014-04-04 14:11:02 +02:00
ahocevar
523b51d69a Add missing goog.requires; fix types and a typo 2014-04-04 14:05:19 +02:00
ahocevar
f2acbd332c Use the pixelTolerance to determine whether to snap to a vertex 2014-04-04 14:05:19 +02:00
ahocevar
8fc9b23ab8 Do not return as handled unless a geometry was modified
With this change, it is more straightforward to determine
whether an event is considered as handled, which results in the
removal of the modifiable_ and lastVertexCoordinate_ states.
Instead, we only need to know whether we're on a real vertex or
a virtual one. For that a new snappedToVertex_ flag is
introduced.

To stop a click after vertex deletion from triggering a feature
selection, vertex deletion is now triggered by a configurable
event condition, which defaults to singleclick (same as in the
select interaction) with no modifier keys.
2014-04-04 14:05:18 +02:00
Antoine Abt
5cc1a986c2 Share editing default styles 2014-03-31 10:24:17 +02:00
Éric Lemoine
c82d5ba88e Make the Modify interaction more robust
This prevents a JavaScript error when features are added while the interaction does not have a map.
2014-03-28 16:09:52 +01:00
Éric Lemoine
afa5f35cef Create the R-Tree in the Modify constructor
In this way features can be added/removed to/from the R-Tree even when the interaction does not have a map.
2014-03-28 16:07:03 +01:00
Éric Lemoine
c33a3372d9 Fix initial state of the Modify interaction
Features that are in the features collection need to be added to the R-Tree.
2014-03-28 16:03:34 +01:00
ahocevar
8b99fd9bc1 Updates to pass jshint validation 2014-03-28 12:02:08 +01:00
ahocevar
b9cd512ffc Lower pixel tolerance to avoid accidental vertex deltion 2014-03-28 11:37:06 +01:00
ahocevar
e612330dd7 Add a way to delete vertices with the Modify interaction
After this change, vertices can be deleted by simply clicking on
them. This is the same behaviour as e.g. in geojson.io.
2014-03-28 11:36:13 +01:00