Commit Graph

191 Commits

Author SHA1 Message Date
Tim Schaub
7d2d68c011 Give interactions a reference to the map
This is in line with what we do for controls and overlays.  A follow-up change will add calls to `setMap` when interactions are added to a map.
2013-10-31 09:25:52 -06:00
Éric Lemoine
8402eee0c3 Map "click" event renamed to "singleclick"
As discussed with @tschaub in #1195.
2013-10-31 09:37:16 +01:00
Éric Lemoine
a85b82090d Emulate click events only on mouse "action"
`click` events are fired only if the mouse action button is pressed. This prevents `click` events from being fired when the middle mouse button is used.

Also, without this commit, in Chrome with emulated touch events enabled, double-clicking the map doesn't zoom the map. This is because `ol.BrowserFeature.HAS_TOUCH` is `false` in that environment. The commit fixes it by testing `isMouseActionButton` on mouse devices only.
2013-10-30 13:16:09 +01:00
Frederic Junod
a9159ecac3 Rename ol.interaction.condition to ol.events.condition 2013-10-30 12:13:44 +01:00
ahocevar
4b7b95fc2f Handle dragend after resetting view hint and dragging flag
When we start dragging, we first handle dragstart and then set
the INTERACTING view hint and the dragging flag. To end dragging
in a symmetric manner, we have to first reset the INTERACTING
hint and dragging flag, and then handle dragend.

This flaw becomes obvious when using an interaction where no
animation is performed after the interaction. This can be seen
in the style-rules example when using the dragzoom interaction
(i.e. zoom using a drag box): the vector renderer will not
render the new resolution, because the INTERACTING view hint is
still set when the zoom box dragend is handled.
2013-10-30 11:45:34 +01:00
Paul Spencer
bada596b45 Add default stability level to docs of exported things. 2013-10-24 18:20:24 -04:00
Frederic Junod
9ffabb481c Rename offset* attributes to delta* 2013-10-14 14:22:51 +02:00
Frederic Junod
ef97da2b77 Use getPixel function instead of offset from event 2013-10-11 07:35:27 +02:00
Tom Payne
b533cad031 Only install animations if duration > 0 2013-10-08 14:35:04 +02:00
Tom Payne
c6df48e424 Add zoomDuration option to interaction defaults 2013-10-08 14:35:04 +02:00
Tom Payne
b1ed63ebf8 Make touch zoom animation duration configurable 2013-10-08 14:35:04 +02:00
Tom Payne
6c0d4cddad Make mouse wheel zoom animation duration configurable 2013-10-08 14:35:03 +02:00
Tom Payne
1863109ac8 Make keyboard zoom animation duration configurable 2013-10-07 15:41:00 +02:00
Tom Payne
93b33589a1 Make double click zoom animation duration configurable 2013-10-07 15:39:52 +02:00
Frédéric Junod
948735f948 Merge pull request #1075 from fredj/center-constraint
Add ol.CenterConstraint
2013-10-02 02:54:17 -07:00
Frederic Junod
680f5cbb5a Constrain center in ol.interaction.TouchPan 2013-09-30 10:37:02 +02:00
Tom Payne
2e395e4530 Constrain center in ol.interaction.DragPan 2013-09-30 10:17:24 +02:00
Tom Payne
92f7f14744 Constrain center in ol.interaction.Interaction.pan 2013-09-30 10:17:24 +02:00
ahocevar
f8e891ff15 Making the condition for adding to selection configurable 2013-09-27 11:45:15 +02:00
Tim Schaub
6276e633de Merge pull request #832 from fredj/feature_getset_id
Rename setFeatureId to setId (same for get).
2013-09-20 10:31:37 -07:00
Tom Payne
0e4c5d10c5 Merge pull request #1024 from pagameba/doc-interactions
Documentation for Interactions
2013-09-18 08:05:46 -07:00
Frederic Junod
764aacb568 Rename {get|set}FeatureId to {get|set}Id 2013-09-17 12:50:56 +02:00
Frederic Junod
7de0e79c62 Remove unused goog.requires 2013-09-17 09:41:22 +02:00
Éric Lemoine
b81a4e875b Remove noModifierKeys condition for keyboad zoom
Refs #917. With the key hanler now attached to the map target by default we can remove the noModifierKeys condition for the keyboard zoom interaction. This will prevent the back button shortcut (alt + <back arrow>) to work, but it's ok, the map is focused so it's the one with the highest priority.
2013-09-16 22:51:44 +02:00
Paul Spencer
28ee9bcd9b remove export for conditionType as it breaks the build to have it in there. 2013-09-13 11:23:06 -04:00
Paul Spencer
d7eee91195 Add exports for interactions. 2013-09-13 11:23:05 -04:00
Éric Lemoine
ba3f97d50a Change the interaction condition signature 2013-09-12 18:08:01 +02:00
Tim Schaub
8b7a0a060c Export ol.interaction namespace instead of the defaults function 2013-09-04 13:55:54 -06:00
Tim Schaub
8ca3f13bd2 Instead of providing animation functions, provide the namespace
This follows the convention in the Closure Library of providing either namespace objects (where the property starts with a lowercase letter), constructors (where the property starts with an uppercase letter), or enums (all uppercase properties, only one instance of this in the closure library).
2013-09-04 13:55:36 -06:00
Frédéric Junod
25b99d5997 Merge pull request #925 from fredj/ms_pointer_events
MSPointer events fixes
2013-09-03 22:34:14 -07:00
Tim Schaub
dc76b81780 Rename addPreRenderFunction to beforeRender and remove the plural 2013-09-03 10:57:31 -06:00
Frederic Junod
77f6b4ff59 Only consider touch events to compute ol.interaction.Touch.targetTouches 2013-09-03 09:35:30 +02:00
ahocevar
39b4da5ca2 Merge pull request #945 from ahocevar/select-followup
Follow-up improvements for #897
2013-09-02 06:47:01 -07:00
Tim Schaub
8844310bf4 Call setMap instead of passing map to control 2013-08-31 14:45:03 -06:00
ahocevar
d8bc769758 Do not delete from oldFeatureMap 2013-08-30 23:18:59 +02:00
ahocevar
cbf7f91cfb instanceof check to avoid ducktyping 2013-08-30 23:18:17 +02:00
ahocevar
9dfbfab648 Follow-up improvements for #897
* Interaction is no goog.Disposable any more.
* Permanent cleanup during selection instead of disposeInternal.
* Moved selectionLayers creation outside feature loop.
* Maintain selectedFeatures and unselectedFeatures only for
  layers that have a setRenderIntent method.
2013-08-30 16:26:49 +02:00
ahocevar
9dae49dc18 Symbolizer defaults for the select renderIntent 2013-08-30 13:47:43 +02:00
ahocevar
e2c4fec253 Let's at least be disposable, so we can clean up after ourselves 2013-08-30 12:00:06 +02:00
ahocevar
6bb23cdda5 No longer inheriting from EventTarget 2013-08-30 11:43:35 +02:00
ahocevar
43c67ba09f Do not dispatch selection events for now 2013-08-29 16:50:55 +02:00
ahocevar
95cf0e1264 Less closures 2013-08-29 16:50:55 +02:00
ahocevar
0c1f2328f9 Do not implement a specific clone method
What we need here is a mix of deep and shallow cloning, and we
do not want to do this in a generic ol.Feature#clone() method.
2013-08-29 16:50:55 +02:00
ahocevar
526dbebadc Re-adding @requires that got lost during rebase. 2013-08-29 16:50:54 +02:00
ahocevar
c47634b2ee Renaming condition to clickOnly, and fixing docs 2013-08-29 16:50:54 +02:00
Frederic Junod
89bdd3bc2c Use a ol.interaction.condition in ol.interaction.Select 2013-08-29 16:50:54 +02:00
ahocevar
bb93a86528 Do not export 'dispose' for now 2013-08-29 16:50:54 +02:00
ahocevar
100b85a7b0 Converting control to an interaction
To dispatch events, the interaction base class now inherits from
goog.events.EventTarget.
2013-08-29 16:50:53 +02:00
Frederic Junod
9e8d559c1b Don't react to keyboard events when the focus is on editable inputs 2013-08-20 14:44:40 +02:00
Éric Lemoine
f67d3dc165 Use @exportFunction to export ol.interaction.defaults 2013-08-19 17:00:43 +02:00