Commit Graph
100 Commits
Author SHA1 Message Date
Éric Lemoine b698c5bf7b Add a layer clipping example 2013-11-20 11:44:47 +01:00
Éric Lemoine 2073d78582 Fire precompose events from layers 2013-11-20 11:44:47 +01:00
Éric Lemoine c0e1c7051b Add display-frame-rate.js script 2013-11-20 11:44:45 +01:00
Éric Lemoine 60ef4f214e Rename symbol to shape 2013-11-20 11:44:45 +01:00
Éric Lemoine 0d84befe83 Add synthetic-data example 2013-11-20 11:39:18 +01:00
Éric Lemoine 0c9f7eb616 Use experimental canvas vector layer renderer 2013-11-20 11:39:16 +01:00
Éric Lemoine 4b9642f4b1 Experimental canvas vector layer renderer 2013-11-20 11:36:28 +01:00
Éric Lemoine d81fe5ac95 Map browser event handler refactoring
This commit refactors the code of the map browser event handler. The changes are the following:

Previously the `handleTouch*_` listener functions handled both `touch*` and `mspointer*` events. With this commit we use per-event type listeners. This duplicates some code (could be avoidable), but makes it easier to introduce mouse/touch/pointer specific treatments in the future.

We now listen to pointermove, pointerup, touchmove and touchend only when needed. In this way we're assured that a `down` event was received (and that `this.down_` is set) when the `up` or `move` listeners are called. This fixes the bug @oterral reported on the mailing list: https://groups.google.com/d/msg/ol3-dev/jR844F7Nlg8/eN9dt4uATK0J.

To avoid problems in browsers that trigger different types of events (e.g. both mouse and pointer events) the `down` listeners unregister the other `down` listeners. For example, the `pointerdown` listener unregisters the `mousedown` and `touchstart` listeners, for ever.
2013-10-31 13:35:01 +01:00
Éric Lemoine 8402eee0c3 Map "click" event renamed to "singleclick"
As discussed with @tschaub in #1195.
2013-10-31 09:37:16 +01:00
Éric Lemoine 2c930d74b5 clickOnly condition checks map clicks 2013-10-30 13:17:12 +01:00
Éric Lemoine 6ab88aad72 Add tests for emulated clicks 2013-10-30 13:16:09 +01:00
Éric Lemoine 0fa66cc7e7 Remove mousedown listener on first touchstart 2013-10-30 13:16:09 +01:00
Éric Lemoine 9f7ead5ef4 Remove unused ol.MapBrowserEventHandler#relayEvent_ func 2013-10-30 13:16:09 +01:00
Éric Lemoine a85b82090d Emulate click events only on mouse "action"
`click` events are fired only if the mouse action button is pressed. This prevents `click` events from being fired when the middle mouse button is used.

Also, without this commit, in Chrome with emulated touch events enabled, double-clicking the map doesn't zoom the map. This is because `ol.BrowserFeature.HAS_TOUCH` is `false` in that environment. The commit fixes it by testing `isMouseActionButton` on mouse devices only.
2013-10-30 13:16:09 +01:00
Éric Lemoine 0c212fdcb5 Emulated click events on mouse devices
The map already emits emulated `click` and `dblclick` events on touch and pointer devices. With this commit the map emits emulated `click` and `dblclick` events on mouse devices as well.
2013-10-30 13:16:09 +01:00
Éric Lemoine 16b817b830 Overlay stopEvent and insertFirst default to true 2013-10-30 09:49:38 +01:00
Éric Lemoine c065282243 Stop mspointer events
Stop mspointerup and mspointerdown events reaching the "stop event" overlay container.
2013-10-21 15:33:12 +02:00
Éric Lemoine 1c890d837e Unconditonally set the framestate focus 2013-10-18 10:03:59 +02:00
Éric Lemoine 08bad9746b Do not relay mouseout events 2013-10-18 10:00:53 +02:00
Éric Lemoine 4008ab7f6c Vector examples display feature info on click again 2013-10-18 09:59:47 +02:00
Éric Lemoine 4c7f30c139 Make overlay container stop touchend and mouseup 2013-10-18 09:59:47 +02:00
Éric Lemoine 70eb5a5f13 Emulate click and dblclick on touch devices 2013-10-18 09:59:47 +02:00
Éric Lemoine fe3440a83d Use jQuery to listen to map mousemove in examples
This commit also removes the click listener, which was used for touch devices. The click listener will be added back when the lib will correctly handle clicks on touch devices.
2013-10-18 09:59:47 +02:00
Éric Lemoine 938f45a032 Do not relay mousemove events 2013-10-18 09:59:46 +02:00
Éric Lemoine 1c051aa055 Do not relay contextmenu events 2013-10-18 09:59:46 +02:00
Éric Lemoine 69642f9a6d Export ol.Map#getViewport 2013-10-15 11:33:32 +02:00
Éric Lemoine 4c04c9fa5c Use getCoordinatePixel in ol.MapBrowserEvent 2013-10-14 15:36:46 +02:00
Éric Lemoine 49e0af5abb Use getEventPixel in ol.MapBrowserEvent 2013-10-14 15:36:37 +02:00
Éric Lemoine 3aeb4d1584 Export ol.Map#getEventCoordinate 2013-10-14 15:30:23 +02:00
Éric Lemoine dbdacec6df Export ol.Map#getEventPixel 2013-10-14 15:30:23 +02:00
Éric Lemoine c9b1ba51fa Add ol.Map#getEventCoordinate 2013-10-14 09:43:25 +02:00
Éric Lemoine 406207213f Add ol.Map#getEventPixel 2013-10-14 09:43:11 +02:00
Éric Lemoine 036dee55a9 Revert "Always set CLOSURE_NO_DEPS to true"
This reverts commit aa5a571ab1.
2013-10-10 09:26:37 +02:00
Éric Lemoine 5c5fcb7e06 Use @exportSymbol for exporting ol.webgl.SUPPORTED
For consistency with the way we export ol.DeviceOrientation.SUPPORTED and ol.Geolocation.SUPPORTED.
2013-09-28 22:47:25 +02:00
Éric Lemoine 925b5d285a Fix export for ol.DeviceOrientation.SUPPORTED 2013-09-28 22:44:59 +02:00
Éric Lemoine 43561c302e Fix export for ol.Geolocation.SUPPORTED 2013-09-28 22:44:35 +02:00
Éric Lemoine b2c336c29e Use typedef in source code for SourceOptions 2013-09-23 17:53:43 +02:00
Éric Lemoine aa5214d3a1 Add an "accessible" example 2013-09-16 22:51:57 +02:00
Éric Lemoine b81a4e875b Remove noModifierKeys condition for keyboad zoom
Refs #917. With the key hanler now attached to the map target by default we can remove the noModifierKeys condition for the keyboard zoom interaction. This will prevent the back button shortcut (alt + <back arrow>) to work, but it's ok, the map is focused so it's the one with the highest priority.
2013-09-16 22:51:44 +02:00
Éric Lemoine f863ee9e37 Attach key handler to map target 2013-09-16 22:43:26 +02:00
Éric Lemoine 4990c797d1 WMTS tiles touching the extent are excluded 2013-09-16 15:53:13 +02:00
Éric Lemoine 832be21c0f WMS tiles touching the extent are excluded 2013-09-16 15:52:52 +02:00
Éric Lemoine 70c66d4cf1 Add ol.extent.touches 2013-09-16 15:51:12 +02:00
Éric Lemoine 009172951c WebGL image layer tests require the common proj 2013-09-15 10:37:22 -06:00
Éric Lemoine ecd82297a0 Better setup/teardown for ol.proj tests 2013-09-15 10:37:01 -06:00
Éric Lemoine 8301b01395 Remove ol.Object#bindTo noNotify option 2013-09-13 16:46:49 +02:00
Éric Lemoine ba3f97d50a Change the interaction condition signature 2013-09-12 18:08:01 +02:00
Éric Lemoine 78a3ac46dd Rename options type for ol.source.TileImage 2013-09-11 18:28:03 +02:00
Éric Lemoine 7db1b4b337 Rename file for ol.source.TileImage 2013-09-11 18:28:03 +02:00
Éric Lemoine 762fed6f8d Change Tiled to Tile in a comment 2013-09-10 09:41:38 +02:00
Éric Lemoine 8a7e13a50c Rename tiledwmssource.js to tilewmssource.js 2013-09-10 09:41:38 +02:00
Éric Lemoine 31cc1f5541 More robust coordinate keys for WMTS and TiledWMS
This uses more robust ZXY coordinate keys, and caches the key to avoid creating garbage each time getKeyZXY is called.
2013-09-09 17:01:38 +02:00
Éric Lemoine 0823ee4ad3 Add getDimensions/updateDimensions to WMTS 2013-09-09 17:00:05 +02:00
Éric Lemoine 02a285665b Remove unneeded FIXME 2013-09-07 23:50:15 +02:00
Éric Lemoine e01344f0da Be stricter with types in WMTS 2013-09-07 23:50:01 +02:00
Éric Lemoine 3036ee01ad Be stricter with types in BingMaps 2013-09-07 23:49:37 +02:00
Éric Lemoine 1e308e34f9 Stricter type def for ol.TileUrlFunctionType 2013-09-07 23:32:38 +02:00
Éric Lemoine 30acfc20c3 Stricter type def for ol.ImageUrlFunctionType 2013-09-07 23:32:30 +02:00
Éric Lemoine fe1f10e797 No need for ol.Map#target_ 2013-09-04 12:08:15 +02:00
Éric Lemoine d68f411e82 Add doc for ol.Collection#getArray 2013-09-02 18:24:07 +02:00
Éric Lemoine 52c58721e1 export ol.Map.prototype.getControls 2013-09-02 14:17:23 +02:00
Éric Lemoine 7e25ecb3dc Remove map from OverlayOptions 2013-09-02 14:15:11 +02:00
Éric Lemoine dd4b2e3e88 Add overlay-related methods to ol.Map 2013-09-02 14:12:54 +02:00
Éric Lemoine 7af4cbb75e Export ol.Collection#getArray 2013-09-02 11:25:52 +02:00
Éric Lemoine 96ef1ed3bd Remove handleMapPostrender extension point 2013-08-31 23:25:08 +02:00
Éric Lemoine 729039ba04 Adapt examples to new signature for ol.Attribution 2013-08-30 16:50:36 +02:00
Éric Lemoine 38ab64c3c3 Adapt sources to new signature for ol.Attribution 2013-08-30 16:50:36 +02:00
Éric Lemoine 818894bb56 ol.Attribution is a single-arg constructor 2013-08-30 16:50:36 +02:00
Éric Lemoine 561581cf8b Move exports file for proj 2013-08-29 15:38:00 +02:00
Éric Lemoine a86ea051bf Move and rename exports file for ol.expr 2013-08-29 15:24:52 +02:00
Éric Lemoine 0c091e868c ol.Feature.prototype.get need not be exported
get is not overridden in ol.Feature.prototype, so there's no need for a specific export.
2013-08-29 14:05:25 +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
Éric Lemoine d1e879e03f Use ol.Collection#getElement in tests 2013-08-27 22:11:33 +02:00
Éric Lemoine 9895f879f9 Export ol.CollectionEvent#getElement 2013-08-27 22:08:26 +02:00
Éric Lemoine 9f2c351057 Use ol.CollectionEvent#getElement in LayerGroup 2013-08-27 22:07:45 +02:00
Éric Lemoine b9f2f7bcb4 Add ol.CollectionEvent#getElement 2013-08-27 22:07:03 +02:00
Éric Lemoine f273be6597 Export ol.source.Source#getExtent 2013-08-27 15:42:55 +02:00
Éric Lemoine d0f793b7a0 Fix bad option name in ol.control.defaults 2013-08-19 17:00:43 +02:00
Éric Lemoine d6d15db6e8 Use @exportFunction to export animation functions 2013-08-19 17:00:43 +02:00
Éric Lemoine f67d3dc165 Use @exportFunction to export ol.interaction.defaults 2013-08-19 17:00:43 +02:00
Éric Lemoine 29a2d2a9f7 Use @exportFunction to export ol.control.defaults 2013-08-19 17:00:43 +02:00
Éric Lemoine 169e986b28 Remove 2nd arg to ol.interaction.defaults 2013-08-19 17:00:43 +02:00
Éric Lemoine 3d2d45e01f Remove 2nd arg to ol.control.defaults 2013-08-19 17:00:37 +02:00
Éric Lemoine 3f6b9c9434 Use ol.Collection#extend in examples
This commit changes the examples to using ol.control.defaults().extend to extend the collection of controls. This is in preparation for a future commit that will remove the 2nd argument to ol.control.defaults. The same is done for ol.interaction.defaults.
2013-08-19 14:25:38 +02:00
Éric Lemoine 41fe103fa4 Export ol.Collection#extend 2013-08-19 14:25:38 +02:00
Éric Lemoine 6576a49178 Make ol.Collection#extend return this
This to be able to do this:

new ol.Map({
  controls: ol.control.defaults().extend([new MyControl()]),
  ...
})
2013-08-19 14:25:38 +02:00
Éric Lemoine 77adbdfa7a Use per-animation function modules
Currently the animation functions share the same module, namely ol.animation. We do differently for ol.control.defaults and ol.interaction.defaults, with ol.control.defaults and ol.interaction.defaults module. This commit replaces the ol.animation module by four modules, one for each animation function.

This makes things more consistent, and will make it possible to use the @exportFunction annotation for the exporting of the animation functions.
2013-08-19 14:25:38 +02:00
Éric Lemoine a37f114e4b Add export annotation @exportFunction
This commit adds a new export annotation: @exportFunction. @exportFunction is to be used to declare functions that take an options object literal as their first arguments. @exportFunction is to regular functions as @exportClass is to constructors.

The usage of @exportFunction is as follows:

@exportFunction ol.control.defaults ol.control.DefaultsOptions ol.Collection

Note: the Function#export method uses a recursive function. This is to handle nested options.
2013-08-19 14:01:57 +02:00
Éric Lemoine 8d09be7134 No reference to internal types in externs file
Currently we have things like like in the generated externs file (types.js):

/**
 * @type {ol.control.AttributionOptions|undefined}
 */
olx.control.DefaultsOptionsExtern.prototype.attributionOptions;

It doesn't make sense to have external object properties whose types are
internal (ol.control.AttributionOptions in the above example).

With this commit, the generate-exports.py script generates this:

/**
 * @type {olx.control.AttributionOptionsExtern|undefined}
 */
olx.control.DefaultsOptionsExtern.prototype.attributionOptions;
2013-08-19 13:54:26 +02:00
Éric Lemoine fef6359f75 Update key in bing-maps example 2013-07-17 10:21:28 +02:00
Éric Lemoine 907476f566 No need to impl setMap in ZoomToExtent control 2013-07-16 17:13:38 +02:00
Éric Lemoine 42d02e064e Export ol.layer.Layer and its getSource func 2013-07-12 10:21:01 +02:00
Éric Lemoine 9b039d76ea Export ol.source.TileSource and its getTileGrid func 2013-07-12 10:20:02 +02:00
Éric Lemoine b2fc570328 Export tilegrid.WMTS functions 2013-07-12 10:12:51 +02:00
Éric Lemoine c51265502d Export TileGrid functions 2013-07-12 10:12:30 +02:00
Éric Lemoine 3e4d39b228 Export ol.View2D#getZoom 2013-07-11 09:50:31 +02:00
Éric Lemoine daa03b5ef7 @class doc for View2D 2013-07-09 15:28:31 +02:00
Éric Lemoine 42abdb308a Better docs for View2DOptions 2013-07-09 15:28:31 +02:00
Éric Lemoine 44a9c181aa handleMapPostrender may get a null frameState 2013-07-09 10:06:01 +02:00
Éric Lemoine ccf6aa10ac Zoomslider cannot be added to a map with no target
The zoom slider control's initSlider_ function requires that the control's element is inserted in the document. So if initSlider_ is called before the map have a target then the slider isn't correctly initialized. This commit fixes that by defering the slider initialization until the first handleMapPostrender call.
2013-07-09 10:05:15 +02:00