Commit Graph

221 Commits

Author SHA1 Message Date
Tim Schaub
66d5d1d277 Export setStyle for vector layer 2014-02-13 10:25:17 -07:00
Tim Schaub
a1f714f7dc Add setStyle and getStyle methods to ol.layer.Vector
The setStyle method accepts a single style, an array of styles, or a style function.  The getStyle method returns what was set.  Internally, we use the getStyleFunction method which always returns a function.  When calling setStyle, a change event is dispatched (fixes #1671).
2014-02-13 10:25:17 -07:00
Tim Schaub
76f6961f83 Delete style option before passing to base 2014-02-13 10:25:16 -07:00
Tim Schaub
c64c24d3dc Common code for creating a style function 2014-02-13 10:25:16 -07:00
Tim Schaub
499ba4ac8f Add a style option for vector layers
This can be a single ol.style.Style, and array of styles, or a style function.
2014-02-13 10:25:16 -07:00
Tom Payne
76145fde74 Add stability annotation to ol.layer.Vector 2014-02-03 14:59:15 +01:00
Éric Lemoine
5e64e08d54 Merge pull request #1598 from elemoine/detect-style-changes
Changing the style function doesn't redraw the layer
2014-01-30 02:54:42 -08:00
Éric Lemoine
0eb72667c9 Add comments for setStyleFunction 2014-01-28 21:35:38 +01:00
Tom Payne
3d68a3550e Convert ol.CollectionEvent#getElement method into element property 2014-01-27 15:52:03 +01:00
Tom Payne
863e77e16e Use inherited dispatchChangeEvent in ol.layer.Base 2014-01-21 14:13:10 +01:00
Tom Payne
91b0831c68 Allow multiple renderGeometryFunctions on ol.layer.Vector 2014-01-16 20:09:42 +01:00
Tom Payne
7ce7bb2187 Merge remote-tracking branch 'openlayers/master' into vector-api 2014-01-09 11:42:14 +01:00
Éric Lemoine
dacb747eb5 Source state of a layer doesn't depend on group 2014-01-07 13:03:31 +01:00
Tom Payne
1499af397d Use assertInstanceof instead of getVectorSource 2014-01-06 09:36:43 +01:00
Tom Payne
f4ab0cbac0 Merge remote-tracking branch 'openlayers/master' into vector-api 2014-01-04 15:02:56 +01:00
Tom Payne
061fed50b7 Move all styleFunction types into ol.feature 2014-01-03 17:23:11 +01:00
Tom Payne
c6a1967cce Move layer.jsdoc into src/ol/layer 2014-01-03 14:55:02 +01:00
Tom Payne
c672eca749 Add ol.layer.Vector.defaultStyleFunction 2013-12-13 22:59:34 +01:00
Tom Payne
b59eec7a83 Merge remote-tracking branch 'openlayers/master' into vector-api 2013-12-13 20:22:06 +01:00
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
35d5158454 Merge remote-tracking branch 'upstream/master' into vector-api
Conflicts:
	src/objectliterals.jsdoc
	src/ol/attribution.js
	src/ol/geom/geometry.js
	src/ol/geom/geometrycollection.js
	src/ol/geom/linestring.js
	src/ol/layer/vectorlayer.exports
	src/ol/layer/vectorlayer.js
	src/ol/map.js
	src/ol/proj/proj.js
	src/ol/renderer/canvas/canvasvectorlayerrenderer.js
	src/ol/source/imagewmssource.js
	src/ol/source/tilewmssource.js
	src/ol/source/vectorsource.exports
	src/ol/source/vectorsource.js
	src/ol/source/wmssource.js
	src/ol/style/style.js
	src/ol/tilegrid/tilegrid.js
	src/ol/tilegrid/wmtstilegrid.js
	src/ol/tilegrid/xyztilegrid.js
2013-12-13 12:53:57 +01: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
Tom Payne
b11c34261b Rename renderFeatureFunction to renderGeometryFunction 2013-11-22 11:34:41 +01:00
Tom Payne
1acfa35783 Add ol.layer.Vector renderFeatureFunction 2013-11-20 11:44:47 +01:00
Tom Payne
a990f0921e Rename ol.layer.VectorEvent to ol.render.RenderEvent 2013-11-20 11:42:05 +01:00
Tom Payne
e1c54266d9 Export ol.layer.VectorEvent methods 2013-11-20 11:42:04 +01:00
Tom Payne
712993da52 Add ol.layer.VectorEvent 2013-11-20 11:42:04 +01:00
Tom Payne
ea2ba4e7ad Export ol.source.Vector 2013-11-20 11:41:52 +01:00
Tom Payne
711917db62 Add ol.layer.Vector 2013-11-20 11:41:09 +01:00
Tom Payne
4e65fefc00 Move vector code out of the way 2013-11-20 11:39:21 +01: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