Commit Graph
100 Commits
Author SHA1 Message Date
Tim Schaub 7f62b26c80 New example style 2013-03-07 23:48:23 -07:00
Tim Schaub ee75c4b90e Use new projection getter 2013-03-07 23:48:10 -07:00
Tim Schaub 895bc4e76c The addFeatures method will be added back later
This needs to be made to take advantage of the shared vertices.
2013-03-07 23:47:41 -07:00
Tim Schaub 85a1599a1a Removing the style rules example for now
The addFeatures method on layer is going to go away temporarily (so all feature adding will take advantage of shared vertices structures).  Later we can accept feature arrays in parseFeatures and rename the method back to addFeatures.
2013-03-07 23:32:56 -07:00
Tim Schaub 4422e3e73b Merge branch 'master' of github.com:openlayers/ol3 into vector 2013-03-07 23:10:06 -07:00
Tim Schaub 4918106a22 Make shared vertices structures accessible 2013-03-07 23:09:23 -07:00
Tim Schaub faee18bae1 Use fillColor and strokeColor instead of fillStyle and strokeStyle
The color names are more intuitive.  And if we want to support pattern strokes or fills, we'll need additional proerties to represent other pattern properties.
2013-03-07 22:51:14 -07:00
Tim Schaub 5ce114c1b6 Style in example 2013-03-07 22:29:00 -07:00
Tim Schaub 77355ca634 Optional polygon stroke or fill 2013-03-07 22:28:39 -07:00
Tim Schaub f93bf2ad77 Avoid filling/stroking parts of multi-polygons twice 2013-03-07 21:39:34 -07:00
Tim Schaub db4e62477d Nicer caps and joins
As mentioned in the TODOs, caps and joins should be user configurable on the symbolizers.
2013-03-07 10:37:48 -07:00
Tim Schaub b28a1efec6 Export GeoJSON parser 2013-03-07 10:26:15 -07:00
Tim Schaub 5752a69d6b Adding addFeatures back as an API method temporarily
Eventually, parseFeatures and addFeatures should be collapsed.
2013-03-07 10:09:19 -07:00
Tim Schaub f961930823 Render countries from GeoJSON
This reveals a number of issues that still need to be addressed.
2013-03-06 19:24:53 -07:00
Tim Schaub 84527c4b56 Disable bbox filtering for now
The RTree doesn't appear to be performing properly
2013-03-06 19:07:26 -07:00
Tim Schaub 2e4dc430e9 Render multi-part geometries
As noted in the comment, filtering/rendering once per geometry type will be replaced by rendering once per symbolizer type.
2013-03-06 19:06:41 -07:00
Tim Schaub 00fa7ff3a9 Listen for layer changes and expire tiles
We need a more flexible event system.  We could have a VectorLayerEvent type and dispatch 'featuresadded' here.  But listeners want features typically and perhaps extent.  This won't be true for all vector layer events (suggesting a more specific VectorFeatureEvent type or something).
2013-03-06 19:05:35 -07: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 7c4c3c547c Draw multi-part geometries
Polygons still need holes.
2013-03-06 19:01:16 -07:00
Tim Schaub 6cddd47d54 Correcting title for example list (see #296) 2013-03-06 15:24:50 -05:00
Tim Schaub 060edb2070 Merge branch 'vector' of github.com:openlayers/ol3 into vector
Conflicts:
	src/ol/style/shape.js
2013-03-06 02:28:33 +01:00
Tim Schaub ac10bb6ca5 Enforce that either stroke or fill is provided 2013-03-06 02:20:11 +01:00
Tim Schaub c0c8faaf9f Allow literal from symbolizer without feature 2013-03-06 02:20:11 +01:00
Tim Schaub 4f2523fcf2 Vector related exports 2013-03-05 18:25:07 +01:00
Tim Schaub 9a0e7a96fe Moving the feature management to the layer
The source will be responsible for fetching vector data.
2013-03-05 18:25:07 +01:00
Tim Schaub e1c3faa53e Vector related exports 2013-03-05 18:13:10 +01: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
Tim Schaub a968a5ca66 The shared vertices structure now works with integer arrays only
Previously, a lookup object containing start indexes was also used.  This allowed us to remove arrays of vertices and properly update the start indexes for remaining coordinate values.  In order to provide callers with stable identifiers and to work with arrays of integers alone, we cannot support a remove method.  I think this is worth revisiting.  Even if the array length cannot be changed in WebGL, we don't need to also impose the restriction outside.  Instead, the WebGL renderer could be notified when array sizes change and update itself accordingly.  I think there is more value in providing geometries with stable identifiers.

This common structure is used to store vertices for all geometry types.  A slight optimization could be made by creating yet another structure to store point vertices - since these don't need to have a counts array (always 1).  Creating a new structure would mean saving memory at the expense of more lib code to transport.  The coordinate value lookups are not negatively impacted by using the same structure for points and higher order geometries.  Since the first change above goes against my instincts, I'm not making this second change (to add another structure for shared point vertices).
2013-03-05 11:47:42 +01:00
Tim Schaub 54d8d45fc9 Merge branch 'master' of github.com:openlayers/ol3 into vector 2013-03-05 10:58:27 +01:00
Tim Schaub 1d6cd1bd1b Lint-free tests 2013-03-04 21:30:23 +01:00
Tim Schaub dc19948a85 Get tile size for zoom level (see #258) 2013-03-04 21:30:01 +01:00
Tim Schaub c29fabebef Merge branch 'master' of github.com:openlayers/ol3 into vector 2013-03-04 21:06:13 +01:00
Tim Schaub cae925ad1f Correct spelling (thanks @fredj) 2013-03-04 21:04:59 +01:00
Tim Schaub 8c8ddce290 GeoJSON parser implements StringFeatureParser 2013-03-04 20:31:01 +01:00
Tim Schaub 9c8ec42713 Feature parser interfaces
Parsers that read features from strings, objects, or dom elements should implement the right interface.  Among the read options is a callback that gets called after feature construction and before geometry construction.  This callback is called with the feature and the geometry type and returns a shared vertices structure.  The geometry is then constructed with this shared vertices structure before being added to the feature.
2013-03-04 20:29:42 +01:00
Tim Schaub 9edf63fdb8 Proper bounds 2013-03-04 20:25:18 +01:00
Tim Schaub 978527f880 Accept missing properties in symbolizer constructors
Still need to have some discussion about when to apply defaults.
2013-03-04 19:31:11 +01:00
Tim Schaub fae79dbc0f Fewer function calls during bounds calculation 2013-03-04 18:55:20 +01:00
Tim Schaub 0b05432faa Vector source isn't a tile source 2013-03-04 18:43:46 +01:00
Tim Schaub 0558cfa3ac Add externs for GeoJSON support 2013-03-04 18:41:04 +01:00
Tim Schaub 303f2df9e1 Merge pull request #256 from tschaub/transform-arrays
Updating ol.TransformFunction instances so they work with arrays instead of coordinates.
2013-03-03 14:46:22 -08:00
Tim Schaub e9fa08fccb Use in-place transforms where possible 2013-03-03 20:53:13 +01:00
Tim Schaub 40bde4056b Accept a destination array for transforms
This allows in-place transforms.
2013-03-03 20:24:14 +01:00
Tim Schaub 7a5e6a06d8 Make transform functions work with arrays
Instead of working with ol.Coordinate instances, transform functions work with arrays.  This is in anticipation of using transform functions to transform large arrays of vertex coordinate values.  The ol.projection.transform and ol.projection.transformWithCodes are slightly more convenient functions for dealing with ol.Coordinate instances.  Whether we make this more consistent with the use of functions returned by ol.projection.getTransform is up for discussion.
2013-03-03 19:27:57 +01:00
Tim Schaub 0df692e159 Lint in the tests 2013-03-03 17:58:03 +01:00
Tim Schaub 022917e719 Lint free externs 2013-03-03 17:06:15 +01:00
Tim Schaub d3c4869917 Work with new ol.projection package 2013-03-03 16:09:00 +01:00
Tim Schaub 5a73529da5 Merge branch 'master' of github.com:openlayers/ol3 into vector 2013-03-03 15:52:40 +01:00
Tim Schaub b247031fe2 Test reading with shared vertices 2013-03-03 15:51:24 +01:00
Tim Schaub 4af32560ce Removing abstract methods for now
Later we'll discuss having more specific FeatureParser and readFeatures type methods.
2013-03-03 15:50:33 +01:00
Tim Schaub 5d917ebed6 Helper functions for running tests after xhr 2013-03-03 14:29:22 +01:00
Tim Schaub 69b6fae744 Parser base class
GeoJSON is now a parser.  The idea is that we'll want to pass parsers to sources or protocols and want a known type.
2013-03-03 11:50:51 +01:00
Tim Schaub 93ab45432b Merge branch 'master' of github.com:openlayers/ol3 into vector 2013-03-03 09:46:11 +01:00
Tim Schaub b52d283641 Allow geometries to use a shared vertex array
The ol.geom.SharedVertices structure represents a flattened array of vertex coordinates.  This is intended to support optimal WebGL rendering.
2013-03-02 18:39:24 +01:00
Tim Schaub ff27fd33a1 Merge pull request #232 from tschaub/projection-tests
Projection tests
2013-02-27 21:06:54 -08:00
Tim Schaub 52da64564c Tests for getting transforms
These are regression tests for #231.
2013-02-25 11:40:55 -07:00
Tim Schaub ca85c26537 Method for removing cached transforms 2013-02-25 11:28:14 -07:00
Tim Schaub 940ba8afa7 Stray debugger 2013-02-25 11:26:04 -07:00
Tim Schaub 72ba8c4cbd Smoke test for ol.Projection.getTransformFromCodes 2013-02-25 10:36:21 -07:00
Tim Schaub 48e69f7559 Unused var 2013-02-25 10:36:21 -07:00
Tim Schaub 86262bf17e Space for linter 2013-02-25 10:36:21 -07:00
Tim Schaub 6ceae978bf Merge pull request #231 from probins/projfix
Fix bug/typo in projection.getTransform
2013-02-25 09:33:10 -08: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 0f2f26969d Merge branch 'master' of github.com:openlayers/ol3 into vector 2013-02-20 10:18:09 -07:00
Tim Schaub a59aa9bb37 Merge pull request #217 from tschaub/safer-object
Allow ol.Object to be used with arbitrary keys.  Add a getKeys method.
2013-02-20 07:56:07 -08:00
Tim Schaub 689f8c9d9d Merge pull request #206 from tschaub/interim-tiles
Share common code to find loaded tiles
2013-02-20 00:52:49 -08:00
Tim Schaub 8f578b88b1 Removing the typed arrays
Its not clear that we will be able to leverage the Float64Array.  It may also be that the overhead of constructing these small arrays negates any benefit of faster access.  And for all coordinate arrays, we'll need arrays that grow/shrink.
2013-02-20 01:15:39 -07:00
Tim Schaub 176f18c937 Merge branch 'master' of github.com:openlayers/ol3 into vector
Resolved conflicts:
  src/ol/renderer/canvas/canvasrenderer.js
2013-02-20 00:38:07 -07:00
Tim Schaub d642628545 Example syntax 2013-02-20 00:21:08 -07:00
Tim Schaub 9cac8ec2f6 Moving GeoJSON into parser package
Need to discuss whether we want all to require constructing a new parser.  I liked the simple `ol.io.geojson.read` function.
2013-02-20 00:09:38 -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
Tim Schaub 0015e466dc Allow instanceof checks for geometries 2013-02-19 23:21:05 -07:00
Tim Schaub 083404bd58 Provides for tests 2013-02-19 23:15:45 -07:00
Tim Schaub 438664a190 Renaming literals 2013-02-19 22:35:29 -07:00
Tim Schaub 7141721bb1 Symbolizers with method for creating literals 2013-02-19 22:24:21 -07:00
Tim Schaub 1faa6214f1 Expression literal 2013-02-19 21:38:10 -07:00
Tim Schaub 360e37146c Rule is filter and symbolizer, style is collection of rules 2013-02-19 21:37:40 -07:00
Tim Schaub 2919906ba6 Add method for getting keys 2013-02-19 14:47:49 -07:00
Tim Schaub d6ff58305d Using a dedicated object for value storage
Without this, we are limited in the key names that we can accept from users.  And because of compiler renaming, we don't know ahead of time what the limitations are (e.g. the key 'a' may clobber the 'set' method).
2013-02-19 14:35:11 -07:00
Tim Schaub 0707deb465 Properties set with set should not be accessed with bracket 2013-02-19 14:28:59 -07:00
Tim Schaub 052e995f2e Key in obj check not appropriate for user supplied keys 2013-02-19 14:19:40 -07:00
Tim Schaub 6cfc36d8cc Using hasOwnProperty is better for user keys on objects we control 2013-02-19 14:17:58 -07:00
Tim Schaub b9507de3ea Removing unnecessary overhead 2013-02-19 14:14:36 -07:00
Tim Schaub 3698049543 View needs to call constructor on super 2013-02-19 14:03:48 -07:00
Tim Schaub eef683fcdb Indentation for linter 2013-02-19 13:58:43 -07:00
Tim Schaub 80dc7b5bf7 Accept custom isLoaded method in findLoadedTiles method 2013-02-19 12:13:58 -07:00
Tim Schaub 1b984ac06c Fewer tiles to be considered fully loaded
With 797dba2cdb we no longer have to load excess tiles to consider an extent fully loaded.
2013-02-19 09:54:41 -07:00
Tim Schaub b061e23606 Merge branch 'master' of github.com:openlayers/ol3 into interim-tiles 2013-02-19 08:59:23 -07:00
Tim Schaub 1f4b34cdb8 Merge pull request #207 from tschaub/tilerange
Make tile range calculation consistent.  Tile ranges are always inclusive in their min/max values.
2013-02-19 07:43:27 -08:00
Tim Schaub 5148ad038c Sharing code with rectangle
We cannot use the rectangle constructor here because a rectangle makes an assertion about min being less than max and a range may have equal min/max.
2013-02-19 07:30:54 -07:00
Tim Schaub 797dba2cdb Correct range for extent and resolution
Tile ranges are inclusive.  When getting the tile range for an extent, the top-right corner of the extent should be considered with a different intersection policy than the bottom-left corner.
2013-02-19 07:21:42 -07:00
Tim Schaub 184e1e782c Spare space 2013-02-19 07:19:31 -07:00
Tim Schaub a55a6bda3b Merge pull request #208 from tschaub/shift-with-care
Calculating resolution by left shifting tile sizes, we're unnecessarily restricted in the number of zoom levels we can have.
2013-02-19 06:00:39 -08:00
Tim Schaub c7569026db Merge branch 'vector' of github.com:openlayers/ol3 into vector 2013-02-19 06:58:23 -07:00
Tim Schaub 46e31f9f9a Lint and names 2013-02-18 22:20:50 -07:00
Tim Schaub 0a5dae9ed0 Avoid left shift in resolution calculations 2013-02-18 18:37:27 -07:00
Tim Schaub ce4b95f960 Decoupling canvas tile grid from vector source grid
If we have a gridded vector source, the grid should have something to do with the source data (e.g. the vector data is available in a regular grid).  The vector layer renderer's internal grid is for rendering canvas tiles and doesn't have anything to do with the source.
2013-02-18 17:54:13 -07:00
Tim Schaub 8b19751264 Making it explicit that this is a range of tiles
With tile range extending rectangle, a tile range that represented a single tile was not allowed.
2013-02-18 17:07:31 -07:00
Tim Schaub 0d6c54847b Removing logic that assumes occasionally stretched tiles
When the dom renderer included logic to stretch tiles so that gaps were properly filled for fractional zoom levels, we needed to take this into account when getting a tile coordinate for a given coordinate and resolution.  This was never the proper logic for a renderer that wasn't stretching occassional tiles (e.g. the WebGL renderer, the Canvas renderer, or the new DOM renderer).
2013-02-18 15:55:27 -07:00