Commit Graph

193 Commits

Author SHA1 Message Date
Tom Payne ee2098743d Correct types in ol.layer.Group 2013-12-13 19:16:31 +01:00
Tom Payne 59779bdcc5 Correct return types of ol.layer.Base methods 2013-12-13 18:59:26 +01:00
Tom Payne b12bed8949 Use assertInstanceof instead of getImageSource 2013-12-13 18:59:25 +01:00
Tom Payne e11d8bf717 Use assertInstanceof instead of getTileSource 2013-12-13 18:59:25 +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 7b81bfab5c Change @exportClass to @exportSymbol
sed command used: find src/ol -name '*.exports' -exec sed -ri 's/@exportClass\s+(\S+)\s+(\S+)$/@exportSymbol \1/' \{\} \;
2013-12-12 15:05:52 +01:00
Éric Lemoine 315c42f0a7 Use olx namespace for options types in source code
sed command used: find src/ol -name '*.js' -exec sed -ri 's/\{ol(\.(\w|\.)+Options\=?\})/{olx\1/' \{\} \;
2013-12-12 15:02:03 +01: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 c8985b9906 Using unique event type values for distinct events
Any event target can be used to dispatch generic goog.events.Event instances with an arbitrary type.  In cases where we dispatch custom events, we should not use type values that collide with those used for generic events (at least internally).  This allows listeners a better chance of knowing what kind of argument they will receive.

As subsequent change will clean up the enumeration and add a bit more consistency.
2013-12-11 16:53:52 -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 5a5d1dec40 Remove unused handleLayerVisibleChange 2013-12-11 01:38:44 -07:00
Tim Schaub a792a224f6 Avoid duplicate change event on visibility change 2013-12-11 01:28:55 -07:00
Tim Schaub 858fe14163 No need for handleLayerChange in base layer 2013-12-11 01:23:51 -07:00
Tim Schaub 8fbfac52d4 Avoid firing duplicate change events in ol.layer.Layer 2013-12-11 01:20:07 -07:00
Tim Schaub ec02e09ce8 Move render intent enum to feature 2013-11-27 12:22:32 -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
Tim Schaub 75b40a60c0 Remove ol.layer.Vector2 and associated renderer 2013-11-12 19:25:08 -07:00
ahocevar 1c3b839a6f Use new setCoordinates methods 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 048dec1644 Updated sketch style 2013-11-12 10:30:36 -07: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 61741669f6 Unregister for feature events when removing features 2013-11-11 16:17:33 -07: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
ahocevar 26c8c954c3 Make selectedFeaturesFilter available to other components 2013-11-09 16:03:30 +01:00
ahocevar 97d38820fb Removing no longer used getFeatureWithUid method 2013-11-09 14:44:40 +01:00
ahocevar 9fca2c407d Add a getFeatures method on the vector layer 2013-11-09 14:15:35 +01:00
ahocevar 7cf636147b Call setRenderIntent on the feature, not the layer 2013-11-09 14:15:35 +01:00
Paul Spencer 4e657e464c Add @todo observable documentation for observable properties
This PR adds documentation for observable properties, which will then be pulled into the docs correctly once #1180 is merged.  This is a first pass based on searching for definition of observable properties being defined as enums after lines ending with `Property = {`.  If there are observable properties implemented that don't follow this pattern then they are not included.

I've added simple descriptions based on what I know or could easily figure out, there may be some properties (like preload) that are not correctly described.

I've also added `readonly` annotations where I knew that a property was readonly.  I may have missed some readonly properties.

ol.layer.Base has a bunch of properties but I don't think it is exported so the documentation of these properties will not show up, so I added the documentation to ol.layer.Layer instead even though this isn't really where it should be documented.
2013-10-29 10:24:54 -04:00
Paul Spencer bada596b45 Add default stability level to docs of exported things. 2013-10-24 18:20:24 -04:00
Tim Schaub 67fab12fef Listen for feature events and fire layer events 2013-10-03 15:51:00 -06:00
Tim Schaub 42115baabb Merge pull request #1092 from tschaub/vector-event
Extend goog.events.Event for custom vector layer events.
2013-10-03 11:23:39 -07:00
ahocevar 41e7a6a059 Marking sort function private 2013-10-03 12:02:29 -06:00
Tim Schaub 64dd5cfc1f Extend goog.events.Event for custom vector layer events
Vector events include features and extents.  In the case of feature change events, the extents array will include old and new extents for features with modified geometries.w
2013-10-03 11:25:30 -06:00
ahocevar 87e755e9e4 Sort symbolizer groups by zIndex
Now rendering order can be controlled by setting the zIndex
symbolizer property.
2013-10-03 09:37:08 -06:00
Tim Schaub 97b56add70 Unique event type value for this target
The goog.events.EventType.CHANGE type is already dispatched because layers are ol.Object instances.  To allow people to register for vector layer specific events without also having listeners get called with more general ol.Object change events, we need to give the types unique values.
2013-10-03 09:20:51 -06:00
ahocevar dbb9525515 No longer group features by geometry type
With symbolizer literals now being geometry type specific, we no
longer need the overhead to query the RTree separately for each
geometry type and render symbolizer groups by geometry type.

The geometry type index of the FeatureCache is no longer needed.

The filtering functionality of the FeatureCache's
getFeaturesObject method can be removed because it is no longer
used.
2013-10-03 08:35:11 -06:00
Tom Payne 167b309242 Replace source ready flag with loading/ready/error enum 2013-09-30 13:30:54 +02:00
Tim Schaub 0b5058f72e Remove shared vertex handling from vector layer 2013-09-27 23:18:34 +01:00
Tim Schaub bbef15e50e Consider resolution when applying rules 2013-09-27 11:46:48 +02:00
Tom Payne bd81e6c9a9 Remove source load events 2013-09-20 13:37:40 +01:00
Bruno Binet d1e9dd964b Be consistent with constant names 2013-09-19 16:59:38 +02:00
Bruno Binet cf4799e87c Add support for layer min/maxResolution 2013-09-19 16:59:38 +02:00
Tim Schaub 3b20cc7b53 Rename ol.Projection to ol.proj.Projection 2013-09-15 22:01:56 -06:00
Tim Schaub e806f51b3d Changing extent structure back to single array: [minX, minY, maxX, maxY]
This means we'll have to have a new structure and new methods for 3D envelopes.
2013-09-15 00:31:32 -06:00
Tim Schaub 511e5ad5e8 Vector layer updates for new extent structure 2013-09-14 21:13:46 -06:00
Tim Schaub ba7e0e7da3 Merge pull request #973 from tschaub/default-style
Rework default style handling.
2013-09-10 07:58:44 -07:00
Tom Payne bcb4813615 Rename ol.layer.VectorLayer2 to ol.layer.Vector2 2013-09-09 16:21:04 +02:00
Tom Payne d1659b8e69 Rename ol.source.VectorSource2 to ol.source.Vector2 2013-09-09 15:18:31 +02:00