Commit Graph

98 Commits

Author SHA1 Message Date
ahocevar
14b69d15f1 One selection layer per source layer
This way all styles can be defined on the source layer, by
defining a rule with a select renderIntent. It also will make
addition and removal of layers easier while the select control
is active.
2013-08-29 16:50:52 +02:00
ahocevar
760694582e Adding missing @requires 2013-08-29 16:50:52 +02:00
ahocevar
fdd79a385a Making JSDoc happy 2013-08-29 16:50:51 +02:00
ahocevar
871388d2c0 Adding selection layer and implementing basic click selection 2013-08-29 16:50:50 +02:00
Éric Lemoine
3deeaa21c7 ol.layer.Vector pass original options to parent
This makes it possible to pass arbitrary property to ol.layer.Vector and use layer.get('property_name') to get the value of properties.
2013-08-28 14:13:37 +02:00
Tim Schaub
a5991aee03 Remove applyDefaultStyle method 2013-08-15 10:37:18 -04:00
Tim Schaub
a670e225cd Clearer naming of method to create symbolizer literals 2013-08-15 10:37:18 -04:00
Tim Schaub
d5d0262b4c Create literal with feature or geometry type 2013-08-15 10:37:18 -04:00
Tim Schaub
c36ceab2a0 Separate stroke and fill 2013-08-15 10:37:18 -04:00
Tim Schaub
90fb37c220 Rename ol.style.SymbolizerLiteral to ol.style.Literal 2013-08-15 10:37:18 -04:00
Bruno Binet
3ecb5b89ff Create a custom event type for vector layers
Vector layers will now dispatch ol.layer.VectorLayerEventType.ADD and
ol.layer.VectorLayerEventType.REMOVE event types instead of the generic
goog.events.EventType.CHANGE event type.
This will fix a maximum call stack size exceeded javascript error.
2013-08-13 12:27:38 +02:00
ahocevar
9578da0cfb Renaming readFeaturesWithMetadata* back to readFeatures*
Since this is not exported and we do not have a counterpart that
does not return the metadata, it should be fine to use a shorter
name.
2013-08-04 15:10:11 +02:00
ahocevar
109ec71877 Using single argument for callback and string for projection
This makes the asynchronous and synchronous versions of
readFeatures work with the same data structures, and leaves
projection handling outside the parsers.
2013-08-04 15:10:09 +02:00
Bart van den Eijnden
7b31ec26ea fix up build 2013-08-04 15:10:08 +02:00
ahocevar
0168c2e46f Better interface for passing projection and other metadata 2013-08-04 15:10:08 +02:00
ahocevar
55697dea28 getProjection method on parsers
With this, vector sources/layers do not need to make
assumptions on the data projection.
2013-08-04 15:10:08 +02:00
ahocevar
ac67c10acd Add and remove features with meaningful events
This adds a removeFeatures method, and makes the CHANGE event
more useful by adding information about changed features and
extent.
2013-07-19 14:07:15 +02:00
ahocevar
9095032014 Removing unused methods and changing getFeaturesObjectForExtent
With this change, getFeaturesObjectForExtent may return null if
the source does not have data loaded for the provided extent.
A callback can be passed to getFeaturesObjectForExtent to get
notified when the requested data is available.
2013-07-17 11:28:48 +02:00
Tim Schaub
1eaf82ead5 Enum for checking built-in lib functions internally 2013-06-25 12:15:34 -06:00
Tim Schaub
2577d3f7d6 Rename ol.expression to ol.expr 2013-06-25 12:15:34 -06:00
Tim Schaub
b04a36ede7 Replace use of filter with expressions
The canvas vector layer still has the (API candidate) `getFeatures` method that accepts an arbitrary expression (was filter).  This, and the `getFeaturesObject` method under it are only used in the tests.  The rendering code that was using filters is now calling `layer.getFeaturesObjectForExtent` with an explicit extent and optional geometry type.
2013-06-25 12:15:33 -06:00
Tim Schaub
91a8703852 Correct typo in geometry type (thanks @jystic)
Previously read 'multilinstring' instead of 'multilinestring'.  Letting the compiler check for typos instead now.
2013-06-20 17:57:29 -06:00
ahocevar
cb9f4972df Use 'text' instead of 'name' for the label text 2013-06-19 22:10:44 +02:00
ahocevar
c17424deec Basic support for text symbolizers
This adds basic label rendering for points and polygons to the
canvas renderer, and a text symbolizer to the style package.
2013-06-19 22:01:51 +02:00
ahocevar
3a6c7cf204 Renaming featureInfoFunction to transformFeatureInfo 2013-06-07 15:34:13 +02:00
ahocevar
77d22c4038 getFeatures method and featureInfo templates
To avoid surprises for application developers, this change
creates a new getFeatures method. So it is clear now beforehand
whether features or feature info markup is returned. The result
is now also grouped by layer, so application developers always
have a link between a layer and the feature info it returns.

To make getFeatureInfo return markup for vector layers, this
change also adds a featureInfoFunction property to the vector
layer, which gives developers full control over how features are
rendered to feature info markup.
2013-06-07 15:34:13 +02:00
Tom Payne
46553c719c Rename ol.projection to ol.proj 2013-05-30 18:55:58 +02:00
ahocevar
10e3a16f40 RTree API improvements and more tests
This change reverts the RTree API back to the original one (i.e.
insert() instead of put(), search() instead of find()), and
creates a new searchReturningObject() method that returns an
object keyed by UIDs.

It also adds missing tests for type restricted search and
searchReturningObject().
2013-05-22 18:25:40 -05:00
ahocevar
2ff2e85fbb Only query RTree if requested geometryType is used 2013-05-19 11:16:02 +02:00
Bart van den Eijnden
e8ed1674ea do not specify the source projection in ol.parser.ReadFeaturesOptions anymore 2013-05-15 15:34:11 +02:00
Bart van den Eijnden
2ad3ee6f99 incorporate review from @ahocevar 2013-05-15 14:50:37 +02:00
Bart van den Eijnden
feb6c4c2d7 Add AsyncStringFeatureParser and use plain
XMLHttpRequest in the KML example

Since the content-type on github.io is application/octet-stream we need
to implement an Async string based parser interface in the KML parser.
Also use plain XmlHttpRequest in the example instead of jQuery Ajax since
the vector-features example also uses that.
2013-04-22 16:45:33 +02:00
Bart van den Eijnden
ed9861317f Add a parser for reading and writing KML.
This adds ol.parser.ogc.KML which can be used to read and write KML documents.
NetworkLinks are retrieved asynchronously.
Current caveats of the implementation are:

* LabelStyle not yet implemented. Missing support in renderers.
* When using shared structures the parser needs to be configured with
  dimension 2.
* We need a better way to disable fill, currently we use opacity as a
  workaround.
* We cannot really roundtrip documents, since some of the info is not
  preserved in the ol structures. But we can write out most of the important
  info.
2013-04-09 15:34:03 +02:00
Tom Payne
7a2ad8c506 Use Closure type identification functions 2013-04-07 12:31:54 +02:00
Tom Payne
3197e278f8 Be more consistent with layer options 2013-04-06 20:44:23 +02:00
Tom Payne
4be8c991f7 Add missing Closure Library requires 2013-04-06 14:28:12 +02:00
Éric Lemoine
b7fa22c4d4 Add type VectorLayerOptions 2013-03-17 22:33:02 +01:00
ahocevar
389b8d14d7 Support GeoJSON as parsed object
With this change, we can programmatically create
GeoJSONFeatureCollection objects programmatically, without
reading a GeoJSON file.
2013-03-08 16:25:23 +01:00
Tim Schaub
4918106a22 Make shared vertices structures accessible 2013-03-07 23:09:23 -07:00
ahocevar
f4a16e7f57 Collect features before rendering to the sketch canvas
This avoids features being rendered multiple times when they
cross tile borders. Currently this makes the style-rules.html
example extremely slow. Fix for that to come in my next commit.
2013-03-07 16:57:22 +01:00
ahocevar
f0039ee460 Additional index dimension for RTree; use RTree again
The RTree can easily maintain an additional index dimension,
by passing a type with each added item. Now instead of
maintaining an RTree for each geometry type, we have a single
RTree with a type filter. With this change, using the RTree
finally speeds up rendering as expected.
2013-03-07 14:36:09 +01:00
Tim Schaub
d7c547f736 Method for parsing features
Shared structures are still per geometry type.  Need to be made per symbolizer type.
2013-03-06 19:02:21 -07:00
Tim Schaub
12bee3178e Moving the feature management to the layer
The source will be responsible for fetching vector data.
2013-03-05 12:46:55 +01:00
ahocevar
f1120287c3 Features can now have symbolizers
If specified, feature symbolizers take precedence over rule
based styling.
2013-03-03 18:55:52 +01:00
ahocevar
63c048edb2 Use the actual value, not just the index in the array. 2013-03-03 15:22:52 +01:00
ahocevar
f4a4522eb4 Giving vector layers the style they deserve
Now vector layers can have a style. ol.Style instances have an
apply method to get the symbolizer literals for a feature. If the
layer does not have a style defined, there is also a static
applyDefaultStyle function on ol.Style to get the default
symbolizer literals for a feature. The vector layer also got a
groupFeaturesBySymbolizerLiteral method, which returns an array
with features grouped by symbolizer, as needed by the canvas
renderer.
2013-03-02 17:38:01 +01:00
Tim Schaub
e4132813af Shorter name 2013-01-21 18:06:14 -07:00
Tim Schaub
1a63bf078f Basic vector source and layer
The vector source maintains a cache of features.  These are indexed by geometry type in anticipation of the renderer's needs.
2013-01-21 17:59:09 -07:00