Tim Schaub
af6edadebe
Update example with more distinct colors and no social links
...
Conflicts:
examples/modify-features.html
2013-11-13 00:44:37 +01:00
ahocevar
fe2fbe06c3
Updating header
2013-11-13 00:44:37 +01:00
ahocevar
319f78fb94
Using new squaredDistanceToSegment and closestOnSegment
2013-11-13 00:44:37 +01:00
ahocevar
0e673a492a
Use accessor for components
2013-11-13 00:44:37 +01:00
ahocevar
c669dda2b1
Do not create a vertexFeature with [NaN, NaN] coordinates
...
The RTree cannot work with NaN coordinates. So instead of
preparing a vertexFeature before we know a coordinate, we now
lazily create the vertexFeature.
2013-11-13 00:44:37 +01:00
ahocevar
498738d22a
Parent information no longer needed
...
Now that we can do setCoordinates, we no longer need to create
new geometries and assign them to a parent.
2013-11-13 00:44:37 +01:00
ahocevar
1c3b839a6f
Use new setCoordinates methods
2013-11-13 00:44:36 +01:00
ahocevar
fec638e8be
Write modifications back to the original layer
...
With the feature's getOriginal() and setOriginal() methods, an
undo tree can be maintained now.
2013-11-13 00:44:36 +01:00
ahocevar
a3b18bf16e
Do not split segments while in the loop
...
In combination with the additional squaredDistanceToSegment
check we can ensure that a future vertex is only created on one
segment per feature, and only on the segment that it appears on.
This change also renames the misleading dragVertices_ member to
dragSegments_.
2013-11-13 00:44:36 +01:00
ahocevar
ff17eb53d4
Separate add listener from method that adds index
2013-11-13 00:44:36 +01:00
ahocevar
292b851a74
Adding ModifyFeature interaction
...
This is a first draft. The way geometry changes are handled for
now is a bit clumsy. Both updating the feature cache RTree and
making the layer aware of feature and geometry changes could be
handled in a smarter way if these changes would be made through
the layer instead of directly on the geometry or feature.
2013-11-13 00:44:36 +01:00
Tim Schaub
a88541fd60
Merge pull request #1263 from tschaub/draw-interaction
...
Add interaction for drawing new features.
2013-11-12 15:43:26 -08:00
Tim Schaub
05b9922861
Tests for draw interaction
...
The tests revealed that polygons can be drawn with counter-clockwise exterior ring order. In the polygon constructor, we enforce clockwise winding for exterior rings. So after drawing, we pass polygon coordinates back to the constructor before adding feature to the target layer.
2013-11-12 16:06:42 -07:00
Tim Schaub
5a898884ec
Use geometry type enum for configuring draw interaction
...
This allows us to cast single-part geometries to multi-part types before adding features to the target layer. This doesn't yet allow for drawing multi-part geometries with multiple parts. That can be handled separately.
2013-11-12 11:51:41 -07:00
Tim Schaub
8194ba9f0a
Remove setMode method from interaction in favor of add/removeInteraction
...
This makes the example a bit more awkward, but eventually adding and removing interactions will be the job of an editing control.
2013-11-12 10:30:37 -07:00
Tim Schaub
dbcfdbc76f
Updated style for draw example
2013-11-12 10:30:37 -07:00
Tim Schaub
62b44f3c73
Add click tolerance to allow dragging while drawing
2013-11-12 10:30:37 -07:00
Tim Schaub
2f07433593
Allow user to set drawing mode
2013-11-12 10:30:37 -07:00
Tim Schaub
e3faa76770
Add method to abort drawing
2013-11-12 10:30:37 -07:00
Tim Schaub
4e98e86b14
Stop dblclick propagation while editing
2013-11-12 10:30:37 -07:00
Tim Schaub
048dec1644
Updated sketch style
2013-11-12 10:30:36 -07:00
Tim Schaub
7c197252ed
Ensure drawing is not finished prematurely
2013-11-12 10:30:36 -07:00
Tim Schaub
45ba000df5
Pop off last point from linestring
2013-11-12 10:30:36 -07:00
Tim Schaub
b5cc35ee04
Snap to finish with configurable tolerance
2013-11-12 10:30:32 -07:00
Tim Schaub
ea6500ecd0
Finish lines by clicking last point
2013-11-12 10:29:29 -07:00
Tim Schaub
d821f227ba
Add point at head of drawing
2013-11-12 10:29:29 -07:00
Tim Schaub
b3487ad30e
Draw interaction
2013-11-12 10:29:21 -07:00
ahocevar
076f1ac194
Merge pull request #1265 from ahocevar/set-style
...
Allow to set the layer style
2013-11-12 09:15:08 -08:00
ahocevar
16ef1c5b8a
Merge pull request #1267 from ahocevar/geom-clone
...
Deep clone geometry coordinates
2013-11-12 09:08:33 -08:00
Frédéric Junod
b8f04e0883
Merge pull request #1270 from fredj/element_jsdoc
...
Be more strict with {Element} types
2013-11-12 05:47:09 -08:00
Frederic Junod
ca5960666d
Be more strict with {Element} types
2013-11-12 13:53:37 +01:00
Frédéric Junod
1560fbace3
Merge pull request #1266 from fredj/input_checked
...
Set boolean value to HTMLInputElement.checked
2013-11-12 04:51:53 -08:00
ahocevar
ed09173730
Deep clone geometry coordinates
...
Our geometries are mutable, so they can be modified without
creating garbage by changing coordinates in place and calling
setGeometry afterwards. But this also means that we need to
create a deep clone of the coordinates.
2013-11-12 11:36:40 +01:00
Frédéric Junod
c8f9b9cd7b
Merge pull request #1268 from fredj/export_getCode
...
Export ol.proj.Projection#getCode
2013-11-12 02:25:25 -08:00
Frederic Junod
7613eaeef1
Export ol.proj.Projection#getCode
2013-11-12 11:17:03 +01:00
Frederic Junod
d3be7d9d18
Set boolean value to HTMLInputElement.checked
...
See http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#attr-input-checked
2013-11-12 10:24:36 +01:00
ahocevar
1d23229d98
Allow to set the layer style
...
By firing a simple CHANGE event, we can redraw the layer when
a style is assigned.
2013-11-12 01:47:43 +01:00
Tim Schaub
15053cbe56
Merge pull request #1262 from tschaub/unlisten
...
Unregister for feature events when removing features.
2013-11-11 15:40:47 -08:00
Tim Schaub
61741669f6
Unregister for feature events when removing features
2013-11-11 16:17:33 -07:00
ahocevar
382b2707df
Merge pull request #1256 from ahocevar/simplify-select
...
Simplify Select interaction and prepare for programmatic feature selection without interaction
2013-11-11 13:19:57 -08:00
ahocevar
0ed208b710
Make renderIntent private and add a getter
2013-11-11 22:07:18 +01:00
ahocevar
299d729936
Make filter optional
2013-11-11 21:52:19 +01:00
ahocevar
467bcc8b62
Protect from features without geometry
2013-11-11 21:51:58 +01:00
Tim Schaub
85500fb616
Merge pull request #1252 from tschaub/expose-down
...
Add a getter for the most recent down event.
2013-11-11 11:27:19 -08:00
Bart van den Eijnden
351f4a57fb
Merge pull request #1258 from bartvde/wkt
...
add an example of how to use a WKT string in a vector source (r=@tschaub)
2013-11-11 07:14:26 -08:00
Bart van den Eijnden
9842140495
get rid of unused markup in example
2013-11-11 15:56:15 +01:00
Bart van den Eijnden
3f7c40b1ad
add an example of how to use a WKT string in a vector source
2013-11-11 12:45:06 +01:00
Éric Lemoine
fdad53c619
Merge pull request #1231 from oterral/mouse_events
...
Fix touch events on IE10
2013-11-10 02:44:12 -08:00
ahocevar
03e20ce6f1
Do not fail on non-vector layers
2013-11-09 16:12:13 +01:00
ahocevar
26c8c954c3
Make selectedFeaturesFilter available to other components
2013-11-09 16:03:30 +01:00