Commit Graph

10773 Commits

Author SHA1 Message Date
Frederic Junod
a0bea641d1 Remove 'valueAsNumber' property from ol.dom.Input
Use bindTo.transform functions instead
2013-11-13 16:13:08 +01:00
Tom Payne
bba1de2679 Add tests for ol.Object#bindTo getters and setters 2013-11-13 16:13:08 +01:00
Frederic Junod
03cc533cb3 Getter and setter support for bindTo 2013-11-13 16:13:08 +01:00
Tim Schaub
0814b2c5c6 Merge pull request #1109 from tschaub/geom
Remove ol.geom2.
2013-11-12 20:32:18 -08:00
Tim Schaub
7b69373985 Remove ol.geom2 2013-11-12 19:27:02 -07:00
Tim Schaub
61d13f9a39 Remove ol.source.Vector2 2013-11-12 19:26:29 -07:00
Tim Schaub
75b40a60c0 Remove ol.layer.Vector2 and associated renderer 2013-11-12 19:25:08 -07:00
Tim Schaub
cd647a1ebc Removing example 2013-11-12 19:24:13 -07:00
ahocevar
0d1533eaca Merge pull request #1269 from ahocevar/modify-interaction
Modify interaction for feature modification
2013-11-12 15:55:23 -08:00
ahocevar
f790992a77 Make addLayer and removeLayer methods private 2013-11-13 00:44:39 +01:00
ahocevar
b805a76ae1 layerFilter can no longer be undefined here 2013-11-13 00:44:39 +01:00
ahocevar
4e85322abb Minor stylistic clean-ups and more symmetry 2013-11-13 00:44:38 +01:00
ahocevar
9067260a44 Fixing api doc comment 2013-11-13 00:44:38 +01:00
ahocevar
7ae65c32e1 Removing unused method 2013-11-13 00:44:38 +01:00
ahocevar
39a5a8e291 Refactoring for better layer management
The only feature on the temporary layer is now the
vertexFeature, and the temporary layer's style is dynamically
changed to the style of the layer whose segment is being edited
(the topmost layer if more than one segment are being edited).
With this simplification, we can also put all segments on a
single RTree. Finally, we no longer rely on structures set on
layers - all we need is now on the instance itself.

This refactoring also changes the way we define layers to
participate in modification - by using an array or a filter
function, or assuming all layers if no layers property is set.
2013-11-13 00:44:38 +01:00
ahocevar
06406d968f Adding equals method for comparing coordinates 2013-11-13 00:44:38 +01:00
Tim Schaub
d577466de6 Common style for drawing and modifying 2013-11-13 00:44:37 +01:00
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