Commit Graph

917 Commits

Author SHA1 Message Date
Tim Schaub
36e2e51899 Only create a frame state if the map has non-zero size 2014-01-09 18:23:53 -07:00
Frederic Junod
0fda88dca3 Remove extra parameters when calling ol.test.source.TileMock.getTile 2014-01-07 12:17:17 +01:00
Tim Schaub
01d4990a1b Merge pull request #1382 from tschaub/observable-geometry
Remove geometry specific event type.
2013-12-16 07:43:06 -08:00
ahocevar
a4083f544e Merge pull request #1373 from ahocevar/rbush-fail
ol.structs.RBush#remove() is unreliable
2013-12-16 05:02:49 -08:00
Tim Schaub
ec7fea090b Remove ol.geom.GeometryEvent
This removes geometry specific change events.  Since geometries are mere observables, we only get generic change events.  To minimize changes in other places, as a workaround, we cache geometry bounds on features.  This is not the way things should be long term, but the objective is to remove the geometry specific event.
2013-12-13 16:02:51 -07:00
Tim Schaub
5caa0eb659 Geometries inherit from ol.Observable
Because ol.Observable is now a struct, we have stricter type checking (hence the extra assertions).
2013-12-13 14:18:10 -07:00
ahocevar
67d2cddb84 Verify that removing random extent nodes also works 2013-12-13 18:27:33 +01:00
Tim Schaub
0ed59f7be3 Merge pull request #1348 from tschaub/beforechange
Add `ol.ObjectEvent` for changes to `ol.Object` properties.  Previously, `ol.Object` dispatched instances of `goog.events.Event` with type `change`.  Now `ol.ObjectEvent` instances will be dispatched on property changes.  The events include a `getKey` method to get the name of the property being changed.  The `beforepropertychange` type event is fired before a property value changes, and the `propertychange` type event fires after the property value changes.
2013-12-13 07:28:36 -08:00
Éric Lemoine
93e605b119 Merge pull request #1350 from elemoine/gutter
Add gutter support to ol.source.TileWMS
2013-12-13 01:11:42 -08:00
Tim Schaub
20d74810ab Export a getKey method on ol.ObjectEvent 2013-12-12 16:59:34 -07:00
ahocevar
4d03c0bfaa Show an issue with ol.structs.RBush
Note that the same test passes in the original implementation.
2013-12-12 17:03:40 +01:00
Éric Lemoine
e14d8add85 Add gutter support to TileUrlFunction 2013-12-12 10:59:31 +01:00
Tim Schaub
69385f4ff0 More consistent event types 2013-12-11 16:54:01 -07:00
Tim Schaub
625007f364 Make enum property name like its value
Where an enum value is used as an event type, it should be alllowercase (to follow DOM events).  Property names should be ALLUPPERCASE in this case (just as camelCase and PascalCase are converted to CONSTANT_CASE).
2013-12-11 16:54:01 -07:00
Tim Schaub
17e91feb52 Listen for property changes in layer group
This avoids a future bug when the ol.ObjectEventType.CHANGE value becomes something different than the goog.events.EventType.CHANGE value.
2013-12-11 12:23:05 -07:00
Tim Schaub
1783776976 Getting explicit about which type 2013-12-11 11:36:04 -07:00
Tim Schaub
153cb307e0 Handle beforechange events for bound properties 2013-12-11 11:25:51 -07:00
Tim Schaub
9d3a4e3c6c Add beforechange event type and provide key with change events
If you know ahead of time that you only want to listen for changes for a specific property, the foo:change type events can be useful.  If you want to listen for changes on all properties, the change event becomes more useful if it provides information on what changed.  And the beforechange event allows listeners to access values before they change.
2013-12-11 11:25:50 -07:00
Tim Schaub
8b8563f0fd Test change events on layer groups 2013-12-11 01:46:23 -07:00
Tim Schaub
a792a224f6 Avoid duplicate change event on visibility change 2013-12-11 01:28:55 -07:00
Tim Schaub
8fbfac52d4 Avoid firing duplicate change events in ol.layer.Layer 2013-12-11 01:20:07 -07:00
Tim Schaub
3e905d804c Merge pull request #1335 from tschaub/geometry-type
Change geometry type enum and mark as stable.
2013-12-10 08:50:54 -08:00
ahocevar
b3b9add06e Add Insert, Update and Delete writers
This change also adds some type annotations for better type
checking, introduces different write options for writing
transactions and queries, and provides new writeGetFeature and
writeTransaction methods.
2013-12-06 10:57:58 +01:00
ahocevar
af4308f481 Merge pull request #1336 from ahocevar/fix-writers-typo
Fix a typo - it's writers, not witers
2013-12-05 16:00:13 -08:00
ahocevar
1bf4b9bf49 Fix a typo - it's writers, not witers 2013-12-06 00:53:16 +01:00
Tim Schaub
2f7fa8f442 Using PascalCase for geometry enum values
This adds a bit more inconsistency to the library, but we didn't have complete consistency before.  Almost all existing string enum values are lowercase (a couple are camelCase and one is dash-separated).  The closure library isn't consistent either (with case for enum properties or values).  I imagine this could be justified in saying someone could blindly use GeoJSON type values in places, but in the end, you'll need to read the docs before guessing right.
2013-12-05 14:40:26 -07:00
Tim Schaub
4ee9605d61 Using CONSTANT_CASE for geometry type 2013-12-05 14:00:04 -07:00
Tim Schaub
3dc40f8cb6 Add ol.Observable for on, once, un, and unByKey methods 2013-12-05 12:27:30 -07:00
Tom Payne
2be40a1ae6 Add ol.structs.RBush#isEmpty 2013-12-04 15:05:43 +01:00
ahocevar
45d9f6ce0b Rename rbush test to match the naming scheme 2013-11-28 16:17:29 +01:00
ahocevar
d4bdac715b Get rid of ol.structs.RTree 2013-11-28 16:17:17 +01:00
Tim Schaub
b7b14420a4 Test removeFeatures and featureremove event 2013-11-27 12:22:34 -07:00
Tim Schaub
8b5dccb742 Test featureadd event 2013-11-27 12:22:34 -07:00
Tim Schaub
a5cadacb78 Test featureload event 2013-11-27 12:22:34 -07:00
Tim Schaub
f9710b6698 Test forEachFeatureInExtent 2013-11-27 12:22:33 -07:00
Tim Schaub
3bcd4bf833 Tests for getFeatures method 2013-11-27 12:22:33 -07:00
Tim Schaub
1f6d9fc5ae Test for vector source load method 2013-11-27 12:22:33 -07:00
Tim Schaub
1877f92d46 Add forEach method to rtree, use it in feature cache
This saves having to create feature lookup objects and iterate through lookup properties multiple times.
2013-11-27 12:22:33 -07:00
Tim Schaub
8cc4ae8dbd Separate load requests from feature requests
This separates the action of requesting an extent to be loaded from the action of requesting cached features.  The renderer (or any other consumer of a vector source) calls load to request a data extent.  A `featureload` event fires when new features are loaded.  The renderer (or any other consumer) separately asks for cached features given an extent.  This vector source only loads features once, but this separation will also work with sources that make multiple requests for data in different extents.

This also removes the `data` option from the vector source in favor of a `features` option.  Since we no longer have shared data structures for geometries, people can manually create features and pass them to a vector source.  The `addFeatures` method is exported as well.  This is used to add features to a source that don't have a representation on the "remote" (or server).
2013-11-27 12:22:32 -07:00
Tim Schaub
bfaed4d52d Moving all style functionality from source to style 2013-11-27 12:20:43 -07:00
Tim Schaub
01a0b9ff8d Private source methods 2013-11-27 12:20:42 -07:00
Tim Schaub
2000b0af78 Vector layer/source refactor
This moves the feature cache from ol.layer.Vector to ol.source.Vector.  These are the minimum changes required to maintain the existing functionality and make tests pass.  More refactoring to come.
2013-11-27 12:20:42 -07:00
Bart van den Eijnden
73a2ab2de1 make sure we can also read in CDATA fields with newlines 2013-11-27 16:09:36 +01:00
Tom Payne
f847b37261 Rename ol.structs.RBush#allInExtent to getAllInExtent 2013-11-27 15:10:18 +01:00
Tom Payne
828456d18e Rename ol.structs.RBush#all to getAll 2013-11-27 15:10:18 +01:00
Tom Payne
665781ee03 Throw an exception if an ol.structs.RBush is modified while reading 2013-11-27 15:10:17 +01:00
Tom Payne
1293294d40 Implement ol.structs.RBush#remove_ 2013-11-26 12:02:59 -07:00
Tom Payne
0ea7c2cd50 Refactor ol.structs.RBush tests 2013-11-26 12:02:59 -07:00
Tom Payne
e823e7fde3 Add ol.structs.RBush 2013-11-26 12:02:59 -07:00
Bart van den Eijnden
d564b5170c move the typedefs out of objectliterals 2013-11-25 15:50:09 +01:00