Commit Graph
100 Commits
Author SHA1 Message Date
Tim Schaub f5b9687479 Translate to image center before scale and rotation
Same treatment here as with the canvas replay.
2013-12-20 13:29:30 -07:00
Tim Schaub c599c649ab Translate to image anchor point, scale, rotate, translate back 2013-12-20 13:27:08 -07:00
Tim Schaub ec7fea090b Remove ol.geom.GeometryEvent
This removes geometry specific change events.  Since geometries are mere observables, we only get generic change events.  To minimize changes in other places, as a workaround, we cache geometry bounds on features.  This is not the way things should be long term, but the objective is to remove the geometry specific event.
2013-12-13 16:02:51 -07:00
Tim Schaub 5caa0eb659 Geometries inherit from ol.Observable
Because ol.Observable is now a struct, we have stricter type checking (hence the extra assertions).
2013-12-13 14:18:10 -07:00
Tim Schaub b77a29f2f4 Remove handling of @exportFunction 2013-12-13 08:50:38 -07:00
Tim Schaub ad0212ea69 Remove handling of @exportClass 2013-12-13 08:47:47 -07:00
Tim Schaub 20d74810ab Export a getKey method on ol.ObjectEvent 2013-12-12 16:59:34 -07:00
Tim Schaub 69385f4ff0 More consistent event types 2013-12-11 16:54:01 -07:00
Tim Schaub 625007f364 Make enum property name like its value
Where an enum value is used as an event type, it should be alllowercase (to follow DOM events).  Property names should be ALLUPPERCASE in this case (just as camelCase and PascalCase are converted to CONSTANT_CASE).
2013-12-11 16:54:01 -07:00
Tim Schaub c8985b9906 Using unique event type values for distinct events
Any event target can be used to dispatch generic goog.events.Event instances with an arbitrary type.  In cases where we dispatch custom events, we should not use type values that collide with those used for generic events (at least internally).  This allows listeners a better chance of knowing what kind of argument they will receive.

As subsequent change will clean up the enumeration and add a bit more consistency.
2013-12-11 16:53:52 -07:00
Tim Schaub 17e91feb52 Listen for property changes in layer group
This avoids a future bug when the ol.ObjectEventType.CHANGE value becomes something different than the goog.events.EventType.CHANGE value.
2013-12-11 12:23:05 -07:00
Tim Schaub 1783776976 Getting explicit about which type 2013-12-11 11:36:04 -07:00
Tim Schaub 153cb307e0 Handle beforechange events for bound properties 2013-12-11 11:25:51 -07:00
Tim Schaub 9d3a4e3c6c Add beforechange event type and provide key with change events
If you know ahead of time that you only want to listen for changes for a specific property, the foo:change type events can be useful.  If you want to listen for changes on all properties, the change event becomes more useful if it provides information on what changed.  And the beforechange event allows listeners to access values before they change.
2013-12-11 11:25:50 -07:00
Tim Schaub 8b8563f0fd Test change events on layer groups 2013-12-11 01:46:23 -07:00
Tim Schaub 5a5d1dec40 Remove unused handleLayerVisibleChange 2013-12-11 01:38:44 -07:00
Tim Schaub a792a224f6 Avoid duplicate change event on visibility change 2013-12-11 01:28:55 -07:00
Tim Schaub 858fe14163 No need for handleLayerChange in base layer 2013-12-11 01:23:51 -07:00
Tim Schaub 8fbfac52d4 Avoid firing duplicate change events in ol.layer.Layer 2013-12-11 01:20:07 -07:00
Tim Schaub 8297f6a9da Marking the geometry type enum as stable 2013-12-05 14:58:22 -07:00
Tim Schaub 9d00b1b993 This commit serves no purpose other than helping minimize a diff 2013-12-05 14:44:36 -07:00
Tim Schaub 2f7fa8f442 Using PascalCase for geometry enum values
This adds a bit more inconsistency to the library, but we didn't have complete consistency before.  Almost all existing string enum values are lowercase (a couple are camelCase and one is dash-separated).  The closure library isn't consistent either (with case for enum properties or values).  I imagine this could be justified in saying someone could blindly use GeoJSON type values in places, but in the end, you'll need to read the docs before guessing right.
2013-12-05 14:40:26 -07:00
Tim Schaub 4ee9605d61 Using CONSTANT_CASE for geometry type 2013-12-05 14:00:04 -07:00
Tim Schaub 162b245d7c ol.Object extends ol.Observable 2013-12-05 12:28:33 -07:00
Tim Schaub 3dc40f8cb6 Add ol.Observable for on, once, un, and unByKey methods 2013-12-05 12:27:30 -07:00
Tim Schaub b7b14420a4 Test removeFeatures and featureremove event 2013-11-27 12:22:34 -07:00
Tim Schaub 8b5dccb742 Test featureadd event 2013-11-27 12:22:34 -07:00
Tim Schaub a5cadacb78 Test featureload event 2013-11-27 12:22:34 -07:00
Tim Schaub f9710b6698 Test forEachFeatureInExtent 2013-11-27 12:22:33 -07:00
Tim Schaub 3bcd4bf833 Tests for getFeatures method 2013-11-27 12:22:33 -07:00
Tim Schaub 1f6d9fc5ae Test for vector source load method 2013-11-27 12:22:33 -07:00
Tim Schaub 6229c0a1d4 Unused getFeaturesByIds_ method 2013-11-27 12:22:33 -07:00
Tim Schaub 1877f92d46 Add forEach method to rtree, use it in feature cache
This saves having to create feature lookup objects and iterate through lookup properties multiple times.
2013-11-27 12:22:33 -07:00
Tim Schaub 8cc4ae8dbd Separate load requests from feature requests
This separates the action of requesting an extent to be loaded from the action of requesting cached features.  The renderer (or any other consumer of a vector source) calls load to request a data extent.  A `featureload` event fires when new features are loaded.  The renderer (or any other consumer) separately asks for cached features given an extent.  This vector source only loads features once, but this separation will also work with sources that make multiple requests for data in different extents.

This also removes the `data` option from the vector source in favor of a `features` option.  Since we no longer have shared data structures for geometries, people can manually create features and pass them to a vector source.  The `addFeatures` method is exported as well.  This is used to add features to a source that don't have a representation on the "remote" (or server).
2013-11-27 12:22:32 -07:00
Tim Schaub ec02e09ce8 Move render intent enum to feature 2013-11-27 12:22:32 -07:00
Tim Schaub bfaed4d52d Moving all style functionality from source to style 2013-11-27 12:20:43 -07:00
Tim Schaub 307e425891 Remove unused method 2013-11-27 12:20:42 -07:00
Tim Schaub 01a0b9ff8d Private source methods 2013-11-27 12:20:42 -07:00
Tim Schaub 2000b0af78 Vector layer/source refactor
This moves the feature cache from ol.layer.Vector to ol.source.Vector.  These are the minimum changes required to maintain the existing functionality and make tests pass.  More refactoring to come.
2013-11-27 12:20:42 -07:00
Tim Schaub b235fe25ea Return for getFeatureInfoForPixel
In b8a9aeb14e a return was added to `ol.renderer.Layer.prototype.getFeatureInfoForPixel`.  The `ol.renderer.canvas.VectorLayer.prototype.getFeatureInfoForPixel` method needs the same.
2013-11-25 15:29:40 -07:00
Tim Schaub 3fbbdb78d5 Call getElement to get layer 2013-11-19 09:52:27 -07:00
Tim Schaub b0362b8c0a Only set interacting hint when modifying the view 2013-11-14 14:21:01 -07:00
Tim Schaub 22da054774 Determine the callback count while iterating through all layers
Previously, if a layer didn't have a `getFeature*ForPixel` type method, the loop count would be decremented.  This means that all layers would not be considered.  Instead, the callback count should be incremented before requests are made and decremented in the callback.
2013-11-13 07:36:54 -07:00
Tim Schaub a2b55b04e8 Rename layerFilter option to layers and accept array 2013-11-12 22:08:59 -07:00
Tim Schaub 7b69373985 Remove ol.geom2 2013-11-12 19:27:02 -07:00
Tim Schaub 61d13f9a39 Remove ol.source.Vector2 2013-11-12 19:26:29 -07:00
Tim Schaub 75b40a60c0 Remove ol.layer.Vector2 and associated renderer 2013-11-12 19:25:08 -07:00
Tim Schaub cd647a1ebc Removing example 2013-11-12 19:24:13 -07:00
Tim Schaub d577466de6 Common style for drawing and modifying 2013-11-13 00:44:37 +01:00
Tim Schaub af6edadebe Update example with more distinct colors and no social links
Conflicts:
	examples/modify-features.html
2013-11-13 00:44:37 +01:00
Tim Schaub 05b9922861 Tests for draw interaction
The tests revealed that polygons can be drawn with counter-clockwise exterior ring order.  In the polygon constructor, we enforce clockwise winding for exterior rings.  So after drawing, we pass polygon coordinates back to the constructor before adding feature to the target layer.
2013-11-12 16:06:42 -07:00
Tim Schaub 5a898884ec Use geometry type enum for configuring draw interaction
This allows us to cast single-part geometries to multi-part types before adding features to the target layer.  This doesn't yet allow for drawing multi-part geometries with multiple parts.  That can be handled separately.
2013-11-12 11:51:41 -07:00
Tim Schaub 8194ba9f0a Remove setMode method from interaction in favor of add/removeInteraction
This makes the example a bit more awkward, but eventually adding and removing interactions will be the job of an editing control.
2013-11-12 10:30:37 -07:00
Tim Schaub dbcfdbc76f Updated style for draw example 2013-11-12 10:30:37 -07:00
Tim Schaub 62b44f3c73 Add click tolerance to allow dragging while drawing 2013-11-12 10:30:37 -07:00
Tim Schaub 2f07433593 Allow user to set drawing mode 2013-11-12 10:30:37 -07:00
Tim Schaub e3faa76770 Add method to abort drawing 2013-11-12 10:30:37 -07:00
Tim Schaub 4e98e86b14 Stop dblclick propagation while editing 2013-11-12 10:30:37 -07:00
Tim Schaub 048dec1644 Updated sketch style 2013-11-12 10:30:36 -07:00
Tim Schaub 7c197252ed Ensure drawing is not finished prematurely 2013-11-12 10:30:36 -07:00
Tim Schaub 45ba000df5 Pop off last point from linestring 2013-11-12 10:30:36 -07:00
Tim Schaub b5cc35ee04 Snap to finish with configurable tolerance 2013-11-12 10:30:32 -07:00
Tim Schaub ea6500ecd0 Finish lines by clicking last point 2013-11-12 10:29:29 -07:00
Tim Schaub d821f227ba Add point at head of drawing 2013-11-12 10:29:29 -07:00
Tim Schaub b3487ad30e Draw interaction 2013-11-12 10:29:21 -07:00
Tim Schaub 61741669f6 Unregister for feature events when removing features 2013-11-11 16:17:33 -07:00
Tim Schaub 009f7b53a1 Make interactions event targets 2013-11-07 16:39:05 -07:00
Tim Schaub 22fb418236 Provide a method to get the most recent down type event
This will allow interactions to conditionally handle later events based on the down event.
2013-11-07 11:21:01 -07:00
Tim Schaub 812cb7fb12 Leave the down_ event set
The other "up" type listeners (for touch and pointer) do not set this to null.  This event can be of use to a click listener that might want to compare the down position to the click event's position.
2013-11-07 11:02:04 -07:00
Tim Schaub dbc3109ddb Only call expireTiles_ if already rendered 2013-11-07 10:30:58 -07:00
Tim Schaub dcf510fe48 The code generated from objectliterals.jsdoc requires name on same line
Without this change, the `interactions` property is renamed on map options (see #1210).
2013-11-04 17:17:43 -07:00
Tim Schaub b355c1f412 When expiring tiles, consider max symbol size
When an extent is invalidated, we have to expire tiles outside of that extent to account for symbolizer size.
2013-11-04 13:21:23 -07:00
Tim Schaub b0cea7139b Function to buffer an extent 2013-11-04 13:21:11 -07:00
Tim Schaub d5d005ba3f Allow interactions to deal directly with browser events
The relayEvent_ method wraps goog's browser events in our MapBrowserEvent.  This allows interactions to deal with real browser events in addition to our emulated events.
2013-11-01 13:07:44 -06:00
Tim Schaub 7fb56579c5 Add addInteraction and removeInteraction methods to the map
This is in line with how we add/remove controls and overlays.
2013-10-31 09:26:28 -06:00
Tim Schaub 7d2d68c011 Give interactions a reference to the map
This is in line with what we do for controls and overlays.  A follow-up change will add calls to `setMap` when interactions are added to a map.
2013-10-31 09:25:52 -06:00
Tim Schaub 370bb964ab Tests for the image wms source 2013-10-29 14:18:14 -06:00
Tim Schaub 1af11e27ac Proper map extent for GetFeatureInfo request
Note that with and without this change, the pixel provided to the ol.source.wms.getFeatureInfo function will be wrong if the view has non-zero rotation.
2013-10-29 14:11:35 -06:00
Tim Schaub fdda18b57b Use permanent Bing Maps API key
This key is registered for "Not-for-Profit" use by OpenLayers as a project of OSGeo - a 501(c)(4) organization.

See the complete [Terms of Use](http://www.microsoft.com/maps/product/terms.html) under the Eduction or Non-Profit Organization Use section.
2013-10-21 11:21:11 -06:00
Tim Schaub e70b55b60b Check resources length of first resource set (see #1149) 2013-10-21 11:18:24 -06:00
Tim Schaub b02f47a5a5 Align pixels when drawing icons or shapes
The floor before setting the transform ensures that we translate by integer pixels for odd and even dimenstions.  The round before drawing the image ensures pixels are aligned.
2013-10-15 22:12:12 -06:00
Tim Schaub 2011e02364 Avoid calling lineTo on the same pixel for polygon stroke 2013-10-14 17:07:06 -06:00
Tim Schaub 71a6c4f270 Only call lineTo if we are in a new pixel for linestring
Rendering performance degrades as the context lineWidth increases when calling lineTo many times for the same pixel coordinate.  This appears to be a widespread performance issue and is very clearly improved by only calling lineTo when in a new pixel coordinate.
2013-10-14 17:06:44 -06:00
Tim Schaub ca3dcb0e14 Stop base.js from trying to load deps.js 2013-10-09 15:47:30 -06:00
Tim Schaub 2ee776d9f6 Support fontWeight in text symbolizer 2013-10-09 11:59:30 -06:00
Tim Schaub d5ab5ec1d2 Shape symbolizer extends point symbolizer 2013-10-09 09:01:51 -06:00
Tim Schaub e36c53dd23 Icon symbolizer extends point symbolizer 2013-10-09 09:01:30 -06:00
Tim Schaub 03c7e7c031 Rely on java in path 2013-10-08 13:47:46 -06:00
Tim Schaub 539ecbdd9c Add stroke support for text symbolizers 2013-10-07 16:17:38 -06:00
Tim Schaub 5e86ffcca5 Add stroke properties to text symbolizer literal 2013-10-07 16:09:20 -06:00
Tim Schaub 0296ee846a Avoiding unhandled errors
These tests were generating errors that were not caught because they were outside the `it` functions.
2013-10-07 09:47:41 -06:00
Tim Schaub 60a13d6517 Always provide lib functions, conditionally provide scope 2013-10-07 09:46:24 -06:00
Tim Schaub 67fab12fef Listen for feature events and fire layer events 2013-10-03 15:51:00 -06:00
Tim Schaub adf99d592a Listen for geometry events and fire feature events 2013-10-03 15:50:23 -06:00
Tim Schaub b821619368 Change event for polygons 2013-10-03 12:28:35 -06:00
Tim Schaub 30b2e3930b Add setCoordinates for linestring and dispatch change event 2013-10-03 12:28:35 -06:00
Tim Schaub e78690c2d2 Add setCoordinates for point and dispatch change event 2013-10-03 12:28:35 -06:00
Tim Schaub 9b47c15bd8 Make geometries event targets
Previously, the tests were using eql to make assertions about matching geometries.  This is inappropriate for structures with circular references (as with goog.events.EventTarget);
2013-10-03 12:28:34 -06:00
Tim Schaub 626a319222 Accessor for polygon rings 2013-10-03 12:28:34 -06:00
Tim Schaub 64dd5cfc1f Extend goog.events.Event for custom vector layer events
Vector events include features and extents.  In the case of feature change events, the extents array will include old and new extents for features with modified geometries.w
2013-10-03 11:25:30 -06:00