Commit Graph
100 Commits
Author SHA1 Message Date
Tim Schaub 9323bbdcd0 Give Somaliland and Northern Cyprus unique ids 2014-05-26 10:31:27 -06:00
Tim Schaub a2b81d6bd0 Disallow adding the same feature twice 2014-05-23 16:52:11 -06:00
Tim Schaub 652f11cefa Provide a method for retrieving features by id 2014-05-23 16:35:07 -06:00
Tim Schaub 34cabd1579 Dispatch change on feature id change 2014-05-23 16:35:06 -06:00
Tim Schaub 25aefbeff5 Remove simple build profile
This was inadvertently added in d163f60e34 (see #2075).  Thanks @probins for the heads up.
2014-05-23 10:20:24 -06:00
Tim Schaub 097909516a Account for null or undefined geometry
The change in #2098 made it so a feature's geometry could be undefined.  This is consistent with the return type for the getGeometry method.  Where calling code needs to ensure that it has a geometry instance, it can use instanceof, goog.isDefAndNotNull(), or test for a truthy value.
2014-05-23 10:00:15 -06:00
Tim Schaub be03ec5aa1 Update dependencies
* closure-util@0.12.0 - force inclusion of deps.js files when compiling
 * jshint@2.5.1 - various enhancements and fixes (https://github.com/jshint/jshint/compare/2.4.4...2.5.1)
 * walk@2.3.3 - directory exclusion fix
2014-05-21 12:08:46 -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
Tim Schaub c820a7a1f8 Additional doc for the namespace option
People should be discouraged from exporting to single letter namespaces to avoid collissions with the symbols generated by the compiler.
2014-05-21 13:22:40 +02:00
Tim Schaub 250f6901d3 Pass around single config object 2014-05-21 13:22:32 +02:00
Tim Schaub 3793f33acf Handle minZoom in getZoom and setZoom 2014-05-16 04:56:42 -06:00
Tim Schaub 815f5b38c8 Accept resolution or zoom related options for constrained views
Any of minResolution, maxResolution, minZoom, or maxZoom can be used to constrain the view resolutions.  Resolution options are given precedence over zoom options.
2014-05-15 17:31:55 -06:00
Tim Schaub 049531831c Move stability and inherited indicators after names 2014-05-14 16:27:30 -06:00
Tim Schaub 8fbf67b7e6 Remove space between ol. and Name 2014-05-14 16:26:44 -06:00
Tim Schaub 3a0efe83c5 Update map example 2014-05-14 15:11:12 -06:00
Tim Schaub df05e9da11 Fire moveend only once after view settles 2014-05-14 14:23:31 -06:00
Tim Schaub c3184f2cce Support for debug builds (concatenation only)
Whitespace builds are still painful to debug.  Skipping the compiler altogether and simply concatenating sources is a better option for development and debugging.  By ommitting the `compile` option in a build config, the output is "uncompiled" - a straight concatenation of all sources in dependency order.
2014-05-14 10:39:51 -06:00
Tim Schaub 4c8ba1bac6 Remove PhantomJS as a global dependency 2014-05-14 00:03:58 -06:00
Tim Schaub b860ec7a06 Do less work while processing touch events 2014-05-13 23:06:27 -06:00
Tim Schaub 7709d26955 Restore setTimeout after it is mocked 2014-05-13 22:44:36 -06:00
Tim Schaub 57a6fbf416 Call resetClickCountHandler_ with proper this argument 2014-05-13 17:41:58 -06:00
Tim Schaub d069f955f8 Document boolean defines as positive assertions 2014-05-05 07:41:53 -07:00
Tim Schaub 070f81aa7d Add description to symbols and defines 2014-05-05 07:41:53 -07:00
Tim Schaub f9157a6123 Rename generate-symbols.js to generate-info.js
This task generates build related metadata for the library based on doc annotations.  Since it is about more than writing out exportable symbols, it makes sense to have a more general name.
2014-05-05 07:41:47 -07:00
Tim Schaub 48828a238a Generate metadata for boolean defines in addition to exportable symbols 2014-05-05 07:14:23 -07:00
Tim Schaub 0b8f1e8944 Mark applyTransform as part of the API for all geometries 2014-05-02 13:24:04 -06:00
Tim Schaub e448f100fd Add a transform method to geometries
This accepts CRS identifiers for source and destination, transforms the geometry in place, and returns a reference to the geometry.
2014-05-02 11:47:59 -06:00
Tim Schaub 1110da37e1 Move ol.Sphere#circle to ol.geom.Polygon.circular
Previously, ol.geom.Polygon was a transitive dependency of ol.proj (since ol.proj requires ol.sphere.NORMAL, and all spheres were capable of generating circular polygons).  Instead, ol.proj should be lower-level.  Since it deals only with coordinate arrays, it shouldn't depend on all of the geometry code.

By adding a static `circular` function to `ol.geom.Polygon`, the dependency tree makes more sense.  If you want to create a polygon that approximates a circle on a sphere, you require `ol.geom.Polygon` and `ol.Sphere` (or one of the constants).

This makes room for geometries to have a `transform` method that takes projection-like arguments (meaning that `ol.geom.Geometry` will require `ol.proj`).
2014-05-02 11:25:44 -06:00
Tim Schaub f66ad1253f Reducing expectations about spherical interpolation precision
This avoids test failures in Chrome 34 (see also #1748 and https://code.google.com/p/v8/issues/detail?id=3006).
2014-05-02 10:23:03 -06:00
Tim Schaub 015aab8af3 Rename ol.extent.transform to ol.extent.applyTransform
This gives more consistency with ol.proj.applyTransform, allowing us to add a more convenient ol.extent.transform method that takes projection-like arguments.
2014-05-02 10:13:28 -06:00
Tim Schaub a4f1efbddb Add tests for geometry applyTransform method 2014-05-02 09:58:23 -06:00
Tim Schaub 4f9968d106 Rename transform to applyTransform for geometries 2014-05-02 09:27:53 -06:00
Tim Schaub f8e6fac90e Modules used in postinstall are dependencies
Since async and htmlparser2 are used by the postinstall task, they need to be listed as dependencies.  These will get installed when ol3 is a dependency of another project.
2014-04-30 17:54:39 -06:00
Tim Schaub 24498fa9d0 Defines in a namespace that can be required
For consistency, all defines are in the ol namespace.  If they are to be moved to another namespace, they need to be requireable.
2014-04-30 09:14:10 -06:00
Tim Schaub e4e3b2229a Defines in ol namespace defined in ol.js 2014-04-30 08:54:30 -06:00
Tim Schaub cec41c4b0a Add missing requires
Without explicit requires, it is possible that a build would exclude ol.js.
2014-04-30 08:37:52 -06:00
Tim Schaub 3f0da11008 Move ol defines from browserfeature.js to ol.js 2014-04-30 08:24:00 -06:00
Tim Schaub 193d5c9ac1 Rename EXTERNAL_SRC to EXPORTS
The build/exports.js file passes gjslint and jshint, so the separate linting task is not needed.
2014-04-29 09:57:25 -06:00
Tim Schaub a083c6149a No more generated internal source
With this change, the only two remaining generated scripts are build/exports.js and build/test/requireall.js.  Both are only required by Plovr.  With the Node based build task, a temporary exports.js file is created.  The Node based server can be used to run the tests without build/test/requireall.js.
2014-04-29 09:57:25 -06:00
Tim Schaub 9b4f61be3e No need for requireall.js when including exports.js 2014-04-29 09:57:25 -06:00
Tim Schaub d552dfd96d Making ol.proj.Projection subclasses exportable
Because ol.proj.EPSG4326 et al. extend ol.proj.Projection which has exportable methods, these constructors need to be exportable as well (e.g. so ol.proj.EPSG4326.prototype is defined in exports.js when calling goog.exportProperty on getCode etc.).  If we really don't want these to be exportable, they should be removed or made private (and named like ol.proj.EPSG4326_) for internal use only.
2014-04-29 09:57:25 -06:00
Tim Schaub ec6aa21912 Include goog.require calls in exports file 2014-04-29 09:57:25 -06:00
Tim Schaub d087fdbefd Add list of provides to symbol metadata 2014-04-29 09:57:25 -06:00
Tim Schaub fd170eb295 Accept a path for exports file 2014-04-29 09:57:19 -06:00
Tim Schaub 3dd5fb88e5 Allow configuration of JVM arguments in build 2014-04-29 09:53:07 -06:00
Tim Schaub 758eed357e Accept a src config, add docs 2014-04-29 09:53:06 -06:00
Tim Schaub a28db38eef Parse options and add docs 2014-04-29 09:53:06 -06:00
Tim Schaub b6277e0a01 Build task for driving the compiler 2014-04-29 09:53:06 -06:00
Tim Schaub 88e41f25ea Generate symbols before exports 2014-04-29 09:53:06 -06:00
Tim Schaub fe5d8712f2 Unused script 2014-04-29 09:53:06 -06:00
Tim Schaub 7c68107b17 Call generate-symbols.js from build.py 2014-04-29 09:53:06 -06:00
Tim Schaub 88d67b7370 Regenerate symbols if parents have changed
The generate-symbols.js task runs JSDoc on source files.  Because this takes a long time (13s) to run on the whole library, the resulting symbols file includes additional metadata to make it possible to do incremental symbol generation on subsequent runs.  The 'path' and 'extends' metadata for a symbol are used to determine what needs to be regenerated.
2014-04-29 09:53:06 -06:00
Tim Schaub 1273c26f7a Use new generate-exports.js task 2014-04-29 09:53:05 -06:00
Tim Schaub c692204ffd Task for generating a limited set of exports 2014-04-29 09:53:05 -06:00
Tim Schaub d3e477a8df Allow main method to be called from elsewhere 2014-04-29 09:53:05 -06:00
Tim Schaub e53fde402b Write out sorted symbols, excluding inherited ones on private classes
There are cases where a private class may inherit an exportable member (e.g. ol.DebugTile_#getTileCoord comes from ol.Tile#getTileCoord).  We want to avoid making these exportable.
2014-04-29 09:53:05 -06:00
Tim Schaub 11b49d6305 Removing old *.exports for completeness 2014-04-29 09:53:05 -06:00
Tim Schaub fb497f5288 Annotations for exports 2014-04-29 09:53:05 -06:00
Tim Schaub 457cfe851a Add a task to generate metadata on exported symbols
This runs JSDoc with the "symbols" config, providing a list of source files that have been changed since the previous run.  The output is used to generate a symbols.json metadata file containing all exportable symbols info.  A separate task will be run to generate the exports.js file.  These same metadata files will be used by a build tool.
2014-04-29 09:53:05 -06:00
Tim Schaub 9800b38250 Adding a JSDoc configuration for generating metadata on exported symbols
This generates info for all symbols annotated with "@todo api" (when Plovr is replaced, this will become "@api").  Generated metadata is written to stdout.  A separate process will handle the output.
2014-04-29 09:53:05 -06:00
Tim Schaub e72b383976 Required return from event handler 2014-04-10 06:32:27 -06:00
Tim Schaub 3c92b693c5 Adding comment about using externs/olx.js as a source file
The externs/olx.js script includes @typedef annotations for objects that are used in the library.  When compiling the examples together with the library, we need these @typedef annotations.  In this same case, we don't need the object property names to be treated as externs (they can be safely renamed).
2014-04-08 20:11:49 -06:00
Tim Schaub 9e33672503 Unused externs and typedef generating code 2014-04-08 11:41:24 -06:00
Tim Schaub acb0fd8f06 Use externs/olx.js instead of objectliterals.jsdoc
The single externs/olx.js file describes all of the "options" objects we accept in our constructors.  The @typedef annotations are used by the compiler for type checking.  The @type annotations include documentation for individual options and serve as externs when compiling a profile of the library.  When compiling an application together with the library, the externs/olx.js file is included as one of the sources to provide the @typedef's without generating externs.

If we want to maintain multiple src/*.externs.js files instead of one large externs/olx.js file, we can.  But while we are still using Plovr, it makes for easier build configurations to have one file.

This removes the build tasks that generated the build/src/external/src/externs/types.js and build/src/internal/src/types.js files as those are both replaced by the single externs/olx.js file.
2014-04-08 11:41:24 -06:00
Tim Schaub 6fc915ba7b Strip tags from shortdesc (et al.) when parsing
This strips markup from elements with id attributes that we care about: title, shortdesc, tags.  This will only work for people who use `npm install && npm start` to browse examples.  The other example parser doesn't strip this markup, so it should still not be used in these elements.
2014-04-04 10:07:25 -06:00
Tim Schaub 2a4300085e No markup in shortdesc
The example parser and index template don't handle markup in the shortdesc element.  Use the docs element instead.
2014-04-04 10:07:02 -06:00
Tim Schaub fe60d07ef0 Externs lint 2014-04-04 09:28:36 -06:00
Tim Schaub 7826036307 Make getLayerStatesArray return an array of layer states 2014-04-04 07:39:54 -06:00
Tim Schaub 78324fb54b Remove layers array from frame state 2014-04-04 07:36:42 -06:00
Tim Schaub aa3a20e911 Provide layer states array in frame state 2014-04-04 07:36:42 -06:00
Tim Schaub 9d5451b1d6 Provide a reference to the layer 2014-04-04 07:36:42 -06:00
Tim Schaub 86c5a582c7 Rename loadingStrategy to strategy 2014-04-03 15:12:22 +02:00
Tim Schaub ce8d805201 Rename loadingFunction to loader 2014-04-03 15:12:22 +02:00
Tim Schaub 5653d57712 Change default renderer to Canvas 2014-04-02 11:43:20 -06:00
Tim Schaub 2770e61e6c Curly instead of bar 2014-04-01 16:15:22 -06:00
Tim Schaub 2dd3bd88ea Update node packages
* closure-util - Driving the compiler, not watching spurious files
 * async - Bugfixes not related to our use, but this may sidestep the Travis errors we're seeing
2014-03-28 17:27:41 -06:00
Tim Schaub 2da07f8837 Always toggle selection 2014-03-27 11:26:17 -06:00
Tim Schaub 02a7913c0f Add condition for selection 2014-03-27 11:07:06 -06:00
Tim Schaub 1e0d2af0f0 Add a style for selected features 2014-03-27 11:01:12 -06:00
Tim Schaub 9ce7d6ea45 Avoid protocol relative URL to support apps using file protocol 2014-03-24 15:46:12 -06:00
Tim Schaub 1b4aa63673 Separate test example from modify example 2014-03-20 12:18:17 -06:00
Tim Schaub 88efda1a1f Track resolution and buffer max extent to capture strokes 2014-03-13 20:40:18 -04:00
Tim Schaub 8317317127 Always add first segment when appending coordinates
When we have only a single point, we want to make sure it gets added (fixes #1821).

Because this code doesn't differentiate coordinates that are part of a linestring or linearring from those that are independent points, we always add the first segment (or pair of points).  In addition, coordinates for segments are appended whenever they represent a change in relationship with respect to the extent.  This keeps the code simpler for handling fills and properly capturing intersection points for linestrings.  This could be modified to save a few extra coordinates, but it provides for simpler code at a very minimal cost.
2014-03-07 11:02:25 -07:00
Tim Schaub 50001132be Transform extent coordinates before clipping 2014-03-05 13:27:40 -07:00
Tim Schaub a18593ee10 Support minPointsPerRing and default to 3 2014-03-05 12:58:03 -07:00
Tim Schaub 2e47777794 Rename getAllFeaturesAtCoordinate to getFeaturesAtCoordinate 2014-03-05 12:32:09 -07:00
Tim Schaub 30dc8195ca Rename getAllFeatruesInExtent to getFeaturesInExtent 2014-03-05 12:31:09 -07:00
Tim Schaub 333e4a9625 Rename getAllFeatures to getFeatures 2014-03-05 12:29:24 -07:00
Tim Schaub f3b615299f Example applying a convolution kernel to an image 2014-03-02 22:56:50 -07:00
Tim Schaub af1bd0228c Function for applying a 2d transform to an extent 2014-02-25 22:07:16 -07:00
Tim Schaub 2750f53fda Clip to max extent 2014-02-25 21:47:57 -07:00
Tim Schaub 50822a4d58 Skip coordinates that don't affect the rendered extent
Segments that intersect the replay group's extent are drawn.  Any segment that represents a change in coordinate-extent relationship is drawn.  This maintains the left/right relationship (or cross product) between points in the rendered extent and every rendered segment.

Still left undone: clip the replay group's rendering to the max extent.
2014-02-25 21:47:57 -07:00
Tim Schaub 6b018bbaf9 Testing segment intersection with extent
If needed, this function can be modified to take two additional coorinates that will be set to the intersection points.
2014-02-25 21:47:57 -07:00
Tim Schaub cb11959f01 Determining coordinate relationship to extent 2014-02-25 21:47:57 -07:00
Tim Schaub f4746687e8 Keep track of max extent for replay 2014-02-25 21:47:57 -07:00
Tim Schaub ee2485534a Add an example that renders a simple fractal
This works at resolutions where simplification is significantly reducing the number of points in the line.  At high resolutions, navigation becomes unresponsive.  Limiting draw instructions to a replay group's extent will fix this.
2014-02-25 21:47:56 -07:00
Tim Schaub bfc42ffa62 More realistic precision for cosine distance results
Chris Veness' discussion of using the spherical law of cosines (http://www.movable-type.co.uk/scripts/latlong.html) suggests it gives well-conditioned results "around 1 metre" in JavaScript (this assumes a sphere with 6,371km radius).

In Chrome 33, Math.pow(Math.cos(Math.PI / 4), 2) yields 0.4999999999999999.  When we take the arccosine of twice this, we get something significantly different than zero.  Multiplying by 6371 means we can't assert that this is within 1e-9 of zero.
2014-02-24 15:54:17 -07:00
Tim Schaub ac83bb78f1 More repeated test cases 2014-02-24 15:02:30 -07:00
Tim Schaub b01e90b942 Removing repeated test cases 2014-02-24 14:59:18 -07:00
Tim Schaub 7f1a13361b Remove antipodal test cases
The Vincenty formula can fail to converge for antipodal points (see http://en.wikipedia.org/wiki/Vincenty's_formulae#Nearly_antipodal_points), so those test cases are removed.  These tests fail with the latest V8 due to optimization of trig functions with lookup tables.  For example, Math.cos(Math.PI / 2) is no longer calculated based on the value of Math.PI / 2 (which is different than the actual value of π / 2).  Instead, values close to multiples of π / 2 are determined to be 0 (which is arguably what you want).  Previously the tests were relying on very small numbers being returned in this case.
2014-02-24 14:53:00 -07:00