Tim Schaub
239f5745c1
Correct fail
2019-09-27 23:23:24 +02:00
Florent gravin
8b83371272
Feature opt_geometryOrProperties cannot be null
2018-09-19 16:48:51 +02:00
Frederic Junod
4657003811
Add named exports for createStyleFunction function
2018-02-14 11:12:56 +01:00
Frederic Junod
276d6a5dc5
Remove ol.FeatureStyleFunction support
2018-02-11 17:52:46 +01:00
Frederic Junod
31e30d28b7
Named exports from ol/obj
2018-01-16 14:14:17 +01:00
Tim Schaub
ad62739a6e
Use blocked scoped variables
...
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
2018-01-12 00:50:30 -07:00
Tim Schaub
4f4c90fc20
Rename _ol_style_Style_ to Style
2018-01-11 13:22:43 -07:00
Tim Schaub
22fce4f97b
Rename _ol_Feature_ to Feature
2018-01-10 09:35:35 -07:00
Tim Schaub
eadec38ae2
Rename _ol_geom_Point_ to Point
2017-12-14 08:49:10 -07:00
Tim Schaub
7f47883c48
Transformed
2017-12-12 06:53:18 -07:00
Tim Schaub
a3e3e99baa
Get rid of useless test exports
2017-08-17 15:16:58 -04:00
Andreas Hocevar
f2100f6846
Accept ol.StyleFunction in ol.Feature#setStyle()
2017-01-28 15:47:14 +01:00
Tim Schaub
ed5dbd1293
Put test requires on top
2016-08-08 09:58:11 -06:00
Tim Schaub
1b8310a6fe
Rename ol/objectutil.js to ol/obj.js
2016-08-07 10:49:12 -06:00
Tim Schaub
8aecb3270c
Replace goog.object.isEmpty() with ol.object.isEmpty()
2016-02-04 06:54:44 -07:00
Andreas Hocevar
3f2d79b7fe
Replace goog.events.Event/EventTarget system with our own
...
This also removes goog.events.listen, goog.events.unlisten,
goog.events.unlistenByKey and goog.events.BrowserEvent.
2016-02-03 11:19:38 +01:00
Frederic Junod
d2dd7584d8
Remove use of goog.object.getKeys
2015-09-29 14:24:34 +02:00
Tim Schaub
f0c0c28f04
Rename ol.feature.FeatureStyleFunction to ol.FeatureStyleFunction
2015-04-20 13:47:34 -06:00
Pierre GIRAUD
5843654650
Merge pull request #3509 from pgiraud/geometry_changed_null
...
Dispatch change event even when geometry is set to null
2015-04-07 12:39:48 +02:00
Pierre GIRAUD
d27d59f445
Use sinon.spy to ensure change event is dispatched
2015-04-07 12:21:01 +02:00
Pierre GIRAUD
5eb13660d3
Dispatch change event even when geometry is set to null
2015-04-07 12:12:07 +02:00
Éric Lemoine
d335318496
Make ol.Feature#setStyle accept null
2014-09-17 17:52:51 +02:00
Antoine Abt
60f1874766
Give precedence to feature style
2014-07-16 11:25:16 +02:00
Éric Lemoine
eafc2ac371
Change setValues to setProperties
2014-06-27 17:26:51 +02:00
Éric Lemoine
ec6a0548d1
Add ol.Feature#clone
2014-06-25 09:31:15 +02:00
Tim Schaub
34cabd1579
Dispatch change on feature id change
2014-05-23 16:35:06 -06:00
Tim Schaub
98193c0336
Merge pull request #2098 from tschaub/empty-feature
...
Do not set geometry by default.
2014-05-21 09:52:09 -06:00
Tim Schaub
a4d31147bc
Do not set geometry by default
...
A feature can have a geometry whose value is an ol.geom.Geometry instance or null. A feature can also have no geometry property. By default, a feature has no geometry property. To set a geometry, one can be passed to the constructor (including null) or passed to setGeometry().
2014-05-21 09:16:54 -06:00
Andreas Hocevar
e530758b36
Test that a custom geometry works
2014-05-21 15:08:11 +02:00
Tim Schaub
59cbe7c23a
Safer feature constructor
...
Calling setValues now behaves like calling set (closes #1672 )
2014-02-19 10:20:57 -07:00
Tim Schaub
f4585331f2
Add setStyle and getStyle to ol.Feature
...
As with vector layers and feature overlays, feature style can be set by calling
setStyle. Calling getStyle returns what was passed to setStyle. Internally, we call getStyleFunction.
2014-02-13 10:25:17 -07:00
Tim Schaub
a185fc963d
Tests for get/setStyleFunction
...
It would be nice to also test the following:
it('does not return user set property with the same name', function() {
var feature = new ol.Feature({
whatever: 'some value',
styleFunction: 'another value'
});
expect(feature.getStyleFunction()).to.be(undefined);
});
Unfortunately, in uncompiled code (or if we export `setStyleFunction`) this does not work. Same goes for user set `id` properties (this will set our internal `id_` property). See #1672 .
2014-02-13 10:25:17 -07:00
Tim Schaub
c64c24d3dc
Common code for creating a style function
2014-02-13 10:25:16 -07:00
Antoine Abt
add3cf2233
Remove useless "geometry" FeatureProperty
2013-12-18 14:20:11 +01:00
Antoine Abt
59df68fe68
Update property change listener
2013-12-18 14:20:08 +01:00
Antoine Abt
4fc6c36724
Add support for features with multiples geometries
2013-12-18 11:37:35 +01:00
Tom Payne
4e65fefc00
Move vector code out of the way
2013-11-20 11:39:21 +01:00
Bart van den Eijnden
8d03fa1197
add an optional argument to getAttributes so we can get a feature's attributes except for the geometry ones
2013-11-19 15:39:22 +01:00
Tim Schaub
adf99d592a
Listen for geometry events and fire feature events
2013-10-03 15:50:23 -06:00
Frederic Junod
764aacb568
Rename {get|set}FeatureId to {get|set}Id
2013-09-17 12:50:56 +02:00
ahocevar
8c0f1f979a
Store the feature's commonly used id
...
To not clobber the feature's attributes, this is a separate
member property.
2013-05-23 11:16:17 -05:00
Tobias Bieniek
d5d8afc858
Converted "vector" branch unit tests to mocha, expect.js and sinon
2013-03-13 04:48:08 +01:00
Tim Schaub
e23ca1655c
Confirm that arbitrary attribute names can be used
2013-02-20 10:34:10 -07:00
Tim Schaub
7ce89f1fbe
Proper getAttributes method
...
With a59aa9bb37 we can now provide an object with user set attributes.
2013-02-20 10:33:42 -07:00
Tim Schaub
735f490f56
Treating geometry as just another attribute
...
The first set geometry is considered the default. As an added bonus, we're back to a single argument constructor. Later, we could allow a schema to be set. This would be done before setting values (calling constructor with no args).
2013-02-20 00:02:50 -07:00