Commit Graph
100 Commits
Author SHA1 Message Date
ahocevar bb93a86528 Do not export 'dispose' for now 2013-08-29 16:50:54 +02:00
ahocevar e5b095bfdf Simplifying setRenderIntent API for bulk changing all features 2013-08-29 16:50:53 +02:00
ahocevar 100b85a7b0 Converting control to an interaction
To dispatch events, the interaction base class now inherits from
goog.events.EventTarget.
2013-08-29 16:50:53 +02:00
ahocevar c6e61e2d23 Dynamic layers and lazy selection layer creation
With this change, the user provides a filter function instead of
an array of layers. Selection layers are created lazily, and
addition/removal of layers is not handled by the control to give
the user more options, as suggested by @elemoine.
2013-08-29 16:50:53 +02:00
ahocevar a417b75c1f Simplifying layer mapping
By making selectionLayer an object keyed by source layer UIDs,
we save some indexOf lookups.
2013-08-29 16:50:53 +02:00
ahocevar d5c0fdd557 Removing addressed TODOs 2013-08-29 16:50:53 +02:00
ahocevar 0391a028c5 Adding layer visibility/addition/removal handling
The Select control creates a selection layer for each layer it
is configured with. When a configured layer is removed from the
map, the selection layer will be made invisible. For configured
layers on the map, the 'visible' property of the selection layer
is bound to the configured layer.
2013-08-29 16:50:53 +02:00
ahocevar 56c228d009 Removing option for temporary layer
Instead, adding setter and getter for a private temp_ property,
as suggested by @elemoine.
2013-08-29 16:50:52 +02:00
ahocevar 3a50a754aa Implementing renderIntent handling 2013-08-29 16:50:52 +02:00
ahocevar 4f2d37b6a3 New ThisIdentifier expression
This allows member expressions to use the 'this' keyword.
2013-08-29 16:50:52 +02:00
ahocevar 89052079b7 Example update after recent API changes 2013-08-29 16:50:52 +02:00
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 f05629b3c3 Work with clones rather than the original features 2013-08-29 16:50:51 +02:00
ahocevar fdd79a385a Making JSDoc happy 2013-08-29 16:50:51 +02:00
ahocevar d7e277d0f5 Adding exports 2013-08-29 16:50:51 +02:00
ahocevar 414f4828d6 Making Travis happy 2013-08-29 16:50:51 +02:00
ahocevar 0c54cbd9cc Adding tests 2013-08-29 16:50:51 +02:00
ahocevar 3d22ec4ca8 Simplifying clear/append detection 2013-08-29 16:50:51 +02:00
ahocevar b06526781c Adding change event 2013-08-29 16:50:51 +02:00
ahocevar 6be1ab80d2 Require layers 2013-08-29 16:50:50 +02:00
ahocevar 19a00bbe27 Making the control's button work 2013-08-29 16:50:50 +02:00
ahocevar 871388d2c0 Adding selection layer and implementing basic click selection 2013-08-29 16:50:50 +02:00
ahocevar e2526621d1 Select example and skeleton with event listeners 2013-08-29 16:50:50 +02:00
ahocevar 5673feb48f Merge pull request #885 from ahocevar/wms-getfeatureinfo
Implement WMS GetFeatureInfo
2013-08-08 07:44:04 -07:00
ahocevar f1e01511b9 Fixing example title
Thanks @bartvde for catching this.
2013-08-08 15:55:37 +02:00
ahocevar 2f37816608 Use X, Y or I, J depending on WMS version
This also adds consistency - Pixel coordinates are now always
rounded to integers.
2013-08-08 14:43:49 +02:00
ahocevar c1746f2549 No array needed for a single event
Thanks @bartvde.
2013-08-08 13:19:26 +02:00
ahocevar 759e6ff925 Merge pull request #880 from openlayers/parser-projection
Get source projection from parser
2013-08-05 00:57:27 -07:00
ahocevar cc29ea912b Updating the TopoJSON parser to return a ReadFeaturesResult 2013-08-04 15:10:11 +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 0aed05a413 Renaming handleWriteOptions to applyWriteOptions 2013-08-04 15:10:10 +02:00
ahocevar 3ebbdbb48f Use goog.functions.sequence 2013-08-04 15:10:10 +02:00
ahocevar 6f3fa14c53 Sensible axisOrientation and srsName defaults 2013-08-04 15:10:09 +02:00
ahocevar 023d3faf3c Do not translate projections using regular expressions 2013-08-04 15:10:09 +02:00
ahocevar e32da90f5a Fixing typo
Thanks @bartvde for spotting this.
2013-08-04 15:10:09 +02:00
ahocevar 56e8b1cfb4 Get projection and axis order from GML data
To make tests pass, the winding order of the coordinates in the
test data had to be reversed to conform to common gml practice.
2013-08-04 15:10:09 +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
ahocevar 0168c2e46f Better interface for passing projection and other metadata 2013-08-04 15:10:08 +02:00
ahocevar b0c1ef04a1 Implementing getProjection for KML and GPX 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 82a158bdd2 Merge pull request #889 from ahocevar/advanced-param
check-examples target failing because of G+ widgets
2013-08-04 06:09:25 -07:00
ahocevar da2fd4f80f Append '?mode=advanced' for advanced mode to avoid G+ inclusion 2013-08-04 14:38:55 +02:00
ahocevar 58949ed856 Adding tests, and fixing an issue revealed by the tests 2013-07-31 23:42:08 +02:00
ahocevar 5acff857e7 Add example, and use getFeatures in other examples
The new dedicated getfeatureinfo example shows how to combine
feature info from a WMS and a vector layer. The other examples
that previously used getFeatureInfo from vector layers now use
the more appropriate getFeatures.
2013-07-31 17:47:16 +02:00
ahocevar 4dd148a731 Implementing GetFeatureInfo for WMS 2013-07-31 12:10:02 +02:00
ahocevar f333acc183 Interface for GetFeatureInfo
When a source implements this interface, the layer renderer can
access the source to get feature info.
2013-07-31 12:09:39 +02:00
ahocevar 5307e5ea3f Until we know what we want to return, return undefined 2013-07-31 11:58:45 +02:00
ahocevar 53765ebd0f Merge pull request #878 from ahocevar/polygon-labels
Better label placement for polygons
2013-07-30 01:04:44 -07:00
ahocevar b2e25c8f6b Renaming method to getInteriorPoint
as suggested by @tschaub. Also giving credit to JTS.
2013-07-30 09:25:24 +02:00
ahocevar 2d08b5ff2c Merge pull request #850 from ahocevar/vector-events
Render changes when adding and removing features
2013-07-20 02:41:05 -07:00
ahocevar ca9f9b7563 Re-adding type cast, as suggested by @elemoine 2013-07-20 11:11:26 +02:00
ahocevar b43625820e Removing addFeatures from the API 2013-07-20 11:09:49 +02:00
ahocevar 11ef2cb7d1 Better label placement for polygons
Using the y-coordinate of the polygon's bounding box, this
simple algorithm intersects the polygon with the horizontal
center line of its bounding box. The x-coordinate of the label
point is the center of the longest segment of this intersection
that is inside the polygon.
2013-07-20 10:36:13 +02:00
ahocevar 781caff9e5 Expire tile by range and listen to changes
Instead of just listening for the first change, we now listen
for all changes, and expire tiles by tile range. The outcome is
that the vector layer's addFeatures and removeFeatures methods
now show instant results on the rendered map.
2013-07-19 14:07:16 +02:00
ahocevar d04c6f4c01 New pruneTileRange method
This also adds an assert that cache values are an instance of
ol.Tile in expireCache, instead of doing a type cast. Later we
will want to enforce the ol.Tile type by overriding the set
method.
2013-07-19 14:07:16 +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 c3bed305c7 Merge pull request #870 from ahocevar/vector-api
Give VectorSource the ability to load and parse data
2013-07-19 05:06:19 -07:00
ahocevar a9fcc5ff15 Addressing @elemoine's review comments 2013-07-19 13:30:14 +02:00
ahocevar 892088ffac Updating examples to use the new API 2013-07-17 11:39:57 +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
ahocevar f325046a95 Allow VectorSource to load and parse data
This adds url, data and parser options to the source, and makes
EPSG:4326 the default projection. It also adds a prepareFeatures
method, which is used to load/parse data once the target
projection is known.
2013-07-17 11:24:34 +02:00
ahocevar a427719a22 Merge pull request #816 from ahocevar/tilegrid-units
Use ol.Projection#getMetersPerUnit(). r=@tschaub
2013-06-24 16:05:56 -07:00
ahocevar a14b21d80c Use ol.Projection#.getMetersPerUnit()
As a follow-up to #815, this change makes
ol.tilegrid.createForProjection work in cases where a Proj4
projection does not have units set. For better code readability,
a new variable is used when calculating the resolution.
2013-06-25 00:29:50 +02:00
ahocevar f697450523 Merge pull request #811 from ahocevar/conditional-click
Click handler called with empty event object on Android. r=@fredj
2013-06-24 03:09:48 -07:00
ahocevar a405279f34 Click handler called with empty event object on Android
On Android (both native browser and Chrome), the handleTouchEnd_
method is sometimes reached in a state where this.down_ is null.
This check protects against this.click_ being called without
an event object. To see this issue, open any example in Android,
and tap the zoom + or - button.
2013-06-24 10:35:02 +02:00
ahocevar b30dcdd35a Merge pull request #799 from ahocevar/dynamic-canvas-tilegrid
Do not use a fixed tile grid for vector rendering. r=@elemoine,@tschaub,@twpayne
2013-06-23 11:15:50 -07:00
ahocevar 5cc3e189eb Need to take units into account 2013-06-23 18:48:21 +02:00
ahocevar af0764b1ca Simpler tile coord access now that we only have one resolution 2013-06-23 18:47:49 +02:00
ahocevar 27c23f676b Fixing requires 2013-06-23 18:47:00 +02:00
ahocevar 1c5f466e61 Adding comment about MIN_RESOLUTION 2013-06-23 18:31:25 +02:00
ahocevar 61fcbd560e Do not render tiles during animation and interaction 2013-06-23 18:31:25 +02:00
ahocevar f20e6002cc Tile grid and cache for one resolution only 2013-06-23 18:31:25 +02:00
ahocevar 89c23b5560 Use binaryInsert instead of sort 2013-06-23 18:31:25 +02:00
ahocevar aa62764d90 Do not add resolutions while interacting 2013-06-23 18:31:25 +02:00
ahocevar 0aacf197bf Separate method for updating the tile cache 2013-06-23 18:31:24 +02:00
ahocevar 3afd8b4242 Do not use a fixed tile grid for vector rendering
Instead, we create a new tile grid whenever renderFrame is
called, no animation is active, and the resolution is not in the
tile grid already. This gives better rendering results because
we get vector tiles at native resolutions.
2013-06-23 18:30:57 +02:00
ahocevar 1826b7a9be Merge pull request #808 from ahocevar/no-empty-tiles
Don't render/cache tiles with no features. r=@tschaub
2013-06-23 09:11:55 -07:00
ahocevar 3fc4fc3eb8 Only render and cache tiles that have features 2013-06-23 15:52:31 +02:00
ahocevar 10f03a360c Merge pull request #770 from ahocevar/text-symbolizer
Basic support for text symbolizers. r=@bartvde,@tschaub
2013-06-20 07:06:38 -07:00
ahocevar d250f4449c Updating example to use new properties 2013-06-20 15:24:54 +02:00
ahocevar ba87c2e5ab Adding TODOs 2013-06-20 15:02:12 +02:00
ahocevar f316b79bcd Proper handling of defaults 2013-06-20 14:57:01 +02:00
ahocevar 9e3ca1c13c Changing renderLabels_ method name to renderText_ 2013-06-19 22:14:52 +02:00
ahocevar cb9f4972df Use 'text' instead of 'name' for the label text 2013-06-19 22:10:44 +02:00
ahocevar 7353e05a90 Fixing merge errors from unmerging #404 2013-06-19 22:01:51 +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 4392feef1b Merge pull request #794 from ahocevar/simplify-ranges
Simplifying ranges structure by adding compiler hints. r=@tschaub,@twpayne,@elemoine
2013-06-18 01:27:24 -07:00
ahocevar c54d81258a Merge pull request #793 from ahocevar/proj-no-extent
Making extent optional for projections. r=@twpayne
2013-06-17 08:40:22 -07:00
ahocevar 11cbbab901 Simplifying ranges structure by adding compiler hints
In JavaScript, keys of object literals are always strings, and
internal type conversions are performed. Now if we tell the
compiler that keys are numbers, we get inconsistent types when
iterating through keys. So instead we set the key type to string
and do a type cast to make the compiler happy. Note that we
could also do toString() instead of a type cast, but it would
add a performance penalty (see
http://jsperf.com/internal-type-conversion-vs-tostring-for-object-keys).
2013-06-17 17:37:48 +02:00
ahocevar b71bf9607c Do not set center constraint
This change slipped in accidently. Thanks @twpayne for catching
this.
2013-06-17 16:46:47 +02:00
ahocevar 24953e5f0e Making it clear that Proj4js is used 2013-06-17 15:28:05 +02:00
ahocevar 29b5af9c87 New example using a projection unknown to the client 2013-06-17 15:27:06 +02:00
ahocevar caefacac35 Serve WMS tiles for sources without specified extent
With this change, WMS sources do not need an extent configured.
The result is that the WMS will be queried for tiles for any
extent.
2013-06-17 15:26:23 +02:00
ahocevar 37b369e0d7 Making extent optional for projections
The projection validity extent is used to generate a sensible
set of default resolutions and a sensible default tile grid.
By making it optional, we can still generate defaults - with
zoom levels that are similar to the default web mercator zoom
levels (based on fitting the world on a single tile, even if the
projection is not available for the whole world).
2013-06-17 15:24:37 +02:00
ahocevar f7fd1cf2b0 Merge pull request #404 from ahocevar/canvas-transform
Vector features disappear completely as you zoom in (r=@tschaub)
2013-06-11 12:07:14 -07:00
ahocevar ea02626c28 Reducing number of default zoom levels
To avoid issues with long segments, we accept scaled tiles for
now. Further workarounds and browser tickets reporting our
issues are needed.
2013-06-11 21:06:18 +02:00
ahocevar e8ab4f9f0c Removing canvas renderer stub for VectorLayer2
Setting the renderer of the ten-thousand-points example to
WebGL should remove the need for this stub. This is basically
the same approach we took for all vector examples in master,
where we set the renderer to Canvas.
2013-06-10 11:22:32 +02:00
ahocevar 489459f313 Apply transform to coordinates rather than the canvas
Credit goes to @jystic for figuring out this approach.
2013-06-09 20:20:53 +02:00
ahocevar 7cd5266d39 Merge pull request #744 from ahocevar/getfeature
getFeatures method and featureInfo templates. r=@bartvde
2013-06-07 07:06:00 -07:00