Compare commits

...

450 Commits

Author SHA1 Message Date
Bart van den Eijnden
626d1da0e7 Merge pull request #3406 from bartvde/release-v3.4.0
Release v3.4.0
2015-03-27 10:22:38 +01:00
Bart van den Eijnden
96c670cebf Update package version to 3.4.0 2015-03-27 10:08:50 +01:00
Bart van den Eijnden
42366c3d00 Changelog for v3.4.0 2015-03-27 10:08:30 +01:00
Bart van den Eijnden
d698e2fcee Merge pull request #3383 from bartvde/xmleql-performance
GML3 tests time out in unit tests
2015-03-26 17:10:25 +01:00
Bart van den Eijnden
7d5ede6728 Restore the previous error messages 2015-03-26 16:48:22 +01:00
Bart van den Eijnden
616a0b161e Speed up xmleql performance 2015-03-26 16:03:28 +01:00
Tim Schaub
6e878468ae Merge pull request #3401 from tschaub/geojson-orientation
Allow GeoJSON to be serialized according to the right-hand rule.
2015-03-26 08:44:57 -06:00
Frédéric Junod
9b23572d4e Merge pull request #3403 from fredj/unused-require
Remove unused goog.require
2015-03-26 14:08:24 +01:00
Frederic Junod
c0c3057498 Remove unused goog.require 2015-03-26 11:54:37 +01:00
Andreas Hocevar
34851d8ecb Merge pull request #3362 from ahocevar/constructor-proj4js
Configure proj4 options and transforms upon construction
2015-03-26 11:21:52 +01:00
Andreas Hocevar
362c9b6851 Clarification of the purpose of ol.proj.addProjection 2015-03-26 10:52:19 +01:00
Andreas Hocevar
a920cd94d9 Create ol.proj.Projection instances with additional properties 2015-03-26 10:50:52 +01:00
Andreas Hocevar
338901774b Configure proj4 options and transforms upon construction 2015-03-26 10:39:26 +01:00
Frédéric Junod
2c04e4c071 Merge pull request #3394 from fredj/fullscreen-css-name
Fix fullscreen pseudo CSS class name
2015-03-26 09:00:57 +01:00
Tim Schaub
be0c9f3c8a Allow orienting coordinates when serializing GeoJSON 2015-03-25 18:32:31 -06:00
Tim Schaub
5d590bcf95 Allow access to right-hand oriented multi-polygon coordinates 2015-03-25 16:57:29 -06:00
Tim Schaub
7572f27cf9 Allow access to right-hand oriented polygon coordinates 2015-03-25 16:57:29 -06:00
Tim Schaub
ce36947bdb Allow orienting with the right-hand rule 2015-03-25 16:57:25 -06:00
Tim Schaub
5f6ceff3a7 Use ol.geom.flat.orient namespace 2015-03-25 16:33:17 -06:00
Andreas Hocevar
7d20e2a317 Merge pull request #3399 from ahocevar/tilegrid-widths-docs
Clarify when widths need to be configured on a tile grid
2015-03-25 17:18:27 +01:00
Andreas Hocevar
0d507dcbb0 Clarify when widths need to be configured on a tile grid 2015-03-25 16:52:45 +01:00
Andreas Hocevar
c600a92516 Merge pull request #3398 from ahocevar/safe-wrapx
Make sure that the return value of wrapX() is stable
2015-03-25 16:21:53 +01:00
Andreas Hocevar
1df8cba753 Make sure that the return value of wrapX() is stable 2015-03-25 15:59:59 +01:00
Frédéric Junod
bb87b8e7ce Merge pull request #3396 from fredj/sort-compareFn
Move the compare function out of ol.interaction.Modify.handleDownEvent_
2015-03-25 14:57:50 +01:00
Frederic Junod
6a770f03b8 Move the compare function out of ol.interaction.Modify.handleDownEvent_ 2015-03-25 14:41:40 +01:00
Andreas Hocevar
683097d62a Merge pull request #3395 from fperucic/inteaction.modify-fix
ol.Interaction.Modify fixes
2015-03-25 14:16:37 +01:00
Andreas Hocevar
e58a470e69 Merge pull request #3387 from ahocevar/wmts-wrapx
Add wrapX option for ol.source.WMTS
2015-03-25 14:01:04 +01:00
Fran Peručić
56067d1cda Prevent unnecessary function calls
handlePointerMove_ doesn't need to be called when dragging.
handleDragEvent_ takes care of the event in that case.

in handleDragEvent_, createOrUpdateVertexFeature_ doesn't need to be called for each dragged segment. it can be called only once with current vertex.

fixes made to pass the build
2015-03-25 11:19:24 +01:00
Frederic Junod
40f4d5256b Fix fullscreen pseudo CSS class name
Change from `:full-screen` to `:fullscreen`.
See https://fullscreen.spec.whatwg.org/#:fullscreen-pseudo-class
2015-03-25 11:14:52 +01:00
Fran Peručić
279d1829bb fix: ol.interaction.Select conflict
Prevent vertexFeature_ from ol.interaction.Modify from being selected by ol.interaction.Select.
The bug occurs when an delete attempt fails. ex: clicikng on the first or last node of LineString,
or clicking a line segment between two nodes.
2015-03-25 10:52:29 +01:00
Fran Peručić
eb6d61e6d1 fix: modifying the closed LineString
This commit fixes the bug that occurs when trying to modify
a closed LineString by clicking on the starting/ending node.

Such a closed line is added to the modify-test example.
2015-03-25 10:44:35 +01:00
Fran Peručić
7dff739bce Deleting a duplicate node
Fix a bug in ol.interaction.Modify when trying to delete nodes
on a geometry that has duplicate nodes. A bug occurs when
clicking on the duplicate node.
2015-03-25 10:34:36 +01:00
Frédéric Junod
8beeee8a95 Merge pull request #3393 from fredj/cleanup
Remove unused define
2015-03-25 08:54:27 +01:00
Andreas Hocevar
ebb40c8046 Clean up docs and consistently work with resolutions 2015-03-24 19:03:33 +01:00
Andreas Hocevar
4822ca273f Give tile grids a width 2015-03-24 19:03:09 +01:00
Tobias Sauerwein
563d51b389 Merge pull request #3392 from tsauerwein/fullscreen-class
Fix switching class name of full-screen control
2015-03-24 18:26:20 +01:00
Andreas Hocevar
57d9b87fb3 Add wrapX option for ol.source.WMTS 2015-03-24 17:13:07 +01:00
Frederic Junod
4c36e05f27 Remove unused define
Should have been removed in #40
2015-03-24 17:10:27 +01:00
tsauerwein
eb7dde6d0f Fix class name of full-screen control 2015-03-24 17:07:55 +01:00
Frédéric Junod
1d04eabeda Merge pull request #3391 from fredj/cleanup
Minor code cleanup
2015-03-24 14:57:51 +01:00
Frédéric Junod
5c6c45fc92 Merge pull request #3388 from fredj/polyline-layout
Add new geometry layout option for polyline format
2015-03-24 14:44:06 +01:00
Frederic Junod
b7c4e4f297 Remove console.debug from selectinteraction tests 2015-03-24 14:42:30 +01:00
Frederic Junod
6a8b236d82 Remove unnecessary newlines 2015-03-24 14:41:40 +01:00
Frederic Junod
e669b20ed5 Add new geometry layout option for polyline format
To be able to choose the geometry layout of the feature geometries created by
the format reader.

Default is `ol.geom.GeometryLayout.XY`
2015-03-24 11:39:18 +01:00
Éric Lemoine
ae2c9144e1 Merge pull request #3385 from elemoine/getzforresolution
Fix ol.tilegrid.TileGrid#getZForResolution
2015-03-23 18:31:42 +01:00
Andreas Hocevar
45e9695239 Merge pull request #3377 from ahocevar/attribution-wrapx
Support wrapX for attributions
2015-03-23 18:05:13 +01:00
Éric Lemoine
79748c6f0c Fix ol.tilegrid.TileGrid#getZForResolution
This fixes a bug in ol.tilegrid.TileGrid#getZForResolution where this function doesn't take minZoom and maxZoom into account when selecting a zoom level for a resolution.

Fixes #2780.
2015-03-23 18:04:13 +01:00
Andreas Hocevar
d9c04cd925 Support wrapX for attributions 2015-03-23 16:55:50 +01:00
Andreas Hocevar
7df00242f0 Merge pull request #3382 from ahocevar/github-source-links
Create github source links
2015-03-23 16:47:47 +01:00
Andreas Hocevar
4862a8c897 Create github source links 2015-03-23 16:08:36 +01:00
Andreas Hocevar
8813eb0112 Merge pull request #3376 from ahocevar/wms-tile-wrapx
Add ol.source.Tile support for wrapping around the x-axis
2015-03-23 14:37:12 +01:00
Andreas Hocevar
b75f7f9e3b Merge pull request #3378 from ahocevar/questions
Clarify where to ask questions
2015-03-23 14:24:14 +01:00
Andreas Hocevar
9b4cb96502 Clarify where to ask questions 2015-03-23 14:14:34 +01:00
Frédéric Junod
c71db17c1d Merge pull request #3380 from fredj/more-geojson-tests
Test the GeoJSON layout
2015-03-23 13:29:13 +01:00
Frederic Junod
bfd9ec1ef1 Test the GeoJSON layout 2015-03-23 12:47:34 +01:00
Andreas Hocevar
3e18b85206 Add ol.source.Tile support for wrapping around the x-axis 2015-03-22 14:27:19 +01:00
Frédéric Junod
c707c5e9db Merge pull request #3360 from fredj/dispose-imagetile
Don't unlisten image twice when disposing an ol.ImageTile
2015-03-18 11:46:09 +01:00
Frederic Junod
f474e7ccd9 Don't unlisten image twice when disposing an ol.ImageTile
Fixes #3325
2015-03-18 10:33:41 +01:00
Andreas Hocevar
752cf78e50 Merge pull request #3361 from ahocevar/test-listen-localhost
Listen on localhost to avoid phantomjs browsing 0.0.0.0
2015-03-18 09:54:08 +01:00
Andreas Hocevar
52ee1b1630 Merge pull request #3365 from ahocevar/pointresolution-docs
Better docs for #getPointResolution
2015-03-18 09:53:29 +01:00
Andreas Hocevar
d8f624bf44 Better docs for #getPointResolution 2015-03-18 09:26:02 +01:00
Andreas Hocevar
7916f36f7a Merge pull request #3363 from bill-chadwick/master
New ol.proj features
2015-03-18 00:22:34 +01:00
bill-chadwick
3efea3ddfc Update to ol.proj
Add support for custom getPointResolution
and setting the 'global' boolean
2015-03-17 23:08:11 +00:00
Andreas Hocevar
9462c2148d Listen on localhost to avoid phantomjs browsing 0.0.0.0 2015-03-17 14:39:00 +01:00
Bart van den Eijnden
8061b69495 Merge pull request #3305 from bartvde/image-load-events
Add image loading events to image sources (r=@ahocevar,@elemoine)
2015-03-17 13:07:37 +01:00
Bart van den Eijnden
4569858882 Add image loading events to image sources 2015-03-17 12:56:39 +01:00
Frédéric Junod
3a7b9751d7 Merge pull request #3343 from fredj/line-arrows
Line arrows example
2015-03-16 14:30:08 +01:00
Frédéric Junod
d3f246518b Merge pull request #3354 from fredj/geojson-write-options
Mark ol.format.GeoJSON#writeFeature(s) option param optional
2015-03-16 11:31:59 +01:00
Frederic Junod
b9aba8babd Add optional this param to the callback function 2015-03-16 11:25:51 +01:00
Frederic Junod
023816f43b Add new line-arrows example 2015-03-16 10:43:33 +01:00
Frederic Junod
4b13627fd7 Add new ol.geom.LineString#forEachSegment function 2015-03-16 10:43:33 +01:00
Frédéric Junod
dd23403315 Merge pull request #3346 from fredj/geojson-feature-properties
Set the 'properties' member to null if the feature has not properties
2015-03-16 10:21:05 +01:00
Frederic Junod
3a7d1ebd16 Mark ol.format.GeoJSON#writeGeometry option param optional 2015-03-16 09:25:50 +01:00
Frederic Junod
180a75d714 Mark ol.format.GeoJSON#writeFeature option param optional 2015-03-16 09:20:57 +01:00
Frederic Junod
0997a171a0 Mark ol.format.GeoJSON#writeFeatures option param optional 2015-03-16 09:18:52 +01:00
Frederic Junod
96883e0b69 Set the 'properties' member to null if the feature has not properties 2015-03-12 15:58:16 +01:00
Frédéric Junod
da94ee5754 Merge pull request #3344 from fredj/cleanup
Minor code cleanup
2015-03-12 13:24:02 +01:00
Frederic Junod
5a350fb978 Remove unused goog.require 2015-03-12 12:25:38 +01:00
Frederic Junod
d87da4b3c8 Better 'rotation' option documentation 2015-03-12 12:17:25 +01:00
Éric Lemoine
80fa7e5ba1 Merge pull request #3237 from Morgul/ccase-circle-drawing
Add circles to Draw interaction.
2015-03-11 17:08:10 +01:00
Christopher S. Case
1fb932f7bb Removed lurking console.log 2015-03-11 10:09:58 -05:00
Frédéric Junod
b26bea8e88 Merge pull request #2691 from fredj/will-change
Add will-change CSS properties
2015-03-11 12:15:44 +01:00
Frederic Junod
1a80c0ef01 Add will-change CSS property to ol-overlay-container elements 2015-03-11 11:08:14 +01:00
Frederic Junod
dcba9f2ff4 Add a 'ol-overlay-container' CSS class to the overlay element 2015-03-11 11:08:14 +01:00
Frederic Junod
064cd5695a Add will-change CSS property to scale line and rotate controls 2015-03-11 11:08:14 +01:00
Frédéric Junod
b6adeea4f4 Merge pull request #3336 from fredj/getTargetElement
Use ol.Map#getTargetElement function
2015-03-09 17:15:20 +01:00
Frédéric Junod
49a807fa56 Merge pull request #3335 from fredj/rbush
Update rbush to version 1.3.5
2015-03-09 17:14:51 +01:00
Frederic Junod
7dcef882c2 Use ol.Map#getTargetElement function 2015-03-09 16:21:03 +01:00
Frederic Junod
b6b8ae265c Update rbush to version 1.3.5 2015-03-09 16:03:09 +01:00
Frédéric Junod
9951c88343 Merge pull request #3322 from fredj/drawinteraction-map.isDef
Remove unneeded map.isDef call
2015-03-09 09:01:05 +01:00
Andreas Hocevar
c9715d32b0 Merge pull request #3327 from ahocevar/dist-css
Add css to dist directory
2015-03-07 21:55:25 +01:00
Andreas Hocevar
47f32a30b8 Merge pull request #3324 from ahocevar/select-event-interface
Add interface definition for ol.SelectEvent
2015-03-06 12:41:05 +01:00
Andreas Hocevar
d8150c5155 Add interface definition for ol.SelectEvent 2015-03-06 11:31:30 +01:00
Andreas Hocevar
1b640870b1 Add css to dist directory 2015-03-06 11:20:01 +01:00
Frederic Junod
0d979e37b8 Remove unneeded map.isDef call 2015-03-05 18:12:23 +01:00
Frederic Junod
daf81b9c26 Remove unused goog.require 2015-03-05 18:11:19 +01:00
Frédéric Junod
4b1accb149 Merge pull request #3315 from fredj/tissot-desc
Fix Tissot indicatrix example description
2015-03-05 13:55:06 +01:00
Frederic Junod
b79174d6a3 Fix Tissot indicatrix example description
Fixes #3314
2015-03-05 12:36:37 +01:00
Andreas Hocevar
41fe72fab5 Merge pull request #3312 from ahocevar/arcgis-hidpi
Fix HiDPI support for ArcGIS REST
2015-03-04 22:33:21 +01:00
Andreas Hocevar
8f1726ae39 Fix HiDPI support for ArcGIS REST 2015-03-04 22:11:16 +01:00
Bart van den Eijnden
3867c0e45a Merge pull request #2910 from bartvde/issue-2910
Support multiple featureTpes in GML parser
2015-03-04 18:59:05 +01:00
Bart van den Eijnden
15ab515ceb Add docs to explain how to use featureNS in the case of multiple feature namespaces 2015-03-04 18:33:56 +01:00
Éric Lemoine
aad727ad14 Merge pull request #3309 from bjornharrtell/select-multi-fix
Fix select event always reporting as multi select
2015-03-04 18:04:15 +01:00
Bart van den Eijnden
b698fe9968 Support multiple featureTypes with a different featureNS 2015-03-04 15:27:05 +01:00
Andreas Hocevar
b782e0be98 Merge pull request #3307 from ahocevar/scaleline-units
Handle all non-degree units in ol.control.ScaleLine
2015-03-04 11:20:05 +01:00
Bart van den Eijnden
b05ead4056 Allow multiple featureTypes through ol.format.WFS as well 2015-03-04 10:24:42 +01:00
Bart van den Eijnden
d0180f35e0 Support multiple featureTypes as well in autoconfigure mode 2015-03-04 10:20:36 +01:00
Bart van den Eijnden
3a7905f2fd Support multiple feature types in GML format 2015-03-04 10:16:25 +01:00
Björn Harrtell
49c2af165a Fix select event always reporting as multi select 2015-03-04 08:48:08 +01:00
Andreas Hocevar
7527eddbaf Merge pull request #3308 from ahocevar/release-v3.3.0
Release v3.3.0
2015-03-03 22:28:30 +01:00
Andreas Hocevar
6854833fbd Update package version to 3.3.0 2015-03-03 22:27:25 +01:00
Andreas Hocevar
c8b90adfef Changelog for v3.3.0 2015-03-03 22:27:15 +01:00
Andreas Hocevar
d33a45dfa2 Merge pull request #3263 from cwgrant/master
Support ArcGIS Rest Services
2015-03-03 21:40:33 +01:00
Andreas Hocevar
1cec149681 Merge pull request #3295 from sarametz/wmts-getcap
Add RESTful to WMTS GetCapabilities optionsFromCapabilities
2015-03-03 21:13:00 +01:00
Andreas Hocevar
2e3d0d57d5 Handle all non-degree units in ol.control.ScaleLine 2015-03-03 21:06:12 +01:00
Frédéric Junod
a629be0e2e Merge pull request #3304 from fredj/scaleline-padding
Remove scale line inner padding
2015-03-03 17:46:29 +01:00
Frederic Junod
6c32b280f5 Remove scale line inner padding
Fixes #3291
2015-03-03 17:06:41 +01:00
Éric Lemoine
787ab91eef Merge pull request #3296 from elemoine/changes
Add upgrade-notes.md file
2015-03-03 14:28:30 +01:00
Andreas Hocevar
5b539a75bb Merge pull request #3303 from ahocevar/us-ft
Add constant for us-ft units
2015-03-03 14:01:02 +01:00
Andreas Hocevar
a6f80ef4b8 Add constant for us-ft units 2015-03-03 13:51:23 +01:00
Andreas Hocevar
de42334b19 Merge pull request #3018 from bjornharrtell/selectevent
Add SelectEvent to interaction
2015-03-03 12:56:42 +01:00
Björn Harrtell
e4b1d6e1de Add SelectEvent to Select interaction
Fixes
2015-03-03 12:22:01 +01:00
Sara Metz
cadc346de2 Added RESTful to valid requestEncoding values 2015-03-03 12:45:24 +13:00
Andreas Hocevar
927a0a4627 Merge pull request #3301 from bjornharrtell/select-tests
Select interaction unit tests
2015-03-02 21:12:15 +01:00
Björn Harrtell
d9cf8df052 Select interaction unit tests 2015-03-02 19:52:48 +01:00
Bart van den Eijnden
2ff3682eff Update README.MD with stackoverflow 2015-03-02 15:27:03 +01:00
Frédéric Junod
8836dd6e70 Merge pull request #3298 from fredj/source-object
Make ol.source.Source inherit from ol.Object
2015-03-02 15:07:33 +01:00
Frederic Junod
6ab0ed2df7 Make ol.source.Source inherit from ol.Object 2015-03-02 14:48:17 +01:00
Frédéric Junod
8dd3e7ebff Merge pull request #3297 from fredj/wmts-getter
Add getters to ol.source.WMTS
2015-03-02 11:11:12 +01:00
Éric Lemoine
7f71876dad Add upgrade-notes.md file
This file includes upgrade notes for changes to the library that require changes to application code. This file is used by the release manager to fill the "Upgrade notes" section in the v3.x.y.md changelog file.
2015-03-02 10:37:42 +01:00
Frederic Junod
54bea174ff Add new ol.source.WMTS#getMatrixSet api function 2015-03-02 09:51:11 +01:00
Frederic Junod
9d37090e6b Add new ol.source.WMTS#getFormat api function 2015-03-02 09:40:08 +01:00
Frederic Junod
b42a214252 Add new ol.source.WMTS#getVersion api function 2015-03-02 09:40:08 +01:00
Frederic Junod
61d2506970 Add new ol.source.WMTS#getStyle api function 2015-03-02 09:40:08 +01:00
Frederic Junod
3bfbd47fdb Add new ol.source.WMTS#getLayer api function 2015-03-02 09:40:08 +01:00
Éric Lemoine
4f5cc22ba0 Merge pull request #3281 from adube/fix-ie-mousemove-condition
Fix mouseMove event type comparison for IE10-11, pointermove
2015-03-02 09:15:15 +01:00
Andreas Hocevar
a7205d8aec Merge pull request #3293 from ahocevar/icon-opacity
Add missing opacity option for ol.style.IconOptions
2015-03-01 17:11:02 +01:00
Andreas Hocevar
6d0fb4d74e Add missing opacity option for ol.style.IconOptions 2015-03-01 12:07:19 +01:00
Alexandre Dubé
d1185da6b1 Replace mouseMove event condition by pointerMove
The original browser event was used to catch the mousemove event,
but in IE the 'pointermove' event is returned instead. So, instead
of using the original event, we use the map browser event, which
is always 'pointermove'.
2015-02-27 12:14:13 -05:00
Frédéric Junod
6c4b30fa02 Merge pull request #3284 from fredj/jsdoc
Fix jsdoc type for arrays of listening keys
2015-02-26 12:26:17 +01:00
Frederic Junod
e2f8c01c42 Fix jsdoc type for arrays of listening keys 2015-02-26 11:45:15 +01:00
Éric Lemoine
ad7616abb2 Merge pull request #3278 from elemoine/draweventtype
Add goog.provide for ol.DrawEventType
2015-02-26 10:46:12 +01:00
Éric Lemoine
56b08adef7 Add goog.provide for ol.DrawEventType 2015-02-25 21:59:57 +01:00
Éric Lemoine
70162d7889 Merge pull request #3272 from acanimal/3267
Added getter function to return the wrapped source within the cluster
2015-02-25 21:55:04 +01:00
Frédéric Junod
4c1be5967d Merge pull request #3275 from fredj/heatmap-properties
Add ol.layer.Heatmap#blur getter and setter
2015-02-25 17:29:48 +01:00
Frederic Junod
d12cdc336c Create the circle only when the blur and radius are set 2015-02-25 09:16:42 +01:00
Frederic Junod
232f4975c4 Add ol.layer.Heatmap#blur getter and setter 2015-02-25 08:57:04 +01:00
Éric Lemoine
45547eefbe Merge pull request #3142 from sarametz/wmts-getcap
WMTS Get Cap document with updated WMTS.optionsFromCapabilities function
2015-02-25 08:29:40 +01:00
acanimal
086202cfdd Added short description on getSource() method 2015-02-25 07:54:14 +01:00
Frédéric Junod
3079924a3d Merge pull request #3271 from fredj/jsdoc-fixes
[wip] Fix misplaced comment blocks
2015-02-25 07:13:19 +01:00
Tim Schaub
7e812959e7 Merge pull request #3273 from tschaub/unused-function
Remove unused createGetTileIfLoadedFunction function.
2015-02-24 15:35:38 -08:00
Tim Schaub
22aeb3612e Remove unused createGetTileIfLoadedFunction function 2015-02-24 15:06:10 -08:00
Sara Metz
6894bc8444 Add ability to get wmts source from capabilities
Added functionality to create a wmts tilegrid and wmts source from the
capabilities object created from ol.format.WMTSCapabilities.read().
Added tests for these functions and an example.

Also altered the REST url template replacement to be case insensitive
and added tests for this. This is because the spec uses both style
and Style and both of these are used by existing WMTS services.
2015-02-25 09:21:45 +13:00
Frederic Junod
1620a11181 Fix misplaced comment blocks
Found while testing the new google-closure release (v20150126)

The code still compiles with the older (default) version.
2015-02-24 17:13:35 +01:00
Éric Lemoine
18ec8a487f Merge pull request #3270 from elemoine/dragpan-false
Make ol.Overlay autoPan default to false
2015-02-24 15:42:57 +01:00
Éric Lemoine
329edc4ec6 Make ol.Overlay autoPan default to false 2015-02-24 15:14:10 +01:00
Tobias Sauerwein
7a5ad336c6 Merge pull request #3268 from tsauerwein/fix-example-autoPan
Fix autoPan in examples with ol.Overlay on hover
2015-02-24 09:48:22 +01:00
tsauerwein
054dc81485 Disable autoPan in examples
To avoid that the map is panned when showing
overlays on hover.
2015-02-24 09:33:40 +01:00
cwgrant
f63a856741 Add support for ArcGIS Rest Services
Adding a data source to support ArcGIS Map Server and Image Server.
Functionality is similar to the ArcGIS93Rest Layer in OpenLayers 2.
2015-02-23 22:49:29 -05:00
acanimal
eb8a1845a5 Added getter function to return the wrapped source withint the cluster 2015-02-23 22:07:35 +01:00
Tobias Sauerwein
5897cf55aa Merge pull request #3256 from tsauerwein/overlay-panIntoView
Add autoPan option to ol.Overlay
2015-02-23 17:23:00 +01:00
tsauerwein
e46e0f85fb Add autoPan option to ol.Overlay 2015-02-23 17:01:52 +01:00
Tobias Sauerwein
3fbc6fa361 Merge pull request #3261 from adube/fix-extent-foreachcorner
Fix forEachCorner extent, add TopLeft
2015-02-20 16:01:37 +01:00
Alexandre Dubé
e1336e1891 Fix forEachCorner extent, add TopLeft 2015-02-20 08:30:39 -05:00
Frédéric Junod
c30373963e Merge pull request #3260 from fredj/unused-require
Remove unused goog.require
2015-02-20 07:39:56 +01:00
Frederic Junod
96cb3d314f Remove unused goog.require 2015-02-20 07:32:55 +01:00
Tim Schaub
733167c612 Merge pull request #3246 from tschaub/tile-cache
Avoid creating unnecessary images in tile layers.
2015-02-19 10:33:31 -07:00
Frédéric Junod
84cc48a7bf Merge pull request #3254 from fredj/regular-stroke
Use lineCap, lineJoin and miterLimit stroke properties in RegularShape
2015-02-19 13:26:52 +01:00
Frederic Junod
c3d9946924 Use lineCap, lineJoin and miterLimit stroke properties 2015-02-19 12:33:16 +01:00
Frederic Junod
5e712ac88c Use correct renderOptions type 2015-02-19 12:12:00 +01:00
Tim Schaub
9e94308cdc Merge pull request #3252 from tschaub/global-spy
Avoid leaking global listenerSpy.
2015-02-19 00:09:59 -07:00
Tim Schaub
b8e3deb756 Merge pull request #3248 from tschaub/tile-events
Add tile loading events to image tile sources.
2015-02-18 16:16:24 -07:00
Tim Schaub
3e3104bbb1 Avoid leaking global listenerSpy 2015-02-18 16:05:33 -07:00
Tim Schaub
56c5cef3f8 Example style 2015-02-18 15:45:20 -07:00
Tim Schaub
199fcb05e3 Unregister image listeners when disposing of a tile 2015-02-18 15:45:14 -07:00
Christopher S. Case
15a4b7f4a6 Changed default radius to 0, instead of 1000.
(This was debugging code.)
2015-02-18 09:50:10 -06:00
Christopher S. Case
b2ce4c19e1 added unit tests. 2015-02-18 09:50:10 -06:00
Christopher S. Case
1074c9d44a Updated example for circle drawing. 2015-02-18 09:50:10 -06:00
Christopher S. Case
ae8321ab30 Added circle drawing to draw interaction. 2015-02-18 09:50:02 -06:00
Tim Schaub
c42af7919e Example docs 2015-02-17 11:22:44 -07:00
Tim Schaub
77d8d48b57 Progress bar for tile loading 2015-02-17 11:22:39 -07:00
Tim Schaub
5cbae8c8f5 Add tile loading events to image tile sources 2015-02-17 11:09:30 -07:00
Tim Schaub
bf35b40b11 Fire change event every time state changes 2015-02-17 11:09:16 -07:00
Tim Schaub
e5432f7cb5 Avoid creating unnecessary images during rendering 2015-02-16 15:11:16 -07:00
Tim Schaub
2cf1fe5552 Create tile cache for all tile sources 2015-02-16 12:22:15 -07:00
Tim Schaub
eb1a46cf7d Merge pull request #3240 from openlayers/v3.2.x
Changes from the v3.2.x branch.
2015-02-14 09:22:47 -07:00
Tim Schaub
d5f18dc120 Merge pull request #3239 from openlayers/release-v3.2.1
Release v3.2.1.
2015-02-13 11:12:45 -07:00
Tim Schaub
0ddae22661 Update package version to 3.2.1 2015-02-13 10:52:02 -07:00
Tim Schaub
fb2506672c Changelog for v3.2.1 2015-02-13 10:51:31 -07:00
Tim Schaub
391ff4eeab Merge pull request #3236 from tschaub/select-fix
Select the uppermost feature.
2015-02-13 09:29:20 -07:00
Frederic Junod
4686dfc0bb Select the uppermost feature 2015-02-13 09:12:26 -07:00
Tim Schaub
a924cc4d11 Merge pull request #3233 from stweil/master
Four small fixes.
2015-02-12 12:39:23 -07:00
Stefan Weil
5c99b6349c Add missing var declaration for local variable flippedFlatPoints
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Stefan Weil
829569c6b5 Fix typo in documentation of function getInfo
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Stefan Weil
e6d342dc96 Replace wrong comma in JavaScript code by semicolon
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Stefan Weil
8bfa1c45e7 examples: Remove wrong semicolon in css code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Tim Schaub
bfcceac68f Merge pull request #3232 from stweil/master
Fix typos found by codespell.
2015-02-12 09:02:03 -07:00
Stefan Weil
e812f2435e Fix typos found by codespell
Most of them are in comments, some in strings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 16:39:55 +01:00
Frédéric Junod
c4ddc62ab4 Merge pull request #3231 from fredj/heatmap-radius
Make ol.layer.Heatmap#radius configurable
2015-02-12 16:36:56 +01:00
Frederic Junod
f117550694 Add a radius input to the heatmap-earthquakes example 2015-02-12 14:41:22 +01:00
Frederic Junod
dfda3e37a4 Add ol.layer.Heatmap#radius getter and setter 2015-02-12 14:16:48 +01:00
Frederic Junod
b5206cb354 Make ol.layer.Heatmap.createCircle_ an instance function 2015-02-12 13:45:44 +01:00
Tim Schaub
90ba1140ac Merge pull request #3225 from tschaub/attributions
Respect attributions passed to TileJSON source.
2015-02-11 10:36:27 -07:00
Tim Schaub
9cea85be80 Merge pull request #3223 from tschaub/tilesize-change
Resize the canvas when the tile size changes.
2015-02-11 10:18:27 -07:00
Tim Schaub
e79211e0c1 Respect attributions passed to TileJSON source 2015-02-11 10:15:29 -07:00
Bart van den Eijnden
ad23a9c9cd Merge pull request #3224 from bartvde/mapquest-getname
Provide the ability to get the layer name from a MapQuest source
2015-02-11 15:56:50 +01:00
Bart van den Eijnden
eafa5419c3 Provide the ability to get the layer name from a MapQuest source 2015-02-11 15:46:02 +01:00
Bart van den Eijnden
b529f0f0a0 Merge pull request #3222 from bartvde/geodesic-measure
Add geodesic option for measure
2015-02-11 13:34:32 +01:00
Bart van den Eijnden
c5c24f209a Add geodesic option for measure 2015-02-11 13:24:23 +01:00
bill-chadwick
0381689fb6 Resize the canvas when the tile size changes 2015-02-10 14:00:23 -07:00
Frédéric Junod
89954ca5fc Merge pull request #3221 from fredj/hectic-select
Select the uppermost feature
2015-02-10 14:03:18 +01:00
Frederic Junod
13f265b4e1 Select the uppermost feature 2015-02-10 09:59:09 +01:00
Tim Schaub
776ffa925f Merge pull request #3211 from photostu/master
Bing https logo fix.
2015-02-08 20:18:19 -07:00
Tim Schaub
ada6b5640a Merge pull request #3215 from tschaub/rendering
Allow reuse of layer rendering code without creating a map.
2015-02-08 17:24:16 -07:00
Tim Schaub
33c197cf16 Layer renderers should not require a map renderer 2015-02-08 07:25:10 -07:00
Tim Schaub
e0f250483d Layer renderers don't need access to the map 2015-02-07 16:56:10 -07:00
Tim Schaub
c4ee8518e1 Use frame state for size 2015-02-07 16:52:48 -07:00
Tim Schaub
d4b7bb7c57 Use frame state for pixel to coord conversion 2015-02-07 16:52:34 -07:00
Tim Schaub
a460cb3983 Fire change instead of calling render on map 2015-02-07 16:46:30 -07:00
Tim Schaub
7f18033171 Make layer renderers observable and re-render on change 2015-02-07 16:42:36 -07:00
Tim Schaub
693ec7706e createLayerRenderer must be implemented by subclass 2015-02-07 16:30:28 -07:00
Tim Schaub
9081682286 Use provided frame state instead of map for pixel to coord conversion 2015-02-07 16:12:39 -07:00
Éric Lemoine
e97f017dda Merge pull request #3213 from openlayers/release-v3.2.0
Release v3.2.0
2015-02-06 11:14:26 +01:00
Éric Lemoine
22b27cdb02 Update package version to 3.2.0 2015-02-06 11:12:59 +01:00
Éric Lemoine
480c276d93 Changelog for v3.2.0 2015-02-06 11:12:59 +01:00
photostu
9247dc9f41 bing logo https
fix syntax to please Travis
2015-02-05 11:21:13 -05:00
Éric Lemoine
480f352cc6 Merge pull request #3171 from oterral/kml_link
KML: Parsing of NetworkLink tag
2015-02-05 16:41:36 +01:00
photostu
4080e729df bing https logo fix
If https is missing from bing logo uri, replace
2015-02-05 10:34:33 -05:00
oterral
c1fd95305c Add tests for parsing of NetworkLink tags 2015-02-05 16:21:51 +01:00
oterral
0a6a3f5d65 Add parsing of NetworkLink tag 2015-02-05 16:21:45 +01:00
Frédéric Junod
456def67de Merge pull request #3209 from fredj/coding-style
Coding style fixes
2015-02-05 14:53:59 +01:00
Bart van den Eijnden
f9a8239443 Merge pull request #3208 from bartvde/setImageLoadFunction
Add setters and getters for imageLoadFunction
2015-02-05 12:37:02 +01:00
Frederic Junod
a0a4369c24 Fix ol.format.GPX.TRKSEG_NODE_FACTORY_ type definition 2015-02-05 10:56:44 +01:00
Frederic Junod
078d3fb007 Add missing goog.require 2015-02-05 10:56:44 +01:00
Frederic Junod
65c2f7de5f Remove unused goog.require 2015-02-05 10:56:44 +01:00
Frederic Junod
8ec90a2045 Remove unnecessary newlines 2015-02-05 10:56:44 +01:00
Frédéric Junod
0906bf09ed Merge pull request #3019 from bjornharrtell/selectmulti
Add option to allow Select interaction logic to select overlapping features
2015-02-05 10:55:04 +01:00
Bart van den Eijnden
ce8d57b534 Add setters and getters for imageLoadFunction 2015-02-05 10:53:21 +01:00
Pierre GIRAUD
b8a0d6b702 Merge pull request #3206 from pgiraud/measure_tooltip
Add tooltip to show measure + help message while drawing
2015-02-05 09:48:32 +01:00
Pierre GIRAUD
4ba500925f Changing draw interaction styling 2015-02-05 09:39:17 +01:00
Pierre GIRAUD
c63c358d08 Add tooltip to show measure + help message while drawing 2015-02-04 17:48:28 +01:00
Björn Harrtell
162c47eb3e Option to enable selection of overlapping features 2015-02-04 16:15:41 +01:00
Frédéric Junod
f117cddb34 Merge pull request #3205 from fredj/use-ol.extent.createOrUpdateFromCoordinate
Use ol.extent.createOrUpdateFromCoordinate
2015-02-04 14:55:49 +01:00
Frederic Junod
f6b47f086b Use ol.extent.createOrUpdateFromCoordinate
Instead of ol.extent.boundingExtent
2015-02-04 14:14:50 +01:00
Éric Lemoine
2d3e5d2bac Merge pull request #3026 from htulipe/wmts-getcap
Add support of reading WMTS Get Cap document
2015-02-04 13:32:32 +01:00
Bart van den Eijnden
8f6cb00ea6 Merge pull request #3201 from bartvde/fast_clear
Pass on opt_fast to parent clear function in ol.source.ServerVector (r=@elemoine,@gberaudo)
2015-02-04 08:53:51 +01:00
Bart van den Eijnden
80f7b726f9 Pass on opt_fast to parent clear function in ol.source.ServerVector 2015-02-04 08:45:09 +01:00
Frédéric Junod
f75cec5c8e Merge pull request #3199 from fredj/jsdoc-fixes
Minor jsdoc fixes
2015-02-03 16:14:39 +01:00
Frederic Junod
89f21f5d50 Remove square brackets from type 2015-02-03 15:52:19 +01:00
Frederic Junod
f9723aa310 Add missing goog.require 2015-02-03 15:52:19 +01:00
Hadrien Tulipe
87644a1a46 Add support of WMTS Get Cap read
This commit fixe #2721. It still lacks the possibility to create layer from the GetCap document. It also lacks the reading of TMS limits.
2015-02-03 14:46:29 +01:00
Frédéric Junod
38c80e7f9b Merge pull request #3059 from fredj/memory
Cache the buffered extent value
2015-02-03 13:39:39 +01:00
Frederic Junod
0d3eb8642f Cache the buffered extent value
Assuming that the maxExtent and resolution property are immutable
2015-02-03 10:37:38 +01:00
Frédéric Junod
a7fcf05a4b Merge pull request #3196 from fredj/coding-style
Remove unnecessary newlines
2015-02-02 16:47:53 +01:00
Frederic Junod
31f61121d9 Remove unnecessary newlines 2015-02-02 14:38:39 +01:00
Bart van den Eijnden
b8d44e7f91 Merge pull request #3099 from bartvde/ogr-gml2
Fix up parsing of OGR GML with ol.format.GML
2015-02-02 13:16:12 +01:00
Bart van den Eijnden
423c8761aa Use ol.format.GMLBase.GMLNS and get rid of unneeded Object 2015-02-02 12:46:49 +01:00
Frédéric Junod
ef871f54f8 Merge pull request #3195 from fredj/coding-style
Coding style
2015-02-02 09:59:00 +01:00
Éric Lemoine
898c8fa9a2 Merge pull request #3192 from elemoine/mapquest-url
Add "url" option to ol.source.MapQuest
2015-02-02 09:26:08 +01:00
Tobias Sauerwein
350ce735f1 Merge pull request #3172 from tsauerwein/forEachLayerAtPixel
Introduce forEachLayerAtPixel
2015-02-02 09:24:43 +01:00
Frederic Junod
0f65d7778a Remove unnecessary newlines 2015-02-02 09:11:35 +01:00
Frederic Junod
12925a35b9 Use goog.isDef to check the opt_array param 2015-02-02 09:11:35 +01:00
Frédéric Junod
df32d04fdb Merge pull request #3178 from fredj/geojson-externs
GeoJSON externs fixes
2015-02-02 09:11:08 +01:00
Frédéric Junod
987b032d9d Merge pull request #3179 from fredj/disallow-undefined
Disallow undefined values for ol.layer.Base
2015-02-02 09:10:36 +01:00
Bart van den Eijnden
5d70e61753 Make FEATURE_COLLECTION_PARSERS an instance property 2015-01-30 21:00:04 +01:00
Éric Lemoine
130535c83e Merge pull request #3161 from 3x0dv5/master
Doc fix. writeFeaturesNode receives an array of Feature
2015-01-30 17:46:23 +01:00
Éric Lemoine
fcbdc6bd26 Merge pull request #3169 from oterral/kml_example
Fix default icon style in kml format
2015-01-30 17:45:31 +01:00
Éric Lemoine
df2d71ef83 Add "url" option to ol.source.MapQuest 2015-01-30 17:08:50 +01:00
tsauerwein
b390c1bdf8 Use dragging flag in examples 2015-01-30 13:53:32 +01:00
tsauerwein
f4500c8f89 Rename *AtPixel to *AtCoordinate if coordinate 2015-01-30 10:00:37 +01:00
tsauerwein
4d4bed454a Avoid pixel->coord->pixel conversion 2015-01-30 10:00:37 +01:00
tsauerwein
054227fd26 Make signature for *AtPixel methods more consistent
pixel/coordinate is the first argument.
2015-01-30 10:00:36 +01:00
tsauerwein
b7415219a6 Use forEachLayerAtPx in example 2015-01-30 10:00:36 +01:00
tsauerwein
dce4210a5b Implement forEachLayerAtPixel for webgl 2015-01-30 10:00:36 +01:00
tsauerwein
6cc5bd466d Add hasFeatureAtPixel for ImageLayer 2015-01-30 10:00:36 +01:00
tsauerwein
b4cb786f29 Implement forEachLayerAtPixel for canvas 2015-01-30 10:00:36 +01:00
tsauerwein
225f0739ec Add forEachLayerAtPixel 2015-01-30 10:00:36 +01:00
tsauerwein
7feb8b22f6 Rename forEachGeometryAtPixel 2015-01-30 10:00:36 +01:00
Tobias Sauerwein
9e7e5efd27 Merge pull request #3190 from tsauerwein/event-dragging
Introduce `dragging` flag for MapBrowserEvent
2015-01-30 09:54:52 +01:00
tsauerwein
9a841583db Remove getter for down_ 2015-01-30 09:38:47 +01:00
tsauerwein
9cc8390dfd Use dragging in examples 2015-01-30 09:16:19 +01:00
tsauerwein
f2518e4c08 Add dragging flag to MapBrowserEvent 2015-01-30 09:15:35 +01:00
Tobias Sauerwein
aa67078d74 Merge pull request #3135 from tsauerwein/control-label
Make changing the label of ZoomToExtent/FullScreen control consistent
2015-01-29 15:03:53 +01:00
Bart van den Eijnden
0243ce6612 Fix up parsing of OGR GML with ol.format.GML 2015-01-29 11:40:30 +01:00
Frédéric Junod
3abcbcf377 Merge pull request #3186 from fredj/clip-pixel-ratio
Take the pixel ratio into account when clipping the layer
2015-01-28 21:29:48 +01:00
Éric Lemoine
5c9e099628 Merge pull request #3183 from htulipe/switch-mode-fix
Allow other params than 'mode' in example page query string.
2015-01-28 16:03:25 +01:00
Frederic Junod
cb69cecf03 Take the pixel ratio into account when clipping the layer 2015-01-28 14:21:50 +01:00
Frédéric Junod
2ad93b9e86 Merge pull request #2791 from fredj/rotate-css-transition
Re enable rotation button transition
2015-01-28 09:18:50 +01:00
Frederic Junod
aa23a7bce5 Re enable rotation button transition
The opacity transition was broken with #2782
2015-01-28 09:09:01 +01:00
htulipe
f0608f6fed Allow other params than 'mode' in example query string.
Currently, if other params are present at the beginning of the query string,
the mode switcher will not work.

This situation can occur when a search criteria was entered in the examples
index page. That criteria will be passed along to the example page via a query
param.
2015-01-27 21:52:38 +01:00
Bart van den Eijnden
798399101f Merge pull request #3180 from bartvde/featureoverlay-getmap
Add a getMap function to ol.FeatureOverlay (r=@ahocevar)
2015-01-27 20:07:25 +01:00
Bart van den Eijnden
bc5f81cfa0 Add a getMap function to ol.FeatureOverlay 2015-01-27 19:54:34 +01:00
Frederic Junod
fc3c808209 Disallowed undefined 'minResolution' value 2015-01-27 18:07:42 +01:00
Frederic Junod
1d6f7e9504 Disallowed undefined 'maxResolution' value 2015-01-27 18:07:42 +01:00
Frederic Junod
60ea87fdfb Disallowed undefined 'saturation' value 2015-01-27 18:07:42 +01:00
Frederic Junod
caa8428990 Disallowed undefined 'contrast' value 2015-01-27 18:07:42 +01:00
Frederic Junod
007ad2c58f Disallowed undefined 'brightness' value 2015-01-27 18:07:42 +01:00
Frederic Junod
663f18cd29 Disallowed undefined 'opacity' value 2015-01-27 18:07:42 +01:00
Frederic Junod
e25cb30e5f Disallowed undefined 'hue' value 2015-01-27 18:07:42 +01:00
Frederic Junod
c7dbd4a303 Disallowed undefined 'visible' value 2015-01-27 18:07:42 +01:00
Frédéric Junod
43f84e798f Merge pull request #3176 from fredj/undefined-rotation
Disallowed undefined rotation value
2015-01-27 17:11:26 +01:00
Frederic Junod
d640accdc8 More precise ol.format.GeoJSON.readGeometry_ param type 2015-01-27 12:21:11 +01:00
Frederic Junod
f1c0072bd0 More precise olx.source.GeoJSONOptions#object type 2015-01-27 12:06:03 +01:00
Frederic Junod
d219a8ef22 Remove GeoJSONObject extends from GeoJSONLink
Otherwise CRS object may have a `boox` or a `crs` property
2015-01-27 11:30:24 +01:00
Frederic Junod
3fbe9265da Remove GeoJSONObject extends from GeoJSONCRS
Otherwise CRS object may have a `boox` or a `crs` property
2015-01-27 11:26:06 +01:00
Frederic Junod
ad65989d28 Move bbox property to GeoJSONObject
See http://geojson.org/geojson-spec.html#geojson-objects:
"A GeoJSON object may have a "bbox" member [...]"
2015-01-27 11:18:13 +01:00
Tobias Sauerwein
9d5f7c1eb4 Merge pull request #3177 from tsauerwein/style-polygons
Add example showing how to style polygon vertices
2015-01-27 10:18:55 +01:00
tsauerwein
48cf51a7ca Add example for polygon vertices styling 2015-01-27 10:02:28 +01:00
Frederic Junod
829a0ca224 Disallowed undefined rotation value 2015-01-27 09:26:51 +01:00
Frédéric Junod
5c9b17a3b2 Merge pull request #3174 from fredj/view-getState
Use view.getRotation or view.getResolution instead of view.getState
2015-01-26 17:14:38 +01:00
Frederic Junod
915df000ab Use view.getRotation instead of view.getState 2015-01-26 13:39:49 +01:00
Frederic Junod
247d8668d1 Use view.getResolution instead of view.getState 2015-01-26 13:39:49 +01:00
Frederic Junod
7c7a4c2b7a Use view.getRotation instead of view.getState 2015-01-26 13:39:49 +01:00
Frédéric Junod
8e161a077f Merge pull request #3170 from fredj/coding-style
Coding style
2015-01-26 13:39:02 +01:00
Frederic Junod
7885ad6ae7 Remove unnecessary newlines 2015-01-26 10:33:00 +01:00
Frederic Junod
98f7b5f186 Mark projection property as constant 2015-01-26 10:20:21 +01:00
Frederic Junod
72b2182219 Add missing projection property in olx.ViewState 2015-01-26 09:51:53 +01:00
Frederic Junod
eb7041c71d Simplify ternary operator condition 2015-01-26 09:51:53 +01:00
oterral
65fe82d188 Fix default icon style in kml format 2015-01-26 09:46:48 +01:00
Tobias Sauerwein
90a5997c22 Merge pull request #3108 from tsauerwein/webgl-point-skipFeatures
Support skipping features in the WebGL renderer
2015-01-23 08:56:39 +01:00
Frédéric Junod
fd5a3ce7b4 Merge pull request #3163 from fredj/webglmaprenderer-layerStatesArray
Use the layerStatesArray property from the frameState
2015-01-23 07:27:38 +01:00
Frederic Junod
948a1f1321 Use the layerStatesArray property from the frameState 2015-01-22 17:36:26 +01:00
Frédéric Junod
edc6746545 Merge pull request #3159 from fredj/heatmap-constr
Don't pass specific options to the parent constructor
2015-01-22 14:55:55 +01:00
3x0dv5
6ceef2b0cc Doc fix. writeFeaturesNode receives an array of Feature 2015-01-22 11:21:02 +00:00
Frederic Junod
f3bafab1e6 Don't pass specific options to the parent constructor 2015-01-22 11:30:20 +01:00
tsauerwein
316480dcda Rename argument 2015-01-22 10:24:59 +01:00
tsauerwein
a39544cce0 Implement skipping features for hasFeatureAtPixel 2015-01-22 10:24:59 +01:00
tsauerwein
cf9619f378 Implement skipping features for 1by1 hit detection 2015-01-22 10:24:59 +01:00
tsauerwein
c4ee074274 Implement skipping features for drawReplay 2015-01-22 10:24:59 +01:00
Tobias Sauerwein
1702a4ed36 Merge pull request #3066 from tsauerwein/webgl-point-hasFeatureAtPixel
Introduce hasFeatureAtPixel
2015-01-22 10:20:00 +01:00
Tobias Sauerwein
53f98dcf4e Merge pull request #3065 from tsauerwein/webgl-point-hit-detection
Add hit-detection support for WebGL
2015-01-22 10:19:37 +01:00
Éric Lemoine
f625a29978 Merge pull request #3128 from oterral/kml_default_style
Allow rendering of feature when download of icon failed
2015-01-21 15:08:02 +01:00
Éric Lemoine
21144f161a Add more tests fr ol.renderer.vector 2015-01-21 14:50:48 +01:00
Frédéric Junod
b6a550f354 Merge pull request #3156 from fredj/format-getprojection
Move readProjectionFrom* functions to the base classes
2015-01-21 13:30:47 +01:00
Éric Lemoine
b27c1c82d4 Merge pull request #3107 from elemoine/imagestate
Also listen on loading images
2015-01-21 12:50:31 +01:00
Frederic Junod
077a827197 Move readProjectionFrom* functions to the base classes 2015-01-21 09:15:04 +01:00
Frédéric Junod
2970da3461 Merge pull request #3153 from fredj/geojson-externs
Add missing GeoJSONFeature#bbox property
2015-01-21 07:34:10 +01:00
Frédéric Junod
165e3fe1ff Merge pull request #3154 from fredj/coding-style
Remove unnecessary newlines
2015-01-20 17:43:51 +01:00
Frederic Junod
b53a5e28d5 Remove unnecessary newlines 2015-01-20 16:48:52 +01:00
Frederic Junod
d8984ca1aa Add missing GeoJSONFeature#bbox property
See http://geojson.org/geojson-spec.html#bounding-boxes
2015-01-20 15:17:29 +01:00
Éric Lemoine
c185bf8f30 Merge pull request #3146 from icholy/enable-reversflatgeom-tests
Enable tests for ol.geom.flat.reverse
2015-01-19 21:01:13 +01:00
Frédéric Junod
8bc72c62f6 Merge pull request #3152 from fredj/update
Update closure-library and closure-util version
2015-01-19 17:36:27 +01:00
Frederic Junod
a17bc916b1 Update closure-library version 2015-01-19 10:42:34 +01:00
Frederic Junod
c732538433 Update closure-util version 2015-01-19 10:42:33 +01:00
Ilia Choly
ee9cfef35a Enable reverseflatgeom tests 2015-01-16 13:40:47 -05:00
Éric Lemoine
970beb1741 Merge pull request #3145 from elemoine/wrapx
Add wrapX option to source.OSM and source.BingMaps
2015-01-16 17:40:13 +01:00
Éric Lemoine
11eeb6617c Add wrapX option to olx.source.BingMapsOptions 2015-01-16 17:15:59 +01:00
Éric Lemoine
d13a5dfb9f Add wrapX option to olx.source.OSMOptions 2015-01-16 17:12:00 +01:00
Éric Lemoine
4b3726fe71 Merge pull request #3139 from elemoine/control-setmap
Add ol.control.Control#setTarget
2015-01-16 11:16:30 +01:00
Bart van den Eijnden
12f3a9d454 Merge pull request #3144 from bartvde/code-guidelines
Update CONTRIBUTING style guide with recent guidelines
2015-01-16 10:57:35 +01:00
Bart van den Eijnden
4f4d12024b Update CONTRIBUTING style guide with recent guidelines 2015-01-16 10:49:44 +01:00
tsauerwein
fbb2883f6e Add Node to control label type 2015-01-16 10:14:39 +01:00
Éric Lemoine
79312c2083 Add ol.control.Control#setTarget
This commit adds a setTarget method to ol.control.Control. This function can be used in cases where the target cannot be set at control construction time. For example, with Angular, it makes sense to create the control instance in an Angular controller, and have a "control" directive insert the control into the DOM.
2015-01-16 09:27:30 +01:00
tsauerwein
7679069520 Add label option to FullScreen control 2015-01-16 09:05:51 +01:00
Frédéric Junod
1033171ff0 Merge pull request #3136 from fredj/coding-style
Use array.length = 0 instead of goog.array.clear
2015-01-16 08:08:27 +01:00
Tim Schaub
10c715ad9a Merge pull request #3140 from tschaub/array
Avoid use of goog.array.clone with arrays.
2015-01-15 13:00:02 -07:00
Tim Schaub
06dc0902c6 Avoid use of goog.array.clone with arrays 2015-01-15 12:43:12 -07:00
Frederic Junod
845957a27f Use array.length = 0 instead of goog.array.clear 2015-01-15 16:11:29 +01:00
Frédéric Junod
c23ae78978 Merge pull request #3122 from fredj/revert-2975
Revert "Use offsetX and offsetY if available"
2015-01-15 10:52:03 +01:00
tsauerwein
0d26a9aa87 Add label option to ZoomToExtent 2015-01-15 09:58:05 +01:00
Frederic Junod
0bae04331d Revert "Use offsetX and offsetY if available"
This reverts commit fabf05977a.
2015-01-15 08:56:55 +01:00
Andreas Hocevar
c726cbfcd9 Merge pull request #2385 from ahocevar/update-vectors-while-animating
Option to update vector layers while animating
2015-01-14 17:34:39 +01:00
Andreas Hocevar
b1a73da9dd Add updateWhileAnimating option
With this option, vector batches will be recreated with every frame.
For animations, this means that vector data won't be clipped to the
extent at which the animation started.
2015-01-14 16:33:05 +01:00
Frédéric Junod
dafcdfa494 Merge pull request #3129 from fredj/rbush-update
Only update the rbush item if the extent has changed
2015-01-14 13:53:41 +01:00
Frederic Junod
baf424f99c Only update the rbush item if the extent has changed 2015-01-14 13:29:28 +01:00
Andreas Hocevar
017ff47bf8 Merge pull request #3117 from ahocevar/domvector-pixelratio
Add pixelRatio support for DOM vector renderer
2015-01-14 12:55:05 +01:00
Tobias Sauerwein
110ed04a84 Merge pull request #3124 from sirtet/master
Add a space between scale -value and -unit
2015-01-14 12:41:01 +01:00
Frédéric Junod
2f5bbb37ed Merge pull request #3130 from fredj/doc
Document default value
2015-01-14 12:39:15 +01:00
Frédéric Junod
68f5ff0045 Merge pull request #3105 from fredj/geom-getextent
ol.geom.Geometry#getExtent re-factoring
2015-01-14 12:20:37 +01:00
Frederic Junod
5f55e01849 Document default value 2015-01-14 12:12:38 +01:00
Frederic Junod
f7943b9401 Set extent and extentRevision variables to private 2015-01-14 11:01:18 +01:00
Frederic Junod
8bd0a1232a Add geom.ol.geom.Geometry#computeExtent function 2015-01-14 11:01:18 +01:00
oterral
c97a29d13b Allow rendering of feature when download of icon failed 2015-01-14 09:34:03 +01:00
sirtet
66fea4dec9 Add a space between scale -value and -unit
For improved readability. Issue #3116
2015-01-13 16:16:20 +01:00
Bart van den Eijnden
35468e2bbb Merge pull request #3118 from naturalatlas/wfs-firstelementchild-bugfix
Bugfix: "Cannot read property 'firstElementChild' of null" (WFS)
2015-01-13 10:13:56 +01:00
Brian Reavis
37dac8e0cf Fixed "Cannot read property 'firstElementChild' of null" on WFS readProjectionFromNode.
Occurs when a FeatureCollection is empty.

Code style changes @bartvde

Added test case for #3118.

Attempt to make jshint happy.

Fixed tab character.

Another code style change (jshint)....
2015-01-13 01:42:03 -07:00
Andreas Hocevar
bbf074b70a Add pixelRatio support for DOM vector renderer
Adds the scaling and transforms to support pixelRatio values other than
1.
2015-01-12 22:14:52 +01:00
Éric Lemoine
5dca3e9b20 Merge pull request #3114 from elemoine/contributing
Specify node version in CONTRIBUTING.md
2015-01-12 21:13:16 +01:00
Éric Lemoine
789ddad536 Specify node version 2015-01-12 20:49:23 +01:00
Frédéric Junod
409969fa2a Merge pull request #3106 from fredj/tilelayer-constr
Don't pass specific options to the parent constructor
2015-01-12 15:31:36 +01:00
Éric Lemoine
76418bdbe5 Merge pull request #3110 from PeterDaveHello/patch-1
Use svg instead of png to get better image quality
2015-01-11 11:22:56 +01:00
Peter Dave Hello
3e2574bf49 Use svg instead of png to get better image quality 2015-01-11 14:33:36 +08:00
Éric Lemoine
12863cf3fd Merge pull request #2707 from gberaudo/source_map
Generate source map of minified ol.js
2015-01-09 13:16:18 +01:00
Éric Lemoine
2ef8302122 Add a build/ol.js.map target 2015-01-09 12:33:38 +01:00
Guillaume Beraudo
132686b4a7 Generate source map of minified ol.js
Allows automatic unminification by the browser.

A postprocessing is required to:
- fix the paths to the sources;
- add the link from the minified script to its map.

If someone knows how to do the first item in Python or nodejs, please provide a
patch. A simple shell script is:
```
\#!/bin/sh
pwd=`pwd`
sed -i "s!$pwd/build!olsource!g" 'build/ol.js.map'
sed -i "s!$pwd!olsource!g" 'build/ol.js.map'
```

The second item should always be manually handled to avoid 404 errors
in debuggers
`echo '//# sourceMappingURL=ol.js.map' >> build/ol.js`

Finally, create an alias / copy ol3 directory to /olsource in your
deployed environment.
2015-01-09 12:17:35 +01:00
Éric Lemoine
0f486e86f7 Add tests for ol.renderer.Layer#loadImage 2015-01-09 09:45:25 +01:00
tsauerwein
c85982bbe5 Remove unused variables 2015-01-09 09:21:40 +01:00
Éric Lemoine
4814983306 Also listen on loading images
This fixes a bug that occured when an image source was used by multiple maps. In that case the map that didn't load the image wouldn't register a load listener on that image and would therefore not call render to request a re-render of the map.
2015-01-09 09:07:31 +01:00
tsauerwein
d39904b66b Add @const annotation 2015-01-08 16:12:52 +01:00
tsauerwein
25612f1af2 Unify return statement
Only return the callback result if it is truthy,
otherwise return undefined.
2015-01-08 16:12:52 +01:00
tsauerwein
35c58b3b0e Use hasFeatureAtPixel in icon example 2015-01-08 16:12:52 +01:00
tsauerwein
3e5c4d0bf6 Show hasFeatureAtPixel in example 2015-01-08 16:12:52 +01:00
tsauerwein
bc71a36292 Implement hasFeatureAtPixel for webgl 2015-01-08 16:12:52 +01:00
tsauerwein
d62e910239 Implement hasFeatureAtPixel for canvas 2015-01-08 16:12:52 +01:00
tsauerwein
d0691ecc4d Add hasFeatureAtPixel function to map 2015-01-08 16:12:52 +01:00
tsauerwein
974823dbd4 Refactor createTexture 2015-01-08 15:40:03 +01:00
tsauerwein
38322d615b Use renderBuffer for hit-detection 2015-01-08 15:38:00 +01:00
tsauerwein
060c9f3bc6 Reduce number of arrays created 2015-01-08 15:38:00 +01:00
tsauerwein
6c48b2067b Make icon example work with webgl 2015-01-08 15:38:00 +01:00
tsauerwein
da7f38635b Remove hitDetectionOrigin 2015-01-08 15:38:00 +01:00
tsauerwein
461ec1d3bc Make sure hit-detection atlas is in sync
... with the atlas for the original images, so that
the offsets are the same.
2015-01-08 15:38:00 +01:00
tsauerwein
cf6dd38866 Use hit-detection images 2015-01-08 15:38:00 +01:00
tsauerwein
3ef61fa1c5 Add hit-detection support for webgl 2015-01-08 15:38:00 +01:00
tsauerwein
740420468e Add hit-detection framebuffer to context 2015-01-08 15:38:00 +01:00
Frederic Junod
b827bc126c Don't pass specific options to the parent constructor 2015-01-08 14:07:33 +01:00
Frédéric Junod
1f90aad4ad Merge pull request #3104 from fredj/vector-constr
Don't pass renderBuffer option to the parent constructor
2015-01-08 11:58:39 +01:00
Frederic Junod
91d2b3b87f Don't pass renderBuffer option to the parent constructor 2015-01-08 10:59:42 +01:00
Frédéric Junod
904fac082c Merge pull request #3096 from fredj/example-cleanup
popup example cleanup / simplification
2015-01-08 09:07:25 +01:00
Tim Schaub
b952f118ba Merge pull request #3072 from tschaub/hit-extent
Optimize canvas hit detection by rendering features in a limited extent.
2015-01-07 23:54:21 -07:00
Tim Schaub
1ee03625e9 Optimize hit detection by rendering features in a limited extent 2015-01-07 23:04:42 -07:00
Tim Schaub
3be6a84de6 Merge pull request #3101 from tschaub/object
Use bracket notation instead of goog.object functions.
2015-01-07 22:57:28 -07:00
Tim Schaub
1ff43686f5 Use bracket notation instead of goog.object.get 2015-01-07 22:31:01 -07:00
Tim Schaub
a09a76c766 Merge pull request #3079 from tschaub/sourceless-docs
Exclude source files from docs.
2015-01-07 22:20:57 -07:00
Tim Schaub
f9a92c422c Use bracket notation instead of goog.object.set 2015-01-07 21:08:24 -07:00
Tim Schaub
0a784bfc3b Allow bracket notation
We use bracket notation with string literals instead of dot notation where we don't want the compiler to do any renaming.
2015-01-07 21:06:04 -07:00
Frédéric Junod
d35ea9e4f4 Merge pull request #3100 from fredj/tilelayer-attr
Assert that ol.layer.Tile#getPreload is always set
2015-01-07 17:54:10 +01:00
Frederic Junod
55dda99cfe Assert that ol.layer.Tile#getUseInterimTilesOnError is always set 2015-01-07 16:59:44 +01:00
Frederic Junod
df51e55781 Assert that ol.layer.Tile#getPreload is always set 2015-01-07 16:48:15 +01:00
Frederic Junod
a753135e84 Remove moz-box-shadow CSS rule
Gecko 13 (Firefox 13) removed support for -moz-box-shadow. Since then,
only the unprefixed version is supported.
2015-01-06 09:26:00 +01:00
Frederic Junod
d4ff5527c9 Set the position to undefined to hide the overlay 2015-01-06 09:26:00 +01:00
Tim Schaub
06fe8288ce Merge pull request #3084 from openlayers/v3.1.x
Changes from the v3.1.x branch.
2015-01-05 10:22:14 -07:00
Tim Schaub
8e982b0763 Merge pull request #3094 from tschaub/authorless
Remove AUTHORS.md.
2015-01-04 13:00:14 -07:00
Tim Schaub
38b890a69a Removing AUTHORS.md
This was a partial, unmaintained list of the project contributors.  For a complete list of contributors, see the Git log.  E.g.

    git shortlog -s | cut -c8-
2015-01-03 22:58:06 -07:00
Bart van den Eijnden
8eb6814e4b Merge pull request #3089 from mike-mcgann/fix_test_readme_url
Fixed URL link for test README
2014-12-29 17:13:02 +01:00
Mike McGann
6b162f813f Fixed URL link for test README 2014-12-29 10:15:34 -05:00
Frédéric Junod
9a4c56d216 Merge pull request #2894 from fredj/simplify-custom-controls
Simplify CSS code in custom-controls example
2014-12-27 11:46:35 +01:00
Tim Schaub
5d2f4630f5 Merge pull request #3085 from mike-mcgann/doc-typo
Fixed documentation typo for return value of ol.proj.Projection.isGlobal().
2014-12-23 16:08:24 -05:00
Mike McGann
cc4a690676 Fixed documentation typo for return value of ol.proj.Projection.isGlobal() 2014-12-23 15:38:49 -05:00
Tim Schaub
68438c7c10 Merge pull request #3083 from tschaub/release-v3.1.1
Release v3.1.1.
2014-12-23 13:40:30 -05:00
Tim Schaub
7dd322dd6f Update package version to 3.1.1 2014-12-23 11:29:04 -05:00
Tim Schaub
676476ec64 Changelog for v3.1.1 2014-12-23 11:28:48 -05:00
Tim Schaub
8f8b7e1f17 Merge pull request #3082 from tschaub/issue-3081
Correct arguments for forEachGeometryAtPixel.
2014-12-23 11:23:01 -05:00
Tim Schaub
e62c333f32 Correct arguments for forEachGeometryAtPixel 2014-12-23 11:10:04 -05:00
Andreas Hocevar
97afb31a65 Merge pull request #3073 from ahocevar/load-tile-options
Make map's deviceOptions map options
2014-12-23 16:11:22 +01:00
Tim Schaub
4b423fca16 Exclude source files from docs 2014-12-22 17:01:01 -05:00
Tim Schaub
78ac65e57d Merge pull request #3077 from tschaub/release-v3.1.0
Release v3.1.0.
2014-12-22 15:27:31 -05:00
Tim Schaub
a796542223 Summarize changes and add upgrade notes 2014-12-22 15:17:05 -05:00
Tim Schaub
dc7f60801a Update package version to 3.1.0 2014-12-22 14:32:35 -05:00
Tim Schaub
9b55d20f90 Changelog for v3.1.0 2014-12-22 14:32:11 -05:00
Tim Schaub
d8a845de39 Merge pull request #3076 from tschaub/changelog
Add script to standardize changelog ceation.
2014-12-22 14:07:58 -05:00
Tim Schaub
ffea25fd6f Merge pull request #3074 from fredj/misplaced-function-annotation
Remove misplaced function annotation.
2014-12-22 13:30:44 -05:00
Bart van den Eijnden
aee37c4f90 Merge pull request #3075 from bartvde/remove-projlike-undefined
Remove unneeded undefined from ol.proj.ProjectionLike definitions (r=@tschaub)
2014-12-22 19:10:20 +01:00
Tim Schaub
62854f6e32 Add script to standardize changelog ceation 2014-12-22 13:02:27 -05:00
Bart van den Eijnden
ab76c2cae3 Remove unneeded undefined from ol.proj.ProjectionLike definitions 2014-12-22 18:28:04 +01:00
Frederic Junod
eabb795624 Remove misplaced function annotation 2014-12-22 11:12:01 +01:00
Andreas Hocevar
38b12d3149 Make map's deviceOptions map options
This removes the map's deviceOptions config option, and instead
introduces loadTilesWhileAnimating and loadTilesWhileInteracting map
options. By default, both are false now, to make zooming and panning
smoother on most devices.
2014-12-21 12:03:28 +01:00
Tim Schaub
0ae00fb277 Merge pull request #3071 from tschaub/publish
Add task for publishing to npm.
2014-12-20 09:46:28 -07:00
Tim Schaub
9b0349f2d5 Variable for builds directory 2014-12-20 02:55:56 -07:00
Tim Schaub
d4763a0fe7 Set CLOSURE_NO_DEPS globally 2014-12-20 02:35:05 -07:00
Frederic Junod
a715a38d75 Simplify CSS code in custom-controls example
By using the ol-control css class and a button instead of a link.
2014-10-30 12:37:44 +01:00
269 changed files with 10020 additions and 2566 deletions

View File

@@ -1,4 +1,5 @@
{ {
"-W030": true, "-W030": true,
"-W083": true "-W083": true,
"-W069": true
} }

View File

@@ -1,58 +0,0 @@
OpenLayers contributors:
* Antoine Abt
* Mike Adair
* Jeff Adams
* Seb Benthall
* Bruno Binet
* Stéphane Brunner
* Howard Butler
* Bertil Chaupis
* John Cole
* Tim Coulter
* Robert Coup
* Jeff Dege
* Roald de Wit
* Schuyler Erle
* Christian López Espínola
* John Frank
* Sean Gilles
* Pierre Giraud
* Ivan Grcic
* Andreas Hocevar
* Marc Jansen
* Ian Johnson
* Frédéric Junod
* Eric Lemoine
* Philip Lindsay
* Martijn van Oosterhout
* David Overstrom
* Tom Payne
* Corey Puffault
* Peter William Robins
* Gregers Rygg
* Tim Schaub
* Christopher Schmidt
* Tobias Schwinger
* Cameron Shorter
* Pedro Simonetti
* Paul Spencer
* Paul Smith
* Glen Stampoultzis
* James Stembridge
* Erik Uzureau
* Bart van den Eijnden
* Ivan Willig
* Thomas Wood
* Bill Woodall
* Steve Woodbridge
* David Zwarg
Some portions of OpenLayers are used under the Apache 2.0 license, available
in doc/licenses/APACHE-2.0.txt.
Some portions of OpenLayers are used under the MIT license, availabie in
doc/licenses/MIT-LICENSE.txt.
Some portions of OpenLayers are Copyright 2001 Robert Penner, and are used
under the BSD license, available in doc/licenses/BSD-LICENSE.txt

View File

@@ -2,6 +2,18 @@
Thanks for your interest in contributing to OpenLayers 3. Thanks for your interest in contributing to OpenLayers 3.
## Asking Questions
Please ask questions about using the library on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
When you want to get involved and discuss new features or changes, please use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev).
## Submitting Bug Reports
Please use the [GitHub issue tracker](https://github.com/openlayers/ol3/issues). Before creating a new issue, do a quick search to see if the problem has been reported already.
## Contributing Code ## Contributing Code
Our preferred means of receiving contributions is through [pull requests](https://help.github.com/articles/using-pull-requests). Make sure Our preferred means of receiving contributions is through [pull requests](https://help.github.com/articles/using-pull-requests). Make sure
@@ -42,7 +54,7 @@ as described below.
The minimum requirements are: The minimum requirements are:
* Git * Git
* [Node.js](http://nodejs.org/) * [Node.js](http://nodejs.org/) (0.10.x or higher)
* Python 2.6 or 2.7 with a couple of extra modules (see below) * Python 2.6 or 2.7 with a couple of extra modules (see below)
* Java 7 (JRE and JDK) * Java 7 (JRE and JDK)
@@ -132,7 +144,7 @@ To run the tests on the console (headless testing with PhantomJS) use the `test`
$ ./build.py test $ ./build.py test
See also the test-specific [README](../blob/master/test/README.md). See also the test-specific [README](../master/test/README.md).
## Running the integration tests ## Running the integration tests
@@ -239,6 +251,14 @@ style of the existing OpenLayers 3 code, which includes:
* Do not use assignments inside expressions. * Do not use assignments inside expressions.
* Avoid the use of `goog.array.clone` with arrays (use slice instead).
* Use `array.length = 0` instead of `goog.array.clear`.
* Use bracket notation instead of `goog.object.set` and `goog.object.get` (with
two arguments).
* Use uppercase for `@const` variables.
### Pass the integration tests run automatically by the Travis CI system ### Pass the integration tests run automatically by the Travis CI system

View File

@@ -1,5 +1,4 @@
Copyright 2005-2014 OpenLayers Contributors. All rights reserved. See Copyright 2005-2014 OpenLayers Contributors. All rights reserved.
AUTHORS.md for full list.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: are permitted provided that the following conditions are met:

View File

@@ -1,11 +1,11 @@
# OpenLayers 3 # OpenLayers 3
[![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.png)](http://travis-ci.org/#!/openlayers/ol3) [![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.svg)](http://travis-ci.org/#!/openlayers/ol3)
Welcome to [OpenLayers 3](http://openlayers.org/)! Welcome to [OpenLayers 3](http://openlayers.org/)!
## Examples
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/ol3-workshop/) or poke around the evolving [API docs](http://openlayers.org/en/master/apidoc/). Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/ol3-workshop/) or poke around the evolving [API docs](http://openlayers.org/en/master/apidoc/).
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead. ## Contributing
Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved. Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved.

View File

@@ -1095,7 +1095,7 @@ class BeautifulStoneSoup(Tag, SGMLParser):
p = self.tagStack[i] p = self.tagStack[i]
if (not p or p.name == name) and not isNestable: if (not p or p.name == name) and not isNestable:
#Non-nestable tags get popped to the top or to their #Non-nestable tags get popped to the top or to their
#last occurance. #last occurrence.
popTo = name popTo = name
break break
if (nestingResetTriggers != None if (nestingResetTriggers != None
@@ -1242,14 +1242,14 @@ class BeautifulSoup(BeautifulStoneSoup):
* Tag nesting rules: * Tag nesting rules:
Most tags can't be nested at all. For instance, the occurance of Most tags can't be nested at all. For instance, the occurrence of
a <p> tag should implicitly close the previous <p> tag. a <p> tag should implicitly close the previous <p> tag.
<p>Para1<p>Para2 <p>Para1<p>Para2
should be transformed into: should be transformed into:
<p>Para1</p><p>Para2 <p>Para1</p><p>Para2
Some tags can be nested arbitrarily. For instance, the occurance Some tags can be nested arbitrarily. For instance, the occurrence
of a <blockquote> tag should _not_ implicitly close the previous of a <blockquote> tag should _not_ implicitly close the previous
<blockquote> tag. <blockquote> tag.

View File

@@ -140,7 +140,7 @@
console.log('Capturing ' + lenHtmlFiles + ' example screenshots.'); console.log('Capturing ' + lenHtmlFiles + ' example screenshots.');
// The main interval function that is executed regularily and renders a // The main interval function that is executed regularly and renders a
// page to a file // page to a file
var interval = setInterval(function() { var interval = setInterval(function() {
if (!loadInProgress && pageindex < lenHtmlFiles) { if (!loadInProgress && pageindex < lenHtmlFiles) {

View File

@@ -172,7 +172,8 @@ virtual('ci', 'lint', 'build', 'test',
'build/examples/all.combined.js', 'check-examples', 'apidoc') 'build/examples/all.combined.js', 'check-examples', 'apidoc')
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js') virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js',
'build/ol.js.map')
virtual('check', 'lint', 'build/ol.js', 'test') virtual('check', 'lint', 'build/ol.js', 'test')
@@ -192,12 +193,21 @@ def build_ol_css(t):
t.output('%(CLEANCSS)s', 'css/ol.css') t.output('%(CLEANCSS)s', 'css/ol.css')
@target('build/ol.js', SRC, SHADER_SRC, 'config/ol.json', NPM_INSTALL) def _build_js(t):
def build_ol_new_js(t):
t.run('node', 'tasks/build.js', 'config/ol.json', 'build/ol.js') t.run('node', 'tasks/build.js', 'config/ol.json', 'build/ol.js')
@target('build/ol.js', SRC, SHADER_SRC, 'config/ol.json', NPM_INSTALL)
def build_ol_js(t):
_build_js(t)
report_sizes(t) report_sizes(t)
@target('build/ol.js.map', SRC, SHADER_SRC, 'config/ol.json', NPM_INSTALL)
def build_ol_js_map(t):
_build_js(t)
@target('build/ol-debug.js', SRC, SHADER_SRC, 'config/ol-debug.json', @target('build/ol-debug.js', SRC, SHADER_SRC, 'config/ol-debug.json',
NPM_INSTALL) NPM_INSTALL)
def build_ol_debug_js(t): def build_ol_debug_js(t):
@@ -794,7 +804,7 @@ Other less frequently used targets are:
If no target is given, the build-target will be executed. If no target is given, the build-target will be executed.
The above list is not complete, please see the source code for not-mentioned The above list is not complete, please see the source code for not-mentioned
and only seldomly called targets. and only seldom called targets.
''' '''
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -0,0 +1,12 @@
## Upgrade notes
### v3.3.0
* The `ol.events.condition.mouseMove` function was replaced by `ol.events.condition.pointerMove` (see [#3281](https://github.com/openlayers/ol3/pull/3281)). For example, if you use `ol.events.condition.mouseMove` as the condition in a `Select` interaction then you now need to use `ol.events.condition.pointerMove`:
```js
var selectInteraction = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
// …
});
```

234
changelog/v3.1.0.md Normal file
View File

@@ -0,0 +1,234 @@
# 3.1.0
## Summary
The 3.1.0 release includes a whopping 214 merged pull requests since 3.0.0. Of note, the WebGL renderer [now supports point rendering](https://github.com/openlayers/ol3/pull/2967). You can use [UTFGrids for interaction](https://github.com/openlayers/ol3/pull/3015)! Styles can now specify [alternate geometries for rendering](https://github.com/openlayers/ol3/pull/3010). Library builds [can now be loaded](https://github.com/openlayers/ol3/pull/3039) with module loaders like Browserify or RequireJS. You can now symbolize point features with stars, squares, enneadecagons, or [any other regular(ish) polygon](https://github.com/openlayers/ol3/pull/2706). See the full list of [changes](#changes) below.
## Upgrade notes
The 3.1.0 release maintains a backwards-compatible API with the 3.0.0 release, so upgrades should be painless. Some special considerations below.
* If you are using a `ol.source.ImageStatic`, you no longer need to provide an `imageSize` option if you don't want any special scaling on your image (see [#2796](https://github.com/openlayers/ol3/pull/2796)).
* Instead of calling `obj.unByKey(key)` you can now call `ol.Observable.unByKey(key)` (see [#2794](https://github.com/openlayers/ol3/pull/2794)).
* If you were using `format.writeFeatures(features)`, note that this method returns a string for all feature formats. We considered the previous behavior a bug (see [#3003](https://github.com/openlayers/ol3/pull/3003)).
* The `obj.dispatchChangeEvent()` method is now spelled `obj.changed()`. This method is still unstable (see [#2684](https://github.com/openlayers/ol3/pull/2684)).
## Changes
* [#3076](https://github.com/openlayers/ol3/pull/3076) - Add script to standardize changelog creation. ([@tschaub](https://github.com/tschaub))
* [#3074](https://github.com/openlayers/ol3/pull/3074) - Remove misplaced function annotation. ([@fredj](https://github.com/fredj))
* [#3075](https://github.com/openlayers/ol3/pull/3075) - Remove unneeded undefined from ol.proj.ProjectionLike definitions (r=@tschaub) ([@bartvde](https://github.com/bartvde))
* [#3071](https://github.com/openlayers/ol3/pull/3071) - Add task for publishing to npm. ([@tschaub](https://github.com/tschaub))
* [#3070](https://github.com/openlayers/ol3/pull/3070) - Define goog and assign to global when generating UMD debug builds. ([@tschaub](https://github.com/tschaub))
* [#3068](https://github.com/openlayers/ol3/pull/3068) - Update pre-release version. ([@tschaub](https://github.com/tschaub))
* [#3039](https://github.com/openlayers/ol3/pull/3039) - Support for UMD builds. ([@tschaub](https://github.com/tschaub))
* [#3038](https://github.com/openlayers/ol3/pull/3038) - Update attribution CSS #2803 ([@acanimal](https://github.com/acanimal))
* [#3061](https://github.com/openlayers/ol3/pull/3061) - Add a renderBuffer option to ol.layer.Vector ([@elemoine](https://github.com/elemoine))
* [#3048](https://github.com/openlayers/ol3/pull/3048) - Add a drag-features example ([@elemoine](https://github.com/elemoine))
* [#3060](https://github.com/openlayers/ol3/pull/3060) - Update closure-library version ([@fredj](https://github.com/fredj))
* [#3058](https://github.com/openlayers/ol3/pull/3058) - Use an API function to extend the extent ([@ahocevar](https://github.com/ahocevar))
* [#3010](https://github.com/openlayers/ol3/pull/3010) - Allow styles to override feature geometries ([@ahocevar](https://github.com/ahocevar))
* [#3056](https://github.com/openlayers/ol3/pull/3056) - Reuse previousExtent_ local variable ([@fredj](https://github.com/fredj))
* [#3055](https://github.com/openlayers/ol3/pull/3055) - ol.tilecoord.createOrUpdate: add 'opt_' prefix to optional param ([@fredj](https://github.com/fredj))
* [#3044](https://github.com/openlayers/ol3/pull/3044) - Mark Image style constructor properties `@api` ([@gberaudo](https://github.com/gberaudo))
* [#3052](https://github.com/openlayers/ol3/pull/3052) - Add a testcase for parsing GML feature with only boundedBy ([@bartvde](https://github.com/bartvde))
* [#3051](https://github.com/openlayers/ol3/pull/3051) - Remove // NOCOMPILE from vector-wfs ([@elemoine](https://github.com/elemoine))
* [#2699](https://github.com/openlayers/ol3/pull/2699) - No need for featureNS and featureType to be quoted ([@bartvde](https://github.com/bartvde))
* [#3047](https://github.com/openlayers/ol3/pull/3047) - Move description above annotation to avoid JSDoc warnings. ([@tschaub](https://github.com/tschaub))
* [#2996](https://github.com/openlayers/ol3/pull/2996) - Add getter functions for points and angle in ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#3046](https://github.com/openlayers/ol3/pull/3046) - Need exportable constructor for constructor options in olx ([@ahocevar](https://github.com/ahocevar))
* [#3043](https://github.com/openlayers/ol3/pull/3043) - Use // NOCOMPILE for vector-wfs ([@elemoine](https://github.com/elemoine))
* [#3042](https://github.com/openlayers/ol3/pull/3042) - Print example name in check-examples exception ([@gberaudo](https://github.com/gberaudo))
* [#3032](https://github.com/openlayers/ol3/pull/3032) - Extension points for custom controls and interactions ([@elemoine](https://github.com/elemoine))
* [#3033](https://github.com/openlayers/ol3/pull/3033) - Allow custom mousemove conditions for Select interaction ([@ahocevar](https://github.com/ahocevar))
* [#3040](https://github.com/openlayers/ol3/pull/3040) - Transform the coordinates in place ([@fredj](https://github.com/fredj))
* [#3036](https://github.com/openlayers/ol3/pull/3036) - Respect geometry stride in modify interaction ([@tonio](https://github.com/tonio))
* [#3020](https://github.com/openlayers/ol3/pull/3020) - Correct error message from generate-info.js. ([@tschaub](https://github.com/tschaub))
* [#3037](https://github.com/openlayers/ol3/pull/3037) - Implement rotation for ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#3015](https://github.com/openlayers/ol3/pull/3015) - UTFGrid Support ([@klokantech](https://github.com/klokantech))
* [#3012](https://github.com/openlayers/ol3/pull/3012) - Failing tests in IE9 ([@bartvde](https://github.com/bartvde))
* [#3029](https://github.com/openlayers/ol3/pull/3029) - Update closure compiler and library ([@fredj](https://github.com/fredj))
* [#3031](https://github.com/openlayers/ol3/pull/3031) - Add missing maxZoom property in olx.view.FitGeometryOptions ([@fredj](https://github.com/fredj))
* [#3028](https://github.com/openlayers/ol3/pull/3028) - ol.format.WFS cleanup ([@fredj](https://github.com/fredj))
* [#3024](https://github.com/openlayers/ol3/pull/3024) - Add missing gmlFormat to olx.format.WFSOptions ([@fredj](https://github.com/fredj))
* [#3023](https://github.com/openlayers/ol3/pull/3023) - Change loader function return type ([@fredj](https://github.com/fredj))
* [#3021](https://github.com/openlayers/ol3/pull/3021) - Add missing properties in olx.control.AttributionOptions typedef ([@fredj](https://github.com/fredj))
* [#3013](https://github.com/openlayers/ol3/pull/3013) - Improve vector source clear() performance ([@gberaudo](https://github.com/gberaudo))
* [#3017](https://github.com/openlayers/ol3/pull/3017) - Use writeFeatures instead of writeFeaturesNode in GPX and KML example (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#3014](https://github.com/openlayers/ol3/pull/3014) - Simplify hit detection code ([@elemoine](https://github.com/elemoine))
* [#3006](https://github.com/openlayers/ol3/pull/3006) - gml3.js and gml2.js don't follow file naming conventions ([@bartvde](https://github.com/bartvde))
* [#3003](https://github.com/openlayers/ol3/pull/3003) - The writeFeatures method should always return a string (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#3011](https://github.com/openlayers/ol3/pull/3011) - opt_options may not be defined, use options ([@pagameba](https://github.com/pagameba))
* [#3009](https://github.com/openlayers/ol3/pull/3009) - Fix hit detection bug ([@elemoine](https://github.com/elemoine))
* [#3002](https://github.com/openlayers/ol3/pull/3002) - Passing options to RegularShape is mandatory ([@elemoine](https://github.com/elemoine))
* [#2967](https://github.com/openlayers/ol3/pull/2967) - Add support for drawing points with WebGL ([@camptocamp](https://github.com/camptocamp))
* [#2701](https://github.com/openlayers/ol3/pull/2701) - Writing GeoJSON does not respect the feature's geometryName ([@bartvde](https://github.com/bartvde))
* [#3000](https://github.com/openlayers/ol3/pull/3000) - Explain that return of ol.color.asArray should not be modified ([@bartvde](https://github.com/bartvde))
* [#2997](https://github.com/openlayers/ol3/pull/2997) - Use new demo GeoServer location ([@ahocevar](https://github.com/ahocevar))
* [#2976](https://github.com/openlayers/ol3/pull/2976) - Add an example to show off ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#2992](https://github.com/openlayers/ol3/pull/2992) - Add support for finding features at a given coordinates for vector tiles - fixes ([@pgiraud](https://github.com/pgiraud))
* [#2987](https://github.com/openlayers/ol3/pull/2987) - Image layer renderers use source projection if given and equivalent ([@kartverket](https://github.com/kartverket))
* [#2975](https://github.com/openlayers/ol3/pull/2975) - Use offsetX and offsetY if available ([@fredj](https://github.com/fredj))
* [#2973](https://github.com/openlayers/ol3/pull/2973) - Making GetTileCoordFor methods public avaible ([@s093294](https://github.com/s093294))
* [#2986](https://github.com/openlayers/ol3/pull/2986) - Add support for finding features at a given coordinates for vector tiles ([@pgiraud](https://github.com/pgiraud))
* [#2937](https://github.com/openlayers/ol3/pull/2937) - Clip layer rendering to limited extent. ([@tschaub](https://github.com/tschaub))
* [#2971](https://github.com/openlayers/ol3/pull/2971) - Two ol.source.TileVector fixes ([@elemoine](https://github.com/elemoine))
* [#2988](https://github.com/openlayers/ol3/pull/2988) - Correct olx.style.RegularShapeOptions definition (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#2981](https://github.com/openlayers/ol3/pull/2981) - Use lineDash in ol.style.Circle's and ol.style.RegularShape's stroke (r=@fredj,@elemoine) ([@bartvde](https://github.com/bartvde))
* [#2982](https://github.com/openlayers/ol3/pull/2982) - Allow radius1 as an alias for radius in ol.style.RegularShape ([@bartvde](https://github.com/bartvde))
* [#2980](https://github.com/openlayers/ol3/pull/2980) - Export ol.source.TileVector#getFeatures in built mode ([@pgiraud](https://github.com/pgiraud))
* [#2979](https://github.com/openlayers/ol3/pull/2979) - Support OGC srs urns without an EPSG database version ([@bartvde](https://github.com/bartvde))
* [#2978](https://github.com/openlayers/ol3/pull/2978) - Fix zoom levels for the MapQuest Street layer ([@ahocevar](https://github.com/ahocevar))
* [#2889](https://github.com/openlayers/ol3/pull/2889) - Add GetFeatureInfo format ([@fgravin](https://github.com/fgravin))
* [#2965](https://github.com/openlayers/ol3/pull/2965) - Fix pan with select interaction in mousemove mode. ([@tonio](https://github.com/tonio))
* [#2960](https://github.com/openlayers/ol3/pull/2960) - LayerGroup extent should be used if extent not set on child layer ([@bartvde](https://github.com/bartvde))
* [#2956](https://github.com/openlayers/ol3/pull/2956) - Revert "Remove mousewheel event name workaround" ([@fredj](https://github.com/fredj))
* [#2959](https://github.com/openlayers/ol3/pull/2959) - Fix typo in selector ([@ahocevar](https://github.com/ahocevar))
* [#2895](https://github.com/openlayers/ol3/pull/2895) - Move font-family customization to layout.css ([@fredj](https://github.com/fredj))
* [#2896](https://github.com/openlayers/ol3/pull/2896) - Remove duplicated style parameter ([@kalinbas](https://github.com/kalinbas))
* [#2938](https://github.com/openlayers/ol3/pull/2938) - Additional image static docs. ([@tschaub](https://github.com/tschaub))
* [#2939](https://github.com/openlayers/ol3/pull/2939) - Make stability checkbox sticky. ([@tschaub](https://github.com/tschaub))
* [#2949](https://github.com/openlayers/ol3/pull/2949) - Add ol.ext to hosted dir ([@elemoine](https://github.com/elemoine))
* [#2943](https://github.com/openlayers/ol3/pull/2943) - Mark applyTransform api stable ([@fredj](https://github.com/fredj))
* [#2936](https://github.com/openlayers/ol3/pull/2936) - Fix unselection of selected features ([@ahocevar](https://github.com/ahocevar))
* [#2935](https://github.com/openlayers/ol3/pull/2935) - Fix jsdoc comment ([@geosense](https://github.com/geosense))
* [#2933](https://github.com/openlayers/ol3/pull/2933) - Fix compile warning ([@elemoine](https://github.com/elemoine))
* [#2931](https://github.com/openlayers/ol3/pull/2931) - Improvement to view docs ([@elemoine](https://github.com/elemoine))
* [#2906](https://github.com/openlayers/ol3/pull/2906) - Assume a latitude, longitude order for Polyline format ([@fredj](https://github.com/fredj))
* [#2927](https://github.com/openlayers/ol3/pull/2927) - Make it possible to programmatically finish drawing ([@elemoine](https://github.com/elemoine))
* [#2928](https://github.com/openlayers/ol3/pull/2928) - Do not rename handleMapBrowserEvent internally ([@elemoine](https://github.com/elemoine))
* [#2924](https://github.com/openlayers/ol3/pull/2924) - Readability rearangement in canvasmaprenderer.js ([@gberaudo](https://github.com/gberaudo))
* [#2911](https://github.com/openlayers/ol3/pull/2911) - List events fired in the navigation. ([@tschaub](https://github.com/tschaub))
* [#2921](https://github.com/openlayers/ol3/pull/2921) - Small feature overlay optimization ([@gberaudo](https://github.com/gberaudo))
* [#2897](https://github.com/openlayers/ol3/pull/2897) - Remove pointerup listener on controls ([@fredj](https://github.com/fredj))
* [#2912](https://github.com/openlayers/ol3/pull/2912) - jQuery externs update ([@fredj](https://github.com/fredj))
* [#2888](https://github.com/openlayers/ol3/pull/2888) - Element boundedBy must not be set as geometry field on GML reading ([@fgravin](https://github.com/fgravin))
* [#2903](https://github.com/openlayers/ol3/pull/2903) - Improved docs for icon options ([@elemoine](https://github.com/elemoine))
* [#2900](https://github.com/openlayers/ol3/pull/2900) - Allow build.js task to add header. ([@tschaub](https://github.com/tschaub))
* [#2893](https://github.com/openlayers/ol3/pull/2893) - Don't pass an object to goog.dom.createDom for the class name ([@fredj](https://github.com/fredj))
* [#2781](https://github.com/openlayers/ol3/pull/2781) - Use a standard title attribute for the control buttons ([@fredj](https://github.com/fredj))
* [#2852](https://github.com/openlayers/ol3/pull/2852) - Add missing space between class names ([@fredj](https://github.com/fredj))
* [#2891](https://github.com/openlayers/ol3/pull/2891) - Introduce a load function for image sources ([@ahocevar](https://github.com/ahocevar))
* [#2885](https://github.com/openlayers/ol3/pull/2885) - Add wrapX option to TileJSON source ([@elemoine](https://github.com/elemoine))
* [#2890](https://github.com/openlayers/ol3/pull/2890) - Use correct layer property names ([@elemoine](https://github.com/elemoine))
* [#2887](https://github.com/openlayers/ol3/pull/2887) - Explicitly pass coordinate dimension before transforming. ([@tschaub](https://github.com/tschaub))
* [#2886](https://github.com/openlayers/ol3/pull/2886) - Use ternary notation ([@elemoine](https://github.com/elemoine))
* [#2869](https://github.com/openlayers/ol3/pull/2869) - Export useful xml functions ([@tonio](https://github.com/tonio))
* [#2884](https://github.com/openlayers/ol3/pull/2884) - Make WKT methods throw errors instead of calling a method that throws. ([@tschaub](https://github.com/tschaub))
* [#2746](https://github.com/openlayers/ol3/pull/2746) - Add versioning for GML format ([@fgravin](https://github.com/fgravin))
* [#2882](https://github.com/openlayers/ol3/pull/2882) - Allow olx.source.WMTSOptions#requestEncoding to be a string ([@fredj](https://github.com/fredj))
* [#2881](https://github.com/openlayers/ol3/pull/2881) - Add default requestEncoding in documentation ([@fredj](https://github.com/fredj))
* [#2877](https://github.com/openlayers/ol3/pull/2877) - Remove FIXME in src/ol/structs/rbush.js ([@fredj](https://github.com/fredj))
* [#2870](https://github.com/openlayers/ol3/pull/2870) - Use bulk-insertion for addFeatures ([@tsauerwein](https://github.com/tsauerwein))
* [#2856](https://github.com/openlayers/ol3/pull/2856) - Allow layer source to be set. ([@tschaub](https://github.com/tschaub))
* [#2875](https://github.com/openlayers/ol3/pull/2875) - Avoid modifying `map.logos_` with each frame. ([@tschaub](https://github.com/tschaub))
* [#2874](https://github.com/openlayers/ol3/pull/2874) - Avoid shrinking logos. ([@tschaub](https://github.com/tschaub))
* [#2872](https://github.com/openlayers/ol3/pull/2872) - Remove the beforepropertychange event from ol.Object ([@fredj](https://github.com/fredj))
* [#2868](https://github.com/openlayers/ol3/pull/2868) - Remove doc about dispatching events. ([@tschaub](https://github.com/tschaub))
* [#2871](https://github.com/openlayers/ol3/pull/2871) - Make `npm install` a dependency of node based targets. ([@tschaub](https://github.com/tschaub))
* [#2867](https://github.com/openlayers/ol3/pull/2867) - Support for importing CommonJS style modules (like rbush). ([@openlayers](https://github.com/openlayers))
* [#2865](https://github.com/openlayers/ol3/pull/2865) - Add old value to property change events ([@elemoine](https://github.com/elemoine))
* [#2866](https://github.com/openlayers/ol3/pull/2866) - Cluster source calls loadFeatures on vector source ([@elemoine](https://github.com/elemoine))
* [#2864](https://github.com/openlayers/ol3/pull/2864) - Avoid mixed content in Bing Maps (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#2855](https://github.com/openlayers/ol3/pull/2855) - Move touchstart preventDefault to ol.renderer.dom.Map ([@fredj](https://github.com/fredj))
* [#2690](https://github.com/openlayers/ol3/pull/2690) - Vector rendering with the DOM renderer ([@ahocevar](https://github.com/ahocevar))
* [#2859](https://github.com/openlayers/ol3/pull/2859) - Document exportable vector source symbols. ([@tschaub](https://github.com/tschaub))
* [#2857](https://github.com/openlayers/ol3/pull/2857) - Update the OSM attribution. ([@tschaub](https://github.com/tschaub))
* [#2847](https://github.com/openlayers/ol3/pull/2847) - Constrain center in zoomify example ([@elemoine](https://github.com/elemoine))
* [#2838](https://github.com/openlayers/ol3/pull/2838) - ol.source.WMTS now passes tileClass option to ol.source.TileImage ([@mike-mcgann](https://github.com/mike-mcgann))
* [#2821](https://github.com/openlayers/ol3/pull/2821) - Add ol.geom.Polygon.fromExtent ([@elemoine](https://github.com/elemoine))
* [#2835](https://github.com/openlayers/ol3/pull/2835) - Use correct Stamen URL for SSL. ([@j16sdiz](https://github.com/j16sdiz))
* [#2839](https://github.com/openlayers/ol3/pull/2839) - Dependency updates and new package name. ([@tschaub](https://github.com/tschaub))
* [#2840](https://github.com/openlayers/ol3/pull/2840) - Fewer point resolution tests. ([@tschaub](https://github.com/tschaub))
* [#2836](https://github.com/openlayers/ol3/pull/2836) - Give priority to feature's style instead of source's style ([@oterral](https://github.com/oterral))
* [#2834](https://github.com/openlayers/ol3/pull/2834) - Use ADVANCED instead of ADVANCED_OPTIMIZATIONS ([@fredj](https://github.com/fredj))
* [#2833](https://github.com/openlayers/ol3/pull/2833) - Avoid too many files open with graceful-fs@3.0.3. ([@tschaub](https://github.com/tschaub))
* [#2829](https://github.com/openlayers/ol3/pull/2829) - Zoom slider refactor. ([@tschaub](https://github.com/tschaub))
* [#2757](https://github.com/openlayers/ol3/pull/2757) - Clear the canvas on layer extent changes. ([@tschaub](https://github.com/tschaub))
* [#2796](https://github.com/openlayers/ol3/pull/2796) - Determine image size on load. ([@tschaub](https://github.com/tschaub))
* [#2825](https://github.com/openlayers/ol3/pull/2825) - Change comments for examples_star_json build target ([@elemoine](https://github.com/elemoine))
* [#2822](https://github.com/openlayers/ol3/pull/2822) - Remove obsolete comment ([@gingerik](https://github.com/gingerik))
* [#2769](https://github.com/openlayers/ol3/pull/2769) - OverviewMap control ([@adube](https://github.com/adube))
* [#2820](https://github.com/openlayers/ol3/pull/2820) - Add parsing of LabelStyle in KML format ([@oterral](https://github.com/oterral))
* [#2819](https://github.com/openlayers/ol3/pull/2819) - Improvements to the xyz-esri-4326-512 example ([@elemoine](https://github.com/elemoine))
* [#2743](https://github.com/openlayers/ol3/pull/2743) - Handle ol.interaction.Draw activation/deactivation ([@elemoine](https://github.com/elemoine))
* [#2816](https://github.com/openlayers/ol3/pull/2816) - Exit on check-examples failure ([@gberaudo](https://github.com/gberaudo))
* [#2794](https://github.com/openlayers/ol3/pull/2794) - Add ol.Observable.unByKey ([@elemoine](https://github.com/elemoine))
* [#2815](https://github.com/openlayers/ol3/pull/2815) - Fix jquery.min.js path in xyz-esri-4326-512 example ([@fredj](https://github.com/fredj))
* [#2756](https://github.com/openlayers/ol3/pull/2756) - Add an example for using an Esri 512x512 tile server in EPSG:4326 (r=@elemoine) ([@bartvde](https://github.com/bartvde))
* [#2814](https://github.com/openlayers/ol3/pull/2814) - Add missing whitespaces in CSS calc ([@fredj](https://github.com/fredj))
* [#2811](https://github.com/openlayers/ol3/pull/2811) - Remove defaultProjection and object from typedef ([@fredj](https://github.com/fredj))
* [#2779](https://github.com/openlayers/ol3/pull/2779) - Update jQuery to 1.9.1 ([@fredj](https://github.com/fredj))
* [#2810](https://github.com/openlayers/ol3/pull/2810) - Remove unused properties from olx.source.TileVectorOptions ([@pagameba](https://github.com/pagameba))
* [#2808](https://github.com/openlayers/ol3/pull/2808) - Remove reprojectTo option from olx.source.OSMXMLOptions ([@fredj](https://github.com/fredj))
* [#2809](https://github.com/openlayers/ol3/pull/2809) - Miscellaneous controls cleanups ([@fredj](https://github.com/fredj))
* [#2805](https://github.com/openlayers/ol3/pull/2805) - Enable subclassing Interaction in public API ([@sweco-sebhar](https://github.com/sweco-sebhar))
* [#2798](https://github.com/openlayers/ol3/pull/2798) - Update closure-util to version 1.0.0 ([@fredj](https://github.com/fredj))
* [#2785](https://github.com/openlayers/ol3/pull/2785) - Use goog.* types in externs ([@ahocevar](https://github.com/ahocevar))
* [#2795](https://github.com/openlayers/ol3/pull/2795) - Externs ([@gingerik](https://github.com/gingerik))
* [#2792](https://github.com/openlayers/ol3/pull/2792) - Use valid mediatype for GPX export. ([@pgiraud](https://github.com/pgiraud))
* [#2784](https://github.com/openlayers/ol3/pull/2784) - Add 'tooltip'-tag to KML example. ([@marcjansen](https://github.com/marcjansen))
* [#2782](https://github.com/openlayers/ol3/pull/2782) - Hide the rotate control when the rotation is 0 ([@fredj](https://github.com/fredj))
* [#2774](https://github.com/openlayers/ol3/pull/2774) - Remove unused distinctFeatures object in ol.interaction.Modify#handlePointerDown ([@fredj](https://github.com/fredj))
* [#2771](https://github.com/openlayers/ol3/pull/2771) - Allow package to be published in npm registry. ([@tschaub](https://github.com/tschaub))
* [#2773](https://github.com/openlayers/ol3/pull/2773) - Type-related changes to ol.style.Image ([@elemoine](https://github.com/elemoine))
* [#2751](https://github.com/openlayers/ol3/pull/2751) - Export constructors and options of ol.source.Source children ([@gberaudo](https://github.com/gberaudo))
* [#2772](https://github.com/openlayers/ol3/pull/2772) - Rename updatefeature event to changefeature ([@fredj](https://github.com/fredj))
* [#2766](https://github.com/openlayers/ol3/pull/2766) - Make interaction "active" an ol.Object property ([@elemoine](https://github.com/elemoine))
* [#2765](https://github.com/openlayers/ol3/pull/2765) - Treat unknown opt types as Object in ol externs ([@elemoine](https://github.com/elemoine))
* [#2759](https://github.com/openlayers/ol3/pull/2759) - Fix test failures. ([@tschaub](https://github.com/tschaub))
* [#2762](https://github.com/openlayers/ol3/pull/2762) - Report test failures to the console. ([@tschaub](https://github.com/tschaub))
* [#2768](https://github.com/openlayers/ol3/pull/2768) - Write the function name correctly in the doc. ([@xamgreen](https://github.com/xamgreen))
* [#2764](https://github.com/openlayers/ol3/pull/2764) - Remove rtree example ([@fredj](https://github.com/fredj))
* [#2763](https://github.com/openlayers/ol3/pull/2763) - Miscellaneous coding style and typo fixes ([@fredj](https://github.com/fredj))
* [#2758](https://github.com/openlayers/ol3/pull/2758) - Correctly generate child tile ranges for XYZ tiles. ([@tschaub](https://github.com/tschaub))
* [#2734](https://github.com/openlayers/ol3/pull/2734) - Add maxZoom option to BingMaps ([@elemoine](https://github.com/elemoine))
* [#2752](https://github.com/openlayers/ol3/pull/2752) - Call loadFeatures from ol.source.ImageVector ([@elemoine](https://github.com/elemoine))
* [#2658](https://github.com/openlayers/ol3/pull/2658) - Set inherited values when parsing a GetCapabilities ([@oterral](https://github.com/oterral))
* [#2750](https://github.com/openlayers/ol3/pull/2750) - Export ol.layer.Base ([@fredj](https://github.com/fredj))
* [#2749](https://github.com/openlayers/ol3/pull/2749) - Export ol.source.Source ([@fredj](https://github.com/fredj))
* [#2742](https://github.com/openlayers/ol3/pull/2742) - Dispatch an 'updatefeature' from the vector source ([@fredj](https://github.com/fredj))
* [#2747](https://github.com/openlayers/ol3/pull/2747) - Fix incorrect web address. ([@lazaruslarue](https://github.com/lazaruslarue))
* [#2745](https://github.com/openlayers/ol3/pull/2745) - DragBox Interaction: getGeometry return type can be ol.geom.Polygon (r=@fredj) ([@bartvde](https://github.com/bartvde))
* [#2744](https://github.com/openlayers/ol3/pull/2744) - Fix ol.Feature 'change' event documentation ([@fredj](https://github.com/fredj))
* [#2741](https://github.com/openlayers/ol3/pull/2741) - issue with reading scientific notation coordinates in ol.format.GML (r=@fredj) ([@bartvde](https://github.com/bartvde))
* [#2739](https://github.com/openlayers/ol3/pull/2739) - Revert "Function circular renamed to createCircularOnSphere" ([@elemoine](https://github.com/elemoine))
* [#2616](https://github.com/openlayers/ol3/pull/2616) - Target for attribution links differs between maps ([@fredj](https://github.com/fredj))
* [#2740](https://github.com/openlayers/ol3/pull/2740) - Make interactions activable and deactivable ([@elemoine](https://github.com/elemoine))
* [#2727](https://github.com/openlayers/ol3/pull/2727) - Rename ol.geom.Polygon#circular to createCircularOnSphere ([@elemoine](https://github.com/elemoine))
* [#2730](https://github.com/openlayers/ol3/pull/2730) - Do not call toLowerCase when forming a change:property event ([@elemoine](https://github.com/elemoine))
* [#2728](https://github.com/openlayers/ol3/pull/2728) - Mark `ol.extent.getIntersection` as stable. ([@tschaub](https://github.com/tschaub))
* [#2726](https://github.com/openlayers/ol3/pull/2726) - Make ol.Feature#setStyle accept null ([@elemoine](https://github.com/elemoine))
* [#2724](https://github.com/openlayers/ol3/pull/2724) - Error when compiling individual example ([@fredj](https://github.com/fredj))
* [#1959](https://github.com/openlayers/ol3/pull/1959) - Add a feature box selection example ([@elemoine](https://github.com/elemoine))
* [#2722](https://github.com/openlayers/ol3/pull/2722) - Make ol.Map#setView do not accept undefined ([@elemoine](https://github.com/elemoine))
* [#2696](https://github.com/openlayers/ol3/pull/2696) - Consistent circle transform. ([@gberaudo](https://github.com/gberaudo))
* [#2717](https://github.com/openlayers/ol3/pull/2717) - Change the control visibility by using css class ([@fredj](https://github.com/fredj))
* [#2715](https://github.com/openlayers/ol3/pull/2715) - Add an EPSG:3857 map to Tissot example ([@elemoine](https://github.com/elemoine))
* [#2714](https://github.com/openlayers/ol3/pull/2714) - Set the opacity directly to element.style.opacity ([@fredj](https://github.com/fredj))
* [#2647](https://github.com/openlayers/ol3/pull/2647) - Upgrade closure library version ([@fredj](https://github.com/fredj))
* [#2549](https://github.com/openlayers/ol3/pull/2549) - Use goog.array.ASSUME_NATIVE_FUNCTIONS define ([@fredj](https://github.com/fredj))
* [#2711](https://github.com/openlayers/ol3/pull/2711) - Remove Google Maps example ([@elemoine](https://github.com/elemoine))
* [#2684](https://github.com/openlayers/ol3/pull/2684) - Rename ol.Observable#dispatchChangeEvent() to #changed() ([@ahocevar](https://github.com/ahocevar))
* [#2678](https://github.com/openlayers/ol3/pull/2678) - Mutable symbolizer properties for styles ([@ahocevar](https://github.com/ahocevar))
* [#2568](https://github.com/openlayers/ol3/pull/2568) - re-implement auto-configure code for ol.format.GML (r=@ahocevar) ([@bartvde](https://github.com/bartvde))
* [#2704](https://github.com/openlayers/ol3/pull/2704) - Use pool thread for calling bin/check-example.js. ([@gberaudo](https://github.com/gberaudo))
* [#2698](https://github.com/openlayers/ol3/pull/2698) - StaticVector is not an abstract base class ([@ahocevar](https://github.com/ahocevar))
* [#2702](https://github.com/openlayers/ol3/pull/2702) - Add vector layer in export-map example ([@fredj](https://github.com/fredj))
* [#2687](https://github.com/openlayers/ol3/pull/2687) - Use ol.LEGACY_IE_SUPPORT and ol.IS_LEGACY_IE define ([@fredj](https://github.com/fredj))
* [#2675](https://github.com/openlayers/ol3/pull/2675) - Remove undefined from ol.Map#getLayers return type ([@fredj](https://github.com/fredj))
* [#2692](https://github.com/openlayers/ol3/pull/2692) - Unset z-index in overlay example ([@fredj](https://github.com/fredj))
* [#2681](https://github.com/openlayers/ol3/pull/2681) - Make tileSize a config option for ol.source.XYZ ([@ahocevar](https://github.com/ahocevar))
* [#2534](https://github.com/openlayers/ol3/pull/2534) - Document ol.geom.Polygon#getLinearRing function ([@fredj](https://github.com/fredj))
* [#2677](https://github.com/openlayers/ol3/pull/2677) - Add TextStyle offsets getters to API. ([@gberaudo](https://github.com/gberaudo))
* [#2676](https://github.com/openlayers/ol3/pull/2676) - ol.FeatureOverlay: use the feature style if defined ([@fredj](https://github.com/fredj))
* [#2656](https://github.com/openlayers/ol3/pull/2656) - Set ol.layer.Image#getSource return type to ol.source.Image ([@fredj](https://github.com/fredj))
* [#2651](https://github.com/openlayers/ol3/pull/2651) - ol.layer.Vector.getSource return type specialisation. ([@gberaudo](https://github.com/gberaudo))
* [#2669](https://github.com/openlayers/ol3/pull/2669) - Revert "snapshot" ([@fredj](https://github.com/fredj))
* [#2663](https://github.com/openlayers/ol3/pull/2663) - Set tracking property to false on geolocation error ([@fredj](https://github.com/fredj))
* [#2662](https://github.com/openlayers/ol3/pull/2662) - Delegate transformation in ol.source.FormatVector#readFeatures to `ol.format.*` ([@gingerik](https://github.com/gingerik))
* [#2447](https://github.com/openlayers/ol3/pull/2447) - Correct documentation typo. ([@lazaruslarue](https://github.com/lazaruslarue))
* [#2660](https://github.com/openlayers/ol3/pull/2660) - New domain in the build header ([@elemoine](https://github.com/elemoine))

9
changelog/v3.1.1.md Normal file
View File

@@ -0,0 +1,9 @@
# 3.1.0
## Summary
This is a patch release to fix an issue with the select interaction in the 3.1.0 release.
## Changes
* [#3082](https://github.com/openlayers/ol3/pull/3082) - Correct arguments for forEachGeometryAtPixel. ([@tschaub](https://github.com/tschaub))

86
changelog/v3.2.0.md Normal file
View File

@@ -0,0 +1,86 @@
# 3.2.0
## Summary
The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](http://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below.
## Upgrade notes
The 3.2.0 release maintains a backwards-compatible API with the 3.1.0 release, so upgrades should be painless. Some special considerations below.
* You should not call `view.setRotation` with `undefined`, to reset the view rotation to `0` then use `view.setRotation(0)` (see [#3176](https://github.com/openlayers/ol3/pull/3176)).
* If you use `$(map.getViewport()).on('mousemove')` to detect features when the mouse is hovered on the map, you should now rely on the `pointermove` map event type and check in the `pointermove` listener that the `dragging` event property is `false` (see [#3190](https://github.com/openlayers/ol3/pull/3190)).
## Changes
* [#3171](https://github.com/openlayers/ol3/pull/3171) - KML: Parsing of NetworkLink tag ([@oterral](https://github.com/oterral))
* [#3209](https://github.com/openlayers/ol3/pull/3209) - Coding style fixes ([@fredj](https://github.com/fredj))
* [#3208](https://github.com/openlayers/ol3/pull/3208) - Add setters and getters for imageLoadFunction ([@bartvde](https://github.com/bartvde))
* [#3019](https://github.com/openlayers/ol3/pull/3019) - Add option to allow Select interaction logic to select overlapping features ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3206](https://github.com/openlayers/ol3/pull/3206) - Add tooltip to show measure + help message while drawing ([@pgiraud](https://github.com/pgiraud))
* [#3205](https://github.com/openlayers/ol3/pull/3205) - Use ol.extent.createOrUpdateFromCoordinate ([@fredj](https://github.com/fredj))
* [#3026](https://github.com/openlayers/ol3/pull/3026) - Add support of reading WMTS Get Cap document ([@htulipe](https://github.com/htulipe))
* [#3201](https://github.com/openlayers/ol3/pull/3201) - Pass on opt_fast to parent clear function in ol.source.ServerVector (r=@elemoine,@gberaudo) ([@bartvde](https://github.com/bartvde))
* [#3199](https://github.com/openlayers/ol3/pull/3199) - Minor jsdoc fixes ([@fredj](https://github.com/fredj))
* [#3059](https://github.com/openlayers/ol3/pull/3059) - Cache the buffered extent value ([@fredj](https://github.com/fredj))
* [#3196](https://github.com/openlayers/ol3/pull/3196) - Remove unnecessary newlines ([@fredj](https://github.com/fredj))
* [#3099](https://github.com/openlayers/ol3/pull/3099) - Fix up parsing of OGR GML with ol.format.GML ([@bartvde](https://github.com/bartvde))
* [#3195](https://github.com/openlayers/ol3/pull/3195) - Coding style ([@fredj](https://github.com/fredj))
* [#3192](https://github.com/openlayers/ol3/pull/3192) - Add "url" option to ol.source.MapQuest ([@elemoine](https://github.com/elemoine))
* [#3172](https://github.com/openlayers/ol3/pull/3172) - Introduce forEachLayerAtPixel ([@tsauerwein](https://github.com/tsauerwein))
* [#3178](https://github.com/openlayers/ol3/pull/3178) - GeoJSON externs fixes ([@fredj](https://github.com/fredj))
* [#3179](https://github.com/openlayers/ol3/pull/3179) - Disallow undefined values for ol.layer.Base ([@fredj](https://github.com/fredj))
* [#3161](https://github.com/openlayers/ol3/pull/3161) - Doc fix. writeFeaturesNode receives an array of Feature ([@3x0dv5](https://github.com/3x0dv5))
* [#3169](https://github.com/openlayers/ol3/pull/3169) - Fix default icon style in kml format ([@oterral](https://github.com/oterral))
* [#3190](https://github.com/openlayers/ol3/pull/3190) - Introduce `dragging` flag for MapBrowserEvent ([@tsauerwein](https://github.com/tsauerwein))
* [#3135](https://github.com/openlayers/ol3/pull/3135) - Make changing the label of ZoomToExtent/FullScreen control consistent ([@tsauerwein](https://github.com/tsauerwein))
* [#3186](https://github.com/openlayers/ol3/pull/3186) - Take the pixel ratio into account when clipping the layer ([@fredj](https://github.com/fredj))
* [#3183](https://github.com/openlayers/ol3/pull/3183) - Allow other params than 'mode' in example page query string. ([@htulipe](https://github.com/htulipe))
* [#2791](https://github.com/openlayers/ol3/pull/2791) - Re enable rotation button transition ([@fredj](https://github.com/fredj))
* [#3180](https://github.com/openlayers/ol3/pull/3180) - Add a getMap function to ol.FeatureOverlay (r=@ahocevar) ([@bartvde](https://github.com/bartvde))
* [#3176](https://github.com/openlayers/ol3/pull/3176) - Disallowed undefined rotation value ([@fredj](https://github.com/fredj))
* [#3177](https://github.com/openlayers/ol3/pull/3177) - Add example showing how to style polygon vertices ([@tsauerwein](https://github.com/tsauerwein))
* [#3174](https://github.com/openlayers/ol3/pull/3174) - Use view.getRotation or view.getResolution instead of view.getState ([@fredj](https://github.com/fredj))
* [#3170](https://github.com/openlayers/ol3/pull/3170) - Coding style ([@fredj](https://github.com/fredj))
* [#3108](https://github.com/openlayers/ol3/pull/3108) - Support skipping features in the WebGL renderer ([@tsauerwein](https://github.com/tsauerwein))
* [#3163](https://github.com/openlayers/ol3/pull/3163) - Use the layerStatesArray property from the frameState ([@fredj](https://github.com/fredj))
* [#3159](https://github.com/openlayers/ol3/pull/3159) - Don't pass specific options to the parent constructor ([@fredj](https://github.com/fredj))
* [#3066](https://github.com/openlayers/ol3/pull/3066) - Introduce hasFeatureAtPixel ([@tsauerwein](https://github.com/tsauerwein))
* [#3065](https://github.com/openlayers/ol3/pull/3065) - Add hit-detection support for WebGL ([@tsauerwein](https://github.com/tsauerwein))
* [#3128](https://github.com/openlayers/ol3/pull/3128) - Allow rendering of feature when download of icon failed ([@oterral](https://github.com/oterral))
* [#3156](https://github.com/openlayers/ol3/pull/3156) - Move readProjectionFrom* functions to the base classes ([@fredj](https://github.com/fredj))
* [#3107](https://github.com/openlayers/ol3/pull/3107) - Also listen on loading images ([@elemoine](https://github.com/elemoine))
* [#3153](https://github.com/openlayers/ol3/pull/3153) - Add missing GeoJSONFeature#bbox property ([@fredj](https://github.com/fredj))
* [#3154](https://github.com/openlayers/ol3/pull/3154) - Remove unnecessary newlines ([@fredj](https://github.com/fredj))
* [#3146](https://github.com/openlayers/ol3/pull/3146) - Enable tests for ol.geom.flat.reverse ([@icholy](https://github.com/icholy))
* [#3152](https://github.com/openlayers/ol3/pull/3152) - Update closure-library and closure-util version ([@fredj](https://github.com/fredj))
* [#3145](https://github.com/openlayers/ol3/pull/3145) - Add wrapX option to source.OSM and source.BingMaps ([@elemoine](https://github.com/elemoine))
* [#3139](https://github.com/openlayers/ol3/pull/3139) - Add ol.control.Control#setTarget ([@elemoine](https://github.com/elemoine))
* [#3144](https://github.com/openlayers/ol3/pull/3144) - Update CONTRIBUTING style guide with recent guidelines ([@bartvde](https://github.com/bartvde))
* [#3136](https://github.com/openlayers/ol3/pull/3136) - Use array.length = 0 instead of goog.array.clear ([@fredj](https://github.com/fredj))
* [#3140](https://github.com/openlayers/ol3/pull/3140) - Avoid use of goog.array.clone with arrays. ([@tschaub](https://github.com/tschaub))
* [#3122](https://github.com/openlayers/ol3/pull/3122) - Revert "Use offsetX and offsetY if available" ([@fredj](https://github.com/fredj))
* [#2385](https://github.com/openlayers/ol3/pull/2385) - Option to update vector layers while animating ([@ahocevar](https://github.com/ahocevar))
* [#3129](https://github.com/openlayers/ol3/pull/3129) - Only update the rbush item if the extent has changed ([@fredj](https://github.com/fredj))
* [#3117](https://github.com/openlayers/ol3/pull/3117) - Add pixelRatio support for DOM vector renderer ([@ahocevar](https://github.com/ahocevar))
* [#3124](https://github.com/openlayers/ol3/pull/3124) - Add a space between scale -value and -unit ([@sirtet](https://github.com/sirtet))
* [#3130](https://github.com/openlayers/ol3/pull/3130) - Document default value ([@fredj](https://github.com/fredj))
* [#3105](https://github.com/openlayers/ol3/pull/3105) - ol.geom.Geometry#getExtent re-factoring ([@fredj](https://github.com/fredj))
* [#3118](https://github.com/openlayers/ol3/pull/3118) - Bugfix: "Cannot read property 'firstElementChild' of null" (WFS) ([@naturalatlas](https://github.com/naturalatlas))
* [#3114](https://github.com/openlayers/ol3/pull/3114) - Specify node version in CONTRIBUTING.md ([@elemoine](https://github.com/elemoine))
* [#3106](https://github.com/openlayers/ol3/pull/3106) - Don't pass specific options to the parent constructor ([@fredj](https://github.com/fredj))
* [#3110](https://github.com/openlayers/ol3/pull/3110) - Use svg instead of png to get better image quality ([@PeterDaveHello](https://github.com/PeterDaveHello))
* [#2707](https://github.com/openlayers/ol3/pull/2707) - Generate source map of minified ol.js ([@gberaudo](https://github.com/gberaudo))
* [#3104](https://github.com/openlayers/ol3/pull/3104) - Don't pass renderBuffer option to the parent constructor ([@fredj](https://github.com/fredj))
* [#3096](https://github.com/openlayers/ol3/pull/3096) - popup example cleanup / simplification ([@fredj](https://github.com/fredj))
* [#3072](https://github.com/openlayers/ol3/pull/3072) - Optimize canvas hit detection by rendering features in a limited extent. ([@tschaub](https://github.com/tschaub))
* [#3101](https://github.com/openlayers/ol3/pull/3101) - Use bracket notation instead of goog.object functions. ([@tschaub](https://github.com/tschaub))
* [#3079](https://github.com/openlayers/ol3/pull/3079) - Exclude source files from docs. ([@tschaub](https://github.com/tschaub))
* [#3100](https://github.com/openlayers/ol3/pull/3100) - Assert that ol.layer.Tile#getPreload is always set ([@fredj](https://github.com/fredj))
* [#3084](https://github.com/openlayers/ol3/pull/3084) - Changes from the v3.1.x branch. ([@openlayers](https://github.com/openlayers))
* [#3094](https://github.com/openlayers/ol3/pull/3094) - Remove AUTHORS.md. ([@tschaub](https://github.com/tschaub))
* [#3089](https://github.com/openlayers/ol3/pull/3089) - Fixed URL link for test README ([@mike-mcgann](https://github.com/mike-mcgann))
* [#2894](https://github.com/openlayers/ol3/pull/2894) - Simplify CSS code in custom-controls example ([@fredj](https://github.com/fredj))
* [#3085](https://github.com/openlayers/ol3/pull/3085) - Fixed documentation typo for return value of ol.proj.Projection.isGlobal(). ([@mike-mcgann](https://github.com/mike-mcgann))
* [#3073](https://github.com/openlayers/ol3/pull/3073) - Make map's deviceOptions map options ([@ahocevar](https://github.com/ahocevar))

9
changelog/v3.2.1.md Normal file
View File

@@ -0,0 +1,9 @@
# 3.2.1
## Summary
This is a patch release that fixes a regression with the select interaction in the [3.2.0 release](https://github.com/openlayers/ol3/releases/tag/v3.2.0).
## Changes
* [#3236](https://github.com/openlayers/ol3/pull/3236) - Select the uppermost feature. ([@tschaub](https://github.com/tschaub))

51
changelog/v3.3.0.md Normal file
View File

@@ -0,0 +1,51 @@
## Upgrade notes
* The `ol.events.condition.mouseMove` function was replaced by `ol.events.condition.pointerMove` (see [#3281](https://github.com/openlayers/ol3/pull/3281)). For example, if you use `ol.events.condition.mouseMove` as the condition in a `Select` interaction then you now need to use `ol.events.condition.pointerMove`:
```js
var selectInteraction = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
// …
});
```
## Overview of all changes
* [#3263](https://github.com/openlayers/ol3/pull/3263) - Support ArcGIS Rest Services ([@cwgrant](https://github.com/cwgrant))
* [#3295](https://github.com/openlayers/ol3/pull/3295) - Add RESTful to WMTS GetCapabilities optionsFromCapabilities ([@sarametz](https://github.com/sarametz))
* [#3304](https://github.com/openlayers/ol3/pull/3304) - Remove scale line inner padding ([@fredj](https://github.com/fredj))
* [#3296](https://github.com/openlayers/ol3/pull/3296) - Add upgrade-notes.md file ([@elemoine](https://github.com/elemoine))
* [#3303](https://github.com/openlayers/ol3/pull/3303) - Add constant for us-ft units ([@ahocevar](https://github.com/ahocevar))
* [#3018](https://github.com/openlayers/ol3/pull/3018) - Add SelectEvent to interaction ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3301](https://github.com/openlayers/ol3/pull/3301) - Select interaction unit tests ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3298](https://github.com/openlayers/ol3/pull/3298) - Make ol.source.Source inherit from ol.Object ([@fredj](https://github.com/fredj))
* [#3297](https://github.com/openlayers/ol3/pull/3297) - Add getters to ol.source.WMTS ([@fredj](https://github.com/fredj))
* [#3281](https://github.com/openlayers/ol3/pull/3281) - Fix mouseMove event type comparison for IE10-11, pointermove ([@adube](https://github.com/adube))
* [#3293](https://github.com/openlayers/ol3/pull/3293) - Add missing opacity option for ol.style.IconOptions ([@ahocevar](https://github.com/ahocevar))
* [#3284](https://github.com/openlayers/ol3/pull/3284) - Fix jsdoc type for arrays of listening keys ([@fredj](https://github.com/fredj))
* [#3278](https://github.com/openlayers/ol3/pull/3278) - Add goog.provide for ol.DrawEventType ([@elemoine](https://github.com/elemoine))
* [#3272](https://github.com/openlayers/ol3/pull/3272) - Added getter function to return the wrapped source within the cluster ([@acanimal](https://github.com/acanimal))
* [#3275](https://github.com/openlayers/ol3/pull/3275) - Add ol.layer.Heatmap#blur getter and setter ([@fredj](https://github.com/fredj))
* [#3142](https://github.com/openlayers/ol3/pull/3142) - WMTS Get Cap document with updated WMTS.optionsFromCapabilities function ([@sarametz](https://github.com/sarametz))
* [#3271](https://github.com/openlayers/ol3/pull/3271) - [wip] Fix misplaced comment blocks ([@fredj](https://github.com/fredj))
* [#3273](https://github.com/openlayers/ol3/pull/3273) - Remove unused createGetTileIfLoadedFunction function. ([@tschaub](https://github.com/tschaub))
* [#3270](https://github.com/openlayers/ol3/pull/3270) - Make ol.Overlay autoPan default to false ([@elemoine](https://github.com/elemoine))
* [#3268](https://github.com/openlayers/ol3/pull/3268) - Fix autoPan in examples with ol.Overlay on hover ([@tsauerwein](https://github.com/tsauerwein))
* [#3256](https://github.com/openlayers/ol3/pull/3256) - Add autoPan option to ol.Overlay ([@tsauerwein](https://github.com/tsauerwein))
* [#3261](https://github.com/openlayers/ol3/pull/3261) - Fix forEachCorner extent, add TopLeft ([@adube](https://github.com/adube))
* [#3260](https://github.com/openlayers/ol3/pull/3260) - Remove unused goog.require ([@fredj](https://github.com/fredj))
* [#3246](https://github.com/openlayers/ol3/pull/3246) - Avoid creating unnecessary images in tile layers. ([@tschaub](https://github.com/tschaub))
* [#3254](https://github.com/openlayers/ol3/pull/3254) - Use lineCap, lineJoin and miterLimit stroke properties in RegularShape ([@fredj](https://github.com/fredj))
* [#3252](https://github.com/openlayers/ol3/pull/3252) - Avoid leaking global listenerSpy. ([@tschaub](https://github.com/tschaub))
* [#3248](https://github.com/openlayers/ol3/pull/3248) - Add tile loading events to image tile sources. ([@tschaub](https://github.com/tschaub))
* [#3240](https://github.com/openlayers/ol3/pull/3240) - Changes from the v3.2.x branch. ([@openlayers](https://github.com/openlayers))
* [#3233](https://github.com/openlayers/ol3/pull/3233) - Four small fixes. ([@stweil](https://github.com/stweil))
* [#3232](https://github.com/openlayers/ol3/pull/3232) - Fix typos found by codespell. ([@stweil](https://github.com/stweil))
* [#3231](https://github.com/openlayers/ol3/pull/3231) - Make ol.layer.Heatmap#radius configurable ([@fredj](https://github.com/fredj))
* [#3225](https://github.com/openlayers/ol3/pull/3225) - Respect attributions passed to TileJSON source. ([@tschaub](https://github.com/tschaub))
* [#3223](https://github.com/openlayers/ol3/pull/3223) - Resize the canvas when the tile size changes. ([@tschaub](https://github.com/tschaub))
* [#3224](https://github.com/openlayers/ol3/pull/3224) - Provide the ability to get the layer name from a MapQuest source ([@bartvde](https://github.com/bartvde))
* [#3222](https://github.com/openlayers/ol3/pull/3222) - Add geodesic option for measure ([@bartvde](https://github.com/bartvde))
* [#3221](https://github.com/openlayers/ol3/pull/3221) - Select the uppermost feature ([@fredj](https://github.com/fredj))
* [#3211](https://github.com/openlayers/ol3/pull/3211) - Bing https logo fix. ([@photostu](https://github.com/photostu))
* [#3215](https://github.com/openlayers/ol3/pull/3215) - Allow reuse of layer rendering code without creating a map. ([@tschaub](https://github.com/tschaub))

43
changelog/v3.4.0.md Normal file
View File

@@ -0,0 +1,43 @@
## Overview of all changes
* [#3383](https://github.com/openlayers/ol3/pull/3383) - GML3 tests time out in unit tests ([@bartvde](https://github.com/bartvde))
* [#3401](https://github.com/openlayers/ol3/pull/3401) - Allow GeoJSON to be serialized according to the right-hand rule. ([@tschaub](https://github.com/tschaub))
* [#3403](https://github.com/openlayers/ol3/pull/3403) - Remove unused goog.require ([@fredj](https://github.com/fredj))
* [#3362](https://github.com/openlayers/ol3/pull/3362) - Configure proj4 options and transforms upon construction ([@ahocevar](https://github.com/ahocevar))
* [#3394](https://github.com/openlayers/ol3/pull/3394) - Fix fullscreen pseudo CSS class name ([@fredj](https://github.com/fredj))
* [#3399](https://github.com/openlayers/ol3/pull/3399) - Clarify when widths need to be configured on a tile grid ([@ahocevar](https://github.com/ahocevar))
* [#3398](https://github.com/openlayers/ol3/pull/3398) - Make sure that the return value of wrapX() is stable ([@ahocevar](https://github.com/ahocevar))
* [#3396](https://github.com/openlayers/ol3/pull/3396) - Move the compare function out of ol.interaction.Modify.handleDownEvent_ ([@fredj](https://github.com/fredj))
* [#3395](https://github.com/openlayers/ol3/pull/3395) - ol.Interaction.Modify fixes ([@fperucic](https://github.com/fperucic))
* [#3387](https://github.com/openlayers/ol3/pull/3387) - Add wrapX option for ol.source.WMTS ([@ahocevar](https://github.com/ahocevar))
* [#3393](https://github.com/openlayers/ol3/pull/3393) - Remove unused define ([@fredj](https://github.com/fredj))
* [#3392](https://github.com/openlayers/ol3/pull/3392) - Fix switching class name of full-screen control ([@tsauerwein](https://github.com/tsauerwein))
* [#3391](https://github.com/openlayers/ol3/pull/3391) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#3388](https://github.com/openlayers/ol3/pull/3388) - Add new geometry layout option for polyline format ([@fredj](https://github.com/fredj))
* [#3385](https://github.com/openlayers/ol3/pull/3385) - Fix ol.tilegrid.TileGrid#getZForResolution ([@elemoine](https://github.com/elemoine))
* [#3377](https://github.com/openlayers/ol3/pull/3377) - Support wrapX for attributions ([@ahocevar](https://github.com/ahocevar))
* [#3382](https://github.com/openlayers/ol3/pull/3382) - Create github source links ([@ahocevar](https://github.com/ahocevar))
* [#3376](https://github.com/openlayers/ol3/pull/3376) - Add ol.source.Tile support for wrapping around the x-axis ([@ahocevar](https://github.com/ahocevar))
* [#3378](https://github.com/openlayers/ol3/pull/3378) - Clarify where to ask questions ([@ahocevar](https://github.com/ahocevar))
* [#3380](https://github.com/openlayers/ol3/pull/3380) - Test the GeoJSON layout ([@fredj](https://github.com/fredj))
* [#3360](https://github.com/openlayers/ol3/pull/3360) - Don't unlisten image twice when disposing an ol.ImageTile ([@fredj](https://github.com/fredj))
* [#3361](https://github.com/openlayers/ol3/pull/3361) - Listen on localhost to avoid phantomjs browsing 0.0.0.0 ([@ahocevar](https://github.com/ahocevar))
* [#3365](https://github.com/openlayers/ol3/pull/3365) - Better docs for #getPointResolution ([@ahocevar](https://github.com/ahocevar))
* [#3363](https://github.com/openlayers/ol3/pull/3363) - New ol.proj features ([@bill-chadwick](https://github.com/bill-chadwick))
* [#3305](https://github.com/openlayers/ol3/pull/3305) - Add image loading events to image sources (r=@ahocevar,@elemoine) ([@bartvde](https://github.com/bartvde))
* [#3343](https://github.com/openlayers/ol3/pull/3343) - Line arrows example ([@fredj](https://github.com/fredj))
* [#3354](https://github.com/openlayers/ol3/pull/3354) - Mark ol.format.GeoJSON#writeFeature(s) option param optional ([@fredj](https://github.com/fredj))
* [#3346](https://github.com/openlayers/ol3/pull/3346) - Set the 'properties' member to null if the feature has not properties ([@fredj](https://github.com/fredj))
* [#3344](https://github.com/openlayers/ol3/pull/3344) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#3237](https://github.com/openlayers/ol3/pull/3237) - Add circles to Draw interaction. ([@Morgul](https://github.com/Morgul))
* [#2691](https://github.com/openlayers/ol3/pull/2691) - Add will-change CSS properties ([@fredj](https://github.com/fredj))
* [#3336](https://github.com/openlayers/ol3/pull/3336) - Use ol.Map#getTargetElement function ([@fredj](https://github.com/fredj))
* [#3335](https://github.com/openlayers/ol3/pull/3335) - Update rbush to version 1.3.5 ([@fredj](https://github.com/fredj))
* [#3322](https://github.com/openlayers/ol3/pull/3322) - Remove unneeded map.isDef call ([@fredj](https://github.com/fredj))
* [#3327](https://github.com/openlayers/ol3/pull/3327) - Add css to dist directory ([@ahocevar](https://github.com/ahocevar))
* [#3324](https://github.com/openlayers/ol3/pull/3324) - Add interface definition for ol.SelectEvent ([@ahocevar](https://github.com/ahocevar))
* [#3315](https://github.com/openlayers/ol3/pull/3315) - Fix Tissot indicatrix example description ([@fredj](https://github.com/fredj))
* [#3312](https://github.com/openlayers/ol3/pull/3312) - Fix HiDPI support for ArcGIS REST ([@ahocevar](https://github.com/ahocevar))
* [#2910](https://github.com/openlayers/ol3/pull/2910) - Support multiple featureTpes in GML parser ([@bartvde](https://github.com/bartvde))
* [#3309](https://github.com/openlayers/ol3/pull/3309) - Fix select event always reporting as multi select ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3307](https://github.com/openlayers/ol3/pull/3307) - Handle all non-degree units in ol.control.ScaleLine ([@ahocevar](https://github.com/ahocevar))

View File

@@ -1,3 +1,3 @@
{ {
"library_url": "https://github.com/google/closure-library/archive/ad5e66c1e7d7829b0d77feae49aaf5f011265715.zip" "library_url": "https://github.com/google/closure-library/archive/0011afd534469ba111786fe68300a634e08a4d80.zip"
} }

View File

@@ -34,7 +34,7 @@
"cleverLinks": true, "cleverLinks": true,
"monospaceLinks": true, "monospaceLinks": true,
"default": { "default": {
"outputSourceFiles": true "outputSourceFiles": false
}, },
"applicationName": "OpenLayers 3" "applicationName": "OpenLayers 3"
}, },

View File

@@ -53,6 +53,21 @@ $(function () {
$(window).on('resize', _onResize); $(window).on('resize', _onResize);
_onResize(); _onResize();
// create source code links to github
var srcLinks = $('div.tag-source');
var masterSearch = window.location.href.match(/\/([^\/]*\/)apidoc\//);
if (masterSearch && masterSearch.length) {
var branch = masterSearch[1];
srcLinks.each(function(i, el) {
var textParts = el.innerHTML.trim().split(', ');
var link = 'https://github.com/openlayers/ol3/blob/' + branch +
textParts[0];
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
'<a href="' + link + textParts[1].replace('line ', '#l') + '">' +
textParts[1] + '</a>';
});
}
// show/hide unstable items // show/hide unstable items
var links = $('a[href^="ol."]'); var links = $('a[href^="ol."]');
var unstable = $('.unstable'); var unstable = $('.unstable');

View File

@@ -61,6 +61,8 @@
"compilation_level": "ADVANCED", "compilation_level": "ADVANCED",
"warning_level": "VERBOSE", "warning_level": "VERBOSE",
"use_types_for_optimization": true, "use_types_for_optimization": true,
"manage_closure_dependencies": true "manage_closure_dependencies": true,
"create_source_map": "build/ol.js.map",
"source_map_format": "V3"
} }
} }

View File

@@ -21,8 +21,12 @@
font-size: 10px; font-size: 10px;
text-align: center; text-align: center;
margin: 1px; margin: 1px;
padding: 0px 2px; will-change: contents, width;
} }
.ol-overlay-container {
will-change: left,right,top,bottom;
}
.ol-unsupported { .ol-unsupported {
display: none; display: none;
} }
@@ -53,11 +57,12 @@
.ol-rotate { .ol-rotate {
top: .5em; top: .5em;
right: .5em; right: .5em;
transition: opacity .25s; transition: opacity .25s linear, visibility 0s linear;
} }
.ol-rotate.ol-hidden { .ol-rotate.ol-hidden {
opacity: 0; opacity: 0;
display: none; visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
} }
.ol-zoom-extent { .ol-zoom-extent {
top: 4.643em; top: 4.643em;
@@ -101,6 +106,7 @@
display: block; display: block;
font-weight: normal; font-weight: normal;
font-size: 1.2em; font-size: 1.2em;
will-change: transform;
} }
.ol-touch .ol-control button { .ol-touch .ol-control button {
font-size: 1.5em; font-size: 1.5em;
@@ -114,21 +120,12 @@
background-color: #4c6079; background-color: #4c6079;
background-color: rgba(0,60,136,0.7); background-color: rgba(0,60,136,0.7);
} }
.ol-zoom-extent button:after {
content: "E";
}
.ol-zoom .ol-zoom-in { .ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0; border-radius: 2px 2px 0 0;
} }
.ol-zoom .ol-zoom-out { .ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;
} }
button.ol-full-screen-false:after {
content: "\2194";
}
button.ol-full-screen-true:after {
content: "\00d7";
}
.ol-attribution { .ol-attribution {

View File

@@ -12,3 +12,7 @@ For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutor
Make sure to also check out the [OpenLayers 3 workshop](../../../ol3-workshop/). Make sure to also check out the [OpenLayers 3 workshop](../../../ol3-workshop/).
Find additional reference material in the [API docs](../apidoc). Find additional reference material in the [API docs](../apidoc).
# Questions
If you cannot find an answer in the documentation, you can ask your question on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).

View File

@@ -55,6 +55,9 @@ var map = new ol.Map({
}) })
], ],
renderer: exampleNS.getRendererFromQueryString(), renderer: exampleNS.getRendererFromQueryString(),
// Improve user experience by loading tiles while animating. Will make
// animations stutter on mobile or slow devices.
loadTilesWhileAnimating: true,
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: /** @type {olx.control.AttributionOptions} */ ({

View File

@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Tiled ArcGIS MapServer example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Tiled ArcGIS MapServer example</h4>
<p id="shortdesc">Example of a tiled ArcGIS layer.</p>
<div id="docs">
<p>See the <a href="arcgis-tiled.js" target="_blank">arcgis-tiled.js source</a> to see how this is done.</p>
</div>
<div id="tags">arcgis, tile, tilelayer</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=arcgis-tiled" type="text/javascript"></script>
</body>
</html>

28
examples/arcgis-tiled.js Normal file
View File

@@ -0,0 +1,28 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileArcGISRest({
url: url
})
})
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
center: [-10997148, 4569099],
zoom: 4
})
});

View File

@@ -29,6 +29,9 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
var map = new ol.Map({ var map = new ol.Map({
layers: layers, layers: layers,
renderer: exampleNS.getRendererFromQueryString(), renderer: exampleNS.getRendererFromQueryString(),
// Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true,
target: 'map', target: 'map',
view: new ol.View({ view: new ol.View({
center: [-6655.5402445057125, 6709968.258934638], center: [-6655.5402445057125, 6709968.258934638],

View File

@@ -1,7 +1,6 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.events.condition'); goog.require('ol.events.condition');
goog.require('ol.interaction');
goog.require('ol.interaction.DragBox'); goog.require('ol.interaction.DragBox');
goog.require('ol.interaction.Select'); goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');

View File

@@ -10,39 +10,12 @@
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css"> <link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style type="text/css"> <style type="text/css">
.rotate-north { .rotate-north {
position: absolute;
top: 65px; top: 65px;
left: 8px; left: .5em;
background: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
} }
.ol-touch .rotate-north { .ol-touch .rotate-north {
top: 80px; top: 80px;
} }
.rotate-north a {
display: block;
color: white;
font-size: 16px;
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
font-weight: bold;
margin: 1px;
text-decoration: none;
text-align: center;
border-radius: 2px;
height: 22px;
width: 22px;
background: rgba(0,60,136,0.5);
}
.ol-touch .rotate-north a {
font-size: 20px;
height: 30px;
width: 30px;
line-height: 26px;
}
.rotate-north a:hover {
background: rgba(0,60,136,0.7);
}
</style> </style>
<title>ol3 custom controls example</title> <title>ol3 custom controls example</title>
</head> </head>

View File

@@ -29,23 +29,20 @@ app.RotateNorthControl = function(opt_options) {
var options = opt_options || {}; var options = opt_options || {};
var anchor = document.createElement('a'); var button = document.createElement('button');
anchor.href = '#rotate-north'; button.innerHTML = 'N';
anchor.innerHTML = 'N';
var this_ = this; var this_ = this;
var handleRotateNorth = function(e) { var handleRotateNorth = function(e) {
// prevent #rotate-north anchor from getting appended to the url
e.preventDefault();
this_.getMap().getView().setRotation(0); this_.getMap().getView().setRotation(0);
}; };
anchor.addEventListener('click', handleRotateNorth, false); button.addEventListener('click', handleRotateNorth, false);
anchor.addEventListener('touchstart', handleRotateNorth, false); button.addEventListener('touchstart', handleRotateNorth, false);
var element = document.createElement('div'); var element = document.createElement('div');
element.className = 'rotate-north ol-unselectable'; element.className = 'rotate-north ol-unselectable ol-control';
element.appendChild(anchor); element.appendChild(button);
ol.control.Control.call(this, { ol.control.Control.call(this, {
element: element, element: element,

View File

@@ -1,96 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0"> <Capabilities version="1.0.0" xmlns="http://www.opengis.net/wmts/1.0" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd">
<ows:ServiceIdentification> <ows:ServiceIdentification>
<ows:Title>Web Map Tile Service</ows:Title> <ows:Title>Koordinates Labs</ows:Title>
<ows:ServiceType>OGC WMTS</ows:ServiceType> <ows:ServiceType>OGC WMTS</ows:ServiceType>
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion> <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
<ows:Fees>none</ows:Fees>
<ows:AccessConstraints>http://data.wien.gv.at/nutzungsbedingungen</ows:AccessConstraints>
</ows:ServiceIdentification> </ows:ServiceIdentification>
<ows:ServiceProvider> <ows:ServiceProvider>
<ows:ProviderName>Magistrat Wien</ows:ProviderName> <ows:ProviderName>Koordinates</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.wien.gv.at"/> <ows:ProviderSite xlink:href="http://labs.koordinates.com"/>
<ows:ServiceContact> <ows:ServiceContact/>
<ows:IndividualName>Gerhard Sommer</ows:IndividualName>
</ows:ServiceContact>
</ows:ServiceProvider> </ows:ServiceProvider>
<ows:OperationsMetadata> <ows:OperationsMetadata>
<ows:Operation name="GetCapabilities"> <ows:Operation name="GetCapabilities">
<ows:DCP> <ows:DCP>
<ows:HTTP> <ows:HTTP>
<ows:Get xlink:href="http://maps.wien.gv.at/wmts"> <ows:Get xlink:href="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/WMTSCapabilities.xml?">
<ows:Constraint name="GetEncoding"> <ows:Constraint name="GetEncoding">
<ows:AllowedValues> <ows:AllowedValues>
<ows:Value>RESTful</ows:Value> <ows:Value>KVP</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps1.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps2.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps3.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps4.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues> </ows:AllowedValues>
</ows:Constraint> </ows:Constraint>
</ows:Get> </ows:Get>
</ows:HTTP> </ows:HTTP>
</ows:DCP> </ows:DCP>
</ows:Operation> </ows:Operation>
<ows:Operation name="GetTile"> <ows:Operation name="GetFeatureInfo">
<ows:DCP> <ows:DCP>
<ows:HTTP> <ows:HTTP>
<ows:Get xlink:href="http://maps.wien.gv.at/wmts"> <ows:Get xlink:href="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/?">
<ows:Constraint name="GetEncoding"> <ows:Constraint name="GetEncoding">
<ows:AllowedValues> <ows:AllowedValues>
<ows:Value>RESTful</ows:Value> <ows:Value>KVP</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps1.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps2.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps3.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps4.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues> </ows:AllowedValues>
</ows:Constraint> </ows:Constraint>
</ows:Get> </ows:Get>
@@ -100,93 +40,40 @@
</ows:OperationsMetadata> </ows:OperationsMetadata>
<Contents> <Contents>
<Layer> <Layer>
<ows:Title>Luftbild</ows:Title> <ows:Title>New Zealand Earthquakes</ows:Title>
<ows:Abstract>Historical earthquake data, accessed via the [GeoNet WFS feed](http://info.geonet.org.nz/display/appdata/Advanced+Queries). The data has been filtered to only include quakes in proximity to New Zealand with an `eventtype` of &quot;Earthquake&quot; or &quot;none&quot; per the [GeoNet catalogue](http://info.geonet.org.nz/display/appdata/Catalogue+Output). Most fields have been removed. Please also note the excluded data per this [GeoNet page](http://info.geonet.org.nz/display/appdata/The+Gap). We acknowledge the New Zealand GeoNet project and its sponsors EQC, GNS Science and LINZ, for providing data used in this layer.</ows:Abstract>
<ows:Identifier>layer-7328</ows:Identifier>
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3857">
<ows:LowerCorner>-20037508.342789 -6406581.708337</ows:LowerCorner>
<ows:UpperCorner>20037508.342789 -3653545.667928</ows:UpperCorner>
</ows:BoundingBox>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84"> <ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner> <ows:LowerCorner>-180.000000 -49.454297</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner> <ows:UpperCorner>180.000000 -31.160000</ows:UpperCorner>
</ows:WGS84BoundingBox> </ows:WGS84BoundingBox>
<ows:Identifier>lb</ows:Identifier>
<Style isDefault="true"> <Style isDefault="true">
<ows:Identifier>farbe</ows:Identifier> <ows:Title>Weighted point styles</ows:Title>
</Style> <ows:Identifier>style=39</ows:Identifier>
<Format>image/jpeg</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/jpeg" template="http://maps1.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps2.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps3.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps4.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
</Layer>
<Layer>
<ows:Title>MZK Flächen</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>fmzk</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>pastell</ows:Identifier>
</Style>
<Format>image/jpeg</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/jpeg" template="http://maps1.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps2.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps3.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps4.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
</Layer>
<Layer>
<ows:Title>Flächenwidmungs- und Bebauungsplan</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>flwbplmzk</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>rot</ows:Identifier>
</Style>
<Format>image/jpeg</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/jpeg" template="http://maps1.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps2.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps3.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps4.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
</Layer>
<Layer>
<ows:Title>Beschriftung</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>beschriftung</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>normal</ows:Identifier>
</Style> </Style>
<Format>image/png</Format> <Format>image/png</Format>
<InfoFormat>application/json</InfoFormat>
<InfoFormat>text/html</InfoFormat>
<TileMatrixSetLink> <TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet> <TileMatrixSet>EPSG:3857</TileMatrixSet>
</TileMatrixSetLink> </TileMatrixSetLink>
<ResourceURL format="image/png" template="http://maps1.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/> <ResourceURL format="image/png" resourceType="tile" template="https://koordinates-tiles-a.global.ssl.fastly.net/services;key=d740ea02e0c44cafb70dce31a774ca10/tiles/v4/layer=7328,{style}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png"/>
<ResourceURL format="image/png" template="http://maps2.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/> <ResourceURL format="application/json" resourceType="FeatureInfo" template="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/featureinfo/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}/{I}/{J}.json"/>
<ResourceURL format="image/png" template="http://maps3.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/> <ResourceURL format="text/html" resourceType="FeatureInfo" template="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/featureinfo/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}/{I}/{J}.html"/>
<ResourceURL format="image/png" template="http://maps4.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
<ResourceURL format="image/png" template="http://maps.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
</Layer> </Layer>
<TileMatrixSet> <TileMatrixSet>
<!-- -180 85.05112878 --> <ows:Title>GoogleMapsCompatible</ows:Title>
<ows:Identifier>google3857</ows:Identifier> <ows:Abstract>The well-known 'GoogleMapsCompatible' tile matrix set defined by the OGC WMTS specification</ows:Abstract>
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG:6.18:3:3857"> <ows:Identifier>EPSG:3857</ows:Identifier>
<ows:LowerCorner>1799448.394855 6124949.747770</ows:LowerCorner> <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3857">
<ows:UpperCorner>1848250.442089 6162571.828177</ows:UpperCorner> <ows:LowerCorner>-20037508.342789 -20037508.342789</ows:LowerCorner>
<ows:UpperCorner>20037508.342789 20037508.342789</ows:UpperCorner>
</ows:BoundingBox> </ows:BoundingBox>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG:6.18:3:3857</ows:SupportedCRS> <ows:SupportedCRS>urn:ogc:def:crs:EPSG::3857</ows:SupportedCRS>
<WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet> <WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet>
<TileMatrix> <TileMatrix>
<ows:Identifier>0</ows:Identifier> <ows:Identifier>0</ows:Identifier>
@@ -199,7 +86,7 @@
</TileMatrix> </TileMatrix>
<TileMatrix> <TileMatrix>
<ows:Identifier>1</ows:Identifier> <ows:Identifier>1</ows:Identifier>
<ScaleDenominator>279541132.015</ScaleDenominator> <ScaleDenominator>279541132.014</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner> <TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth> <TileWidth>256</TileWidth>
<TileHeight>256</TileHeight> <TileHeight>256</TileHeight>
@@ -253,7 +140,7 @@
</TileMatrix> </TileMatrix>
<TileMatrix> <TileMatrix>
<ows:Identifier>7</ows:Identifier> <ows:Identifier>7</ows:Identifier>
<ScaleDenominator>4367830.18773</ScaleDenominator> <ScaleDenominator>4367830.18772</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner> <TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth> <TileWidth>256</TileWidth>
<TileHeight>256</TileHeight> <TileHeight>256</TileHeight>
@@ -334,7 +221,7 @@
</TileMatrix> </TileMatrix>
<TileMatrix> <TileMatrix>
<ows:Identifier>16</ows:Identifier> <ows:Identifier>16</ows:Identifier>
<ScaleDenominator>8530.91833540</ScaleDenominator> <ScaleDenominator>8530.9183354</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner> <TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth> <TileWidth>256</TileWidth>
<TileHeight>256</TileHeight> <TileHeight>256</TileHeight>
@@ -343,7 +230,7 @@
</TileMatrix> </TileMatrix>
<TileMatrix> <TileMatrix>
<ows:Identifier>17</ows:Identifier> <ows:Identifier>17</ows:Identifier>
<ScaleDenominator>4265.45916770</ScaleDenominator> <ScaleDenominator>4265.4591677</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner> <TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth> <TileWidth>256</TileWidth>
<TileHeight>256</TileHeight> <TileHeight>256</TileHeight>
@@ -361,14 +248,32 @@
</TileMatrix> </TileMatrix>
<TileMatrix> <TileMatrix>
<ows:Identifier>19</ows:Identifier> <ows:Identifier>19</ows:Identifier>
<ScaleDenominator>1066.36479193</ScaleDenominator> <ScaleDenominator>1066.36479192</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner> <TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth> <TileWidth>256</TileWidth>
<TileHeight>256</TileHeight> <TileHeight>256</TileHeight>
<MatrixWidth>524288</MatrixWidth> <MatrixWidth>524288</MatrixWidth>
<MatrixHeight>524288</MatrixHeight> <MatrixHeight>524288</MatrixHeight>
</TileMatrix> </TileMatrix>
<TileMatrix>
<ows:Identifier>20</ows:Identifier>
<ScaleDenominator>533.182395962</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1048576</MatrixWidth>
<MatrixHeight>1048576</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>21</ows:Identifier>
<ScaleDenominator>266.591197981</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2097152</MatrixWidth>
<MatrixHeight>2097152</MatrixHeight>
</TileMatrix>
</TileMatrixSet> </TileMatrixSet>
</Contents> </Contents>
<ServiceMetadataURL xlink:href="http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml"/> <ServiceMetadataURL xlink:href="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/WMTSCapabilities.xml"/>
</Capabilities> </Capabilities>

BIN
examples/data/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

View File

@@ -145,7 +145,10 @@ var displayFeatureInfo = function(pixel) {
} }
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent); var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel); displayFeatureInfo(pixel);
}); });

View File

@@ -141,7 +141,10 @@ var displayFeatureInfo = function(pixel) {
} }
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent); var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel); displayFeatureInfo(pixel);
}); });

View File

@@ -2,7 +2,6 @@ goog.require('ol.FeatureOverlay');
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.events.condition'); goog.require('ol.events.condition');
goog.require('ol.interaction');
goog.require('ol.interaction.Draw'); goog.require('ol.interaction.Draw');
goog.require('ol.interaction.Modify'); goog.require('ol.interaction.Modify');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');

View File

@@ -40,6 +40,7 @@
<option value="Point">Point</option> <option value="Point">Point</option>
<option value="LineString">LineString</option> <option value="LineString">LineString</option>
<option value="Polygon">Polygon</option> <option value="Polygon">Polygon</option>
<option value="Circle">Circle</option>
</select> </select>
</form> </form>

View File

@@ -1,6 +1,5 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.Draw'); goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');

View File

@@ -15,7 +15,7 @@
.map:-webkit-full-screen { .map:-webkit-full-screen {
height: 100%; height: 100%;
} }
.map:full-screen { .map:fullscreen {
height: 100%; height: 100%;
} }
</style> </style>

View File

@@ -18,7 +18,7 @@
.map:-ms-fullscreen { .map:-ms-fullscreen {
height: 100%; height: 100%;
} }
.map:full-screen { .map:fullscreen {
height: 100%; height: 100%;
} }
.ol-rotate { .ol-rotate {

View File

@@ -35,9 +35,11 @@
<h4 id="title">GetFeatureInfo example (image layer)</h4> <h4 id="title">GetFeatureInfo example (image layer)</h4>
<p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer.</p> <p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer.</p>
<div id="docs"> <div id="docs">
<p>Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse
pointer when hovering a non-transparent pixel on the map.</p>
<p>See the <a href="getfeatureinfo-image.js" target="_blank">getfeatureinfo-image.js source</a> to see how this is done.</p> <p>See the <a href="getfeatureinfo-image.js" target="_blank">getfeatureinfo-image.js source</a> to see how this is done.</p>
</div> </div>
<div id="tags">getfeatureinfo</div> <div id="tags">getfeatureinfo, forEachLayerAtPixel</div>
</div> </div>
<div class="span4 offset4"> <div class="span4 offset4">
<div id="info" class="alert alert-success"> <div id="info" class="alert alert-success">

View File

@@ -7,7 +7,8 @@ goog.require('ol.source.ImageWMS');
var wmsSource = new ol.source.ImageWMS({ var wmsSource = new ol.source.ImageWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'}, params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver' serverType: 'geoserver',
crossOrigin: ''
}); });
var wmsLayer = new ol.layer.Image({ var wmsLayer = new ol.layer.Image({
@@ -20,6 +21,7 @@ var view = new ol.View({
}); });
var map = new ol.Map({ var map = new ol.Map({
renderer: exampleNS.getRendererFromQueryString(),
layers: [wmsLayer], layers: [wmsLayer],
target: 'map', target: 'map',
view: view view: view
@@ -36,3 +38,14 @@ map.on('singleclick', function(evt) {
'<iframe seamless src="' + url + '"></iframe>'; '<iframe seamless src="' + url + '"></iframe>';
} }
}); });
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
var hit = map.forEachLayerAtPixel(pixel, function(layer) {
return true;
});
map.getTargetElement().style.cursor = hit ? 'pointer' : '';
});

View File

@@ -35,9 +35,11 @@
<h4 id="title">WMS GetFeatureInfo example (tile layer)</h4> <h4 id="title">WMS GetFeatureInfo example (tile layer)</h4>
<p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer.</p> <p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer.</p>
<div id="docs"> <div id="docs">
<p>Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse
pointer when hovering a non-transparent pixel on the map.</p>
<p>See the <a href="getfeatureinfo-tile.js" target="_blank">getfeatureinfo-tile.js source</a> to see how this is done.</p> <p>See the <a href="getfeatureinfo-tile.js" target="_blank">getfeatureinfo-tile.js source</a> to see how this is done.</p>
</div> </div>
<div id="tags">getfeatureinfo</div> <div id="tags">getfeatureinfo, forEachLayerAtPixel</div>
</div> </div>
<div class="span4 offset4"> <div class="span4 offset4">
<div id="info" class="alert alert-success"> <div id="info" class="alert alert-success">

View File

@@ -7,7 +7,8 @@ goog.require('ol.source.TileWMS');
var wmsSource = new ol.source.TileWMS({ var wmsSource = new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'}, params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver' serverType: 'geoserver',
crossOrigin: ''
}); });
var wmsLayer = new ol.layer.Tile({ var wmsLayer = new ol.layer.Tile({
@@ -20,6 +21,7 @@ var view = new ol.View({
}); });
var map = new ol.Map({ var map = new ol.Map({
renderer: exampleNS.getRendererFromQueryString(),
layers: [wmsLayer], layers: [wmsLayer],
target: 'map', target: 'map',
view: view view: view
@@ -36,3 +38,14 @@ map.on('singleclick', function(evt) {
'<iframe seamless src="' + url + '"></iframe>'; '<iframe seamless src="' + url + '"></iframe>';
} }
}); });
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
var hit = map.forEachLayerAtPixel(pixel, function(layer) {
return true;
});
map.getTargetElement().style.cursor = hit ? 'pointer' : '';
});

View File

@@ -85,7 +85,10 @@ var displayFeatureInfo = function(pixel) {
} }
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent); var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel); displayFeatureInfo(pixel);
}); });

View File

@@ -29,7 +29,7 @@
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span8">
<h4 id="title">Earthquakes heatmap</h4> <h4 id="title">Earthquakes heatmap</h4>
<p id="shortdesc">Demonstrates the use of a heatmap layer.</p> <p id="shortdesc">Demonstrates the use of a heatmap layer.</p>
<div id="docs"> <div id="docs">
@@ -40,9 +40,18 @@
</div> </div>
<div id="tags">heatmap, kml, vector, style</div> <div id="tags">heatmap, kml, vector, style</div>
</div> </div>
<div class="span4">
<form>
<label>radius size</label>
<input id="radius" type="range" min="1" max="50" step="1" value="5"/>
<label>blur size</label>
<input id="blur" type="range" min="1" max="50" step="1" value="15"/>
</form>
</div> </div>
</div> </div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script> <script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=heatmap-earthquakes" type="text/javascript"></script> <script src="loader.js?id=heatmap-earthquakes" type="text/javascript"></script>

View File

@@ -5,6 +5,8 @@ goog.require('ol.layer.Tile');
goog.require('ol.source.KML'); goog.require('ol.source.KML');
goog.require('ol.source.Stamen'); goog.require('ol.source.Stamen');
var blur = $('#blur');
var radius = $('#radius');
var vector = new ol.layer.Heatmap({ var vector = new ol.layer.Heatmap({
source: new ol.source.KML({ source: new ol.source.KML({
@@ -12,7 +14,8 @@ var vector = new ol.layer.Heatmap({
projection: 'EPSG:3857', projection: 'EPSG:3857',
url: 'data/kml/2012_Earthquakes_Mag5.kml' url: 'data/kml/2012_Earthquakes_Mag5.kml'
}), }),
radius: 5 blur: parseInt(blur.val(), 10),
radius: parseInt(radius.val(), 10)
}); });
vector.getSource().on('addfeature', function(event) { vector.getSource().on('addfeature', function(event) {
@@ -38,3 +41,12 @@ var map = new ol.Map({
zoom: 2 zoom: 2
}) })
}); });
blur.on('input', function() {
vector.setBlur(parseInt(blur.val(), 10));
});
radius.on('input', function() {
vector.setRadius(parseInt(radius.val(), 10));
});

View File

@@ -30,7 +30,7 @@
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span8">
<h4 id="title">Icon sprite with WebGL example</h4> <h4 id="title">Icon sprite with WebGL example</h4>
<p id="shortdesc">Icon sprite with WebGL.</p> <p id="shortdesc">Icon sprite with WebGL.</p>
<div id="docs"> <div id="docs">
@@ -39,6 +39,11 @@
</div> </div>
<div id="tags">webgl, icon, sprite, vector, point</div> <div id="tags">webgl, icon, sprite, vector, point</div>
</div> </div>
<div class="span2 offset2">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div> </div>

View File

@@ -109,3 +109,34 @@ var featureOverlay = new ol.FeatureOverlay({
}), }),
features: overlayFeatures features: overlayFeatures
}); });
map.on('click', function(evt) {
var info = document.getElementById('info');
info.innerHTML =
'Hold on a second, while I catch those butterflies for you ...';
window.setTimeout(function() {
var features = [];
map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) {
features.push(features);
return false;
});
if (features.length === 1) {
info.innerHTML = 'Got one butterfly';
} else if (features.length > 1) {
info.innerHTML = 'Got ' + features.length + ' butterflies';
} else {
info.innerHTML = 'Couldn\'t catch a single butterfly';
}
}, 1);
});
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
var hit = map.hasFeatureAtPixel(pixel);
map.getTarget().style.cursor = hit ? 'pointer' : '';
});

View File

@@ -40,11 +40,13 @@ var vectorLayer = new ol.layer.Vector({
var rasterLayer = new ol.layer.Tile({ var rasterLayer = new ol.layer.Tile({
source: new ol.source.TileJSON({ source: new ol.source.TileJSON({
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.jsonp' url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.jsonp',
crossOrigin: ''
}) })
}); });
var map = new ol.Map({ var map = new ol.Map({
renderer: exampleNS.getRendererFromQueryString(),
layers: [rasterLayer, vectorLayer], layers: [rasterLayer, vectorLayer],
target: document.getElementById('map'), target: document.getElementById('map'),
view: new ol.View({ view: new ol.View({
@@ -84,14 +86,12 @@ map.on('click', function(evt) {
}); });
// change mouse cursor when over marker // change mouse cursor when over marker
$(map.getViewport()).on('mousemove', function(e) { map.on('pointermove', function(e) {
var pixel = map.getEventPixel(e.originalEvent); if (e.dragging) {
var hit = map.forEachFeatureAtPixel(pixel, function(feature, layer) { $(element).popover('destroy');
return true; return;
});
if (hit) {
map.getTarget().style.cursor = 'pointer';
} else {
map.getTarget().style.cursor = '';
} }
var pixel = map.getEventPixel(e.originalEvent);
var hit = map.hasFeatureAtPixel(pixel);
map.getTarget().style.cursor = hit ? 'pointer' : '';
}); });

View File

@@ -126,7 +126,10 @@ var displaySnap = function(coordinate) {
map.render(); map.render();
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var coordinate = map.getEventCoordinate(evt.originalEvent); var coordinate = map.getEventCoordinate(evt.originalEvent);
displaySnap(coordinate); displaySnap(coordinate);
}); });

View File

@@ -0,0 +1,79 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Image load events example</title>
<style>
.map {
background: #E0ECED;
}
.wrapper {
position: relative;
}
#progress {
position: absolute;
bottom: 0;
left: 0;
height: 2px;
background: rgba(0, 60, 136, 0.4);
width: 0;
transition: width 250ms;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 wrapper">
<div id="map" class="map"></div>
<div id="progress"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Image load events example</h4>
<p id="shortdesc">Example using image load events.</p>
<div id="docs">
<p>
Image sources fire events related to image loading. You can
listen for <code>imageloadstart</code>, <code>imageloadend</code>,
and <code>imageloaderror</code> type events to monitor image loading
progress. This example registers listeners for these events and
renders an image loading progress bar at the bottom of the map.
</p>
<p>
See the <a href="image-load-events.js" target="_blank">image-load-events.js source</a>
for more detail on how this is done.
</p>
</div>
<div id="tags">image, events, loading</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=image-load-events" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,105 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.source.ImageWMS');
/**
* Renders a progress bar.
* @param {Element} el The target element.
* @constructor
*/
function Progress(el) {
this.el = el;
this.loading = 0;
this.loaded = 0;
}
/**
* Increment the count of loading tiles.
*/
Progress.prototype.addLoading = function() {
if (this.loading === 0) {
this.show();
}
++this.loading;
this.update();
};
/**
* Increment the count of loaded tiles.
*/
Progress.prototype.addLoaded = function() {
setTimeout(function() {
++this.loaded;
this.update();
}.bind(this), 100);
};
/**
* Update the progress bar.
*/
Progress.prototype.update = function() {
var width = (this.loaded / this.loading * 100).toFixed(1) + '%';
this.el.style.width = width;
if (this.loading === this.loaded) {
this.loading = 0;
this.loaded = 0;
setTimeout(this.hide.bind(this), 500);
}
};
/**
* Show the progress bar.
*/
Progress.prototype.show = function() {
this.el.style.visibility = 'visible';
};
/**
* Hide the progress bar.
*/
Progress.prototype.hide = function() {
if (this.loading === this.loaded) {
this.el.style.visibility = 'hidden';
this.el.style.width = 0;
}
};
var progress = new Progress(document.getElementById('progress'));
var source = new ol.source.ImageWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {'LAYERS': 'topp:states'},
serverType: 'geoserver'
});
source.on('imageloadstart', function(event) {
progress.addLoading();
});
source.on('imageloadend', function(event) {
progress.addLoaded();
});
source.on('imageloaderror', function(event) {
progress.addLoaded();
});
var map = new ol.Map({
logo: false,
layers: [
new ol.layer.Image({source: source})
],
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [-10997148, 4569099],
zoom: 4
})
});

View File

@@ -80,7 +80,10 @@ var displayFeatureInfo = function(pixel) {
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent); var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel); displayFeatureInfo(pixel);
}); });

View File

@@ -85,7 +85,11 @@ var displayFeatureInfo = function(pixel) {
} }
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
info.tooltip('hide');
return;
}
displayFeatureInfo(map.getEventPixel(evt.originalEvent)); displayFeatureInfo(map.getEventPixel(evt.originalEvent));
}); });

View File

@@ -92,7 +92,11 @@ var displayFeatureInfo = function(pixel) {
} }
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
info.tooltip('hide');
return;
}
displayFeatureInfo(map.getEventPixel(evt.originalEvent)); displayFeatureInfo(map.getEventPixel(evt.originalEvent));
}); });

View File

@@ -52,7 +52,10 @@ var displayFeatureInfo = function(pixel) {
} }
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent); var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel); displayFeatureInfo(pixel);
}); });

51
examples/line-arrows.html Normal file
View File

@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>LineString arrows example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">LineString arrows example</h4>
<p id="shortdesc">Example of drawing arrows for each line string segment.</p>
<div id="docs">
<p>See the <a href="line-arrows.js" target="_blank">line-arrows.js source</a> to see how this is done.</p>
</div>
<div id="tags">draw, vector, arrow</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=line-arrows" type="text/javascript"></script>
</body>
</html>

67
examples/line-arrows.js Normal file
View File

@@ -0,0 +1,67 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
});
var source = new ol.source.Vector();
var styleFunction = function(feature, resolution) {
var geometry = feature.getGeometry();
var styles = [
// linestring
new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#ffcc33',
width: 2
})
})
];
geometry.forEachSegment(function(start, end) {
var dx = end[0] - start[0];
var dy = end[1] - start[1];
var rotation = Math.atan2(dy, dx);
// arrows
styles.push(new ol.style.Style({
geometry: new ol.geom.Point(end),
image: new ol.style.Icon({
src: 'data/arrow.png',
anchor: [0.75, 0.5],
rotateWithView: false,
rotation: -rotation
})
}));
});
return styles;
};
var vector = new ol.layer.Vector({
source: source,
style: styleFunction
});
var map = new ol.Map({
layers: [raster, vector],
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [-11000000, 4600000],
zoom: 4
})
});
map.addInteraction(new ol.interaction.Draw({
source: source,
type: /** @type {ol.geom.GeometryType} */ ('LineString')
}));

View File

@@ -9,6 +9,40 @@
<link rel="stylesheet" href="../resources/layout.css" type="text/css"> <link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css"> <link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Measure example</title> <title>Measure example</title>
<style>
.tooltip {
position: relative;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px;
color: white;
padding: 4px 8px;
opacity: 0.7;
white-space: nowrap;
}
.tooltip-measure {
opacity: 1;
font-weight: bold;
}
.tooltip-static {
background-color: #ffcc33;
color: black;
border: 1px solid white;
}
.tooltip-measure:before,
.tooltip-static:before {
border-top: 6px solid rgba(0, 0, 0, 0.5);
border-right: 6px solid transparent;
border-left: 6px solid transparent;
content: "";
position: absolute;
bottom: -6px;
margin-left: -7px;
left: 50%;
}
.tooltip-static:before {
border-top-color: #ffcc33;
}
</style>
</head> </head>
<body> <body>
@@ -41,12 +75,11 @@
<option value="length">Length</option> <option value="length">Length</option>
<option value="area">Area</option> <option value="area">Area</option>
</select> </select>
<label class="checkbox"><input type="checkbox" id="geodesic"/>use geodesic measures</label>
</form> </form>
<ol id="measureOutput" reversed></ol>
<div id="docs"> <div id="docs">
<p><i>NOTE: Measure is done in simple way on projected plane. Earth <p><i>NOTE: If use geodesic measures is not checked, measure is done in simple way on projected plane. Earth
curvature is not taken into account</i></p> curvature is not taken into account</i></p>
<p>See the <a href="measure.js" target="_blank">measure.js source</a> to see how this is done.</p> <p>See the <a href="measure.js" target="_blank">measure.js source</a> to see how this is done.</p>
</div> </div>

View File

@@ -1,11 +1,13 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.Overlay');
goog.require('ol.Sphere');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.geom.LineString'); goog.require('ol.geom.LineString');
goog.require('ol.geom.Polygon'); goog.require('ol.geom.Polygon');
goog.require('ol.interaction');
goog.require('ol.interaction.Draw'); goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.MapQuest'); goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector'); goog.require('ol.source.Vector');
goog.require('ol.style.Circle'); goog.require('ol.style.Circle');
@@ -13,6 +15,9 @@ goog.require('ol.style.Fill');
goog.require('ol.style.Stroke'); goog.require('ol.style.Stroke');
goog.require('ol.style.Style'); goog.require('ol.style.Style');
var wgs84Sphere = new ol.Sphere(6378137);
var raster = new ol.layer.Tile({ var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'}) source: new ol.source.MapQuest({layer: 'sat'})
}); });
@@ -40,35 +45,85 @@ var vector = new ol.layer.Vector({
/** /**
* Currently drawed feature * Currently drawn feature.
* @type {ol.Feature} * @type {ol.Feature}
*/ */
var sketch; var sketch;
/** /**
* Element for currently drawed feature * The help tooltip element.
* @type {Element} * @type {Element}
*/ */
var sketchElement; var helpTooltipElement;
/** /**
* handle pointer move * Overlay to show the help messages.
* @param {Event} evt * @type {ol.Overlay}
*/ */
var mouseMoveHandler = function(evt) { var helpTooltip;
/**
* The measure tooltip element.
* @type {Element}
*/
var measureTooltipElement;
/**
* Overlay to show the measurement.
* @type {ol.Overlay}
*/
var measureTooltip;
/**
* Message to show when the user is drawing a polygon.
* @type {string}
*/
var continuePolygonMsg = 'Click to continue drawing the polygon';
/**
* Message to show when the user is drawing a line.
* @type {string}
*/
var continueLineMsg = 'Click to continue drawing the line';
/**
* Handle pointer move.
* @param {ol.MapBrowserEvent} evt
*/
var pointerMoveHandler = function(evt) {
if (evt.dragging) {
return;
}
/** @type {string} */
var helpMsg = 'Click to start drawing';
/** @type {ol.Coordinate|undefined} */
var tooltipCoord = evt.coordinate;
if (sketch) { if (sketch) {
var output; var output;
var geom = (sketch.getGeometry()); var geom = (sketch.getGeometry());
if (geom instanceof ol.geom.Polygon) { if (geom instanceof ol.geom.Polygon) {
output = formatArea(/** @type {ol.geom.Polygon} */ (geom)); output = formatArea(/** @type {ol.geom.Polygon} */ (geom));
helpMsg = continuePolygonMsg;
tooltipCoord = geom.getInteriorPoint().getCoordinates();
} else if (geom instanceof ol.geom.LineString) { } else if (geom instanceof ol.geom.LineString) {
output = formatLength( /** @type {ol.geom.LineString} */ (geom)); output = formatLength( /** @type {ol.geom.LineString} */ (geom));
helpMsg = continueLineMsg;
tooltipCoord = geom.getLastCoordinate();
} }
sketchElement.innerHTML = output; measureTooltipElement.innerHTML = output;
measureTooltip.setPosition(tooltipCoord);
} }
helpTooltipElement.innerHTML = helpMsg;
helpTooltip.setPosition(evt.coordinate);
}; };
@@ -81,42 +136,97 @@ var map = new ol.Map({
}) })
}); });
$(map.getViewport()).on('mousemove', mouseMoveHandler); map.on('pointermove', pointerMoveHandler);
var typeSelect = document.getElementById('type'); var typeSelect = document.getElementById('type');
var geodesicCheckbox = document.getElementById('geodesic');
var draw; // global so we can remove it later var draw; // global so we can remove it later
function addInteraction() { function addInteraction() {
var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString'); var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString');
draw = new ol.interaction.Draw({ draw = new ol.interaction.Draw({
source: source, source: source,
type: /** @type {ol.geom.GeometryType} */ (type) type: /** @type {ol.geom.GeometryType} */ (type),
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new ol.style.Stroke({
color: 'rgba(0, 0, 0, 0.5)',
lineDash: [10, 10],
width: 2
}),
image: new ol.style.Circle({
radius: 5,
stroke: new ol.style.Stroke({
color: 'rgba(0, 0, 0, 0.7)'
}),
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
})
})
})
}); });
map.addInteraction(draw); map.addInteraction(draw);
createMeasureTooltip();
createHelpTooltip();
draw.on('drawstart', draw.on('drawstart',
function(evt) { function(evt) {
// set sketch // set sketch
sketch = evt.feature; sketch = evt.feature;
sketchElement = document.createElement('li');
var outputList = document.getElementById('measureOutput');
if (outputList.childNodes) {
outputList.insertBefore(sketchElement, outputList.firstChild);
} else {
outputList.appendChild(sketchElement);
}
}, this); }, this);
draw.on('drawend', draw.on('drawend',
function(evt) { function(evt) {
measureTooltipElement.className = 'tooltip tooltip-static';
measureTooltip.setOffset([0, -7]);
// unset sketch // unset sketch
sketch = null; sketch = null;
sketchElement = null; // unset tooltip so that a new one can be created
measureTooltipElement = null;
createMeasureTooltip();
}, this); }, this);
} }
/**
* Creates a new help tooltip
*/
function createHelpTooltip() {
if (helpTooltipElement) {
helpTooltipElement.parentNode.removeChild(helpTooltipElement);
}
helpTooltipElement = document.createElement('div');
helpTooltipElement.className = 'tooltip';
helpTooltip = new ol.Overlay({
element: helpTooltipElement,
offset: [15, 0],
positioning: 'center-left'
});
map.addOverlay(helpTooltip);
}
/**
* Creates a new measure tooltip
*/
function createMeasureTooltip() {
if (measureTooltipElement) {
measureTooltipElement.parentNode.removeChild(measureTooltipElement);
}
measureTooltipElement = document.createElement('div');
measureTooltipElement.className = 'tooltip tooltip-measure';
measureTooltip = new ol.Overlay({
element: measureTooltipElement,
offset: [0, -15],
positioning: 'bottom-center'
});
map.addOverlay(measureTooltip);
}
/** /**
* Let user change the geometry type. * Let user change the geometry type.
* @param {Event} e Change event. * @param {Event} e Change event.
@@ -133,7 +243,19 @@ typeSelect.onchange = function(e) {
* @return {string} * @return {string}
*/ */
var formatLength = function(line) { var formatLength = function(line) {
var length = Math.round(line.getLength() * 100) / 100; var length;
if (geodesicCheckbox.checked) {
var coordinates = line.getCoordinates();
length = 0;
var sourceProj = map.getView().getProjection();
for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {
var c1 = ol.proj.transform(coordinates[i], sourceProj, 'EPSG:4326');
var c2 = ol.proj.transform(coordinates[i + 1], sourceProj, 'EPSG:4326');
length += wgs84Sphere.haversineDistance(c1, c2);
}
} else {
length = Math.round(line.getLength() * 100) / 100;
}
var output; var output;
if (length > 100) { if (length > 100) {
output = (Math.round(length / 1000 * 100) / 100) + output = (Math.round(length / 1000 * 100) / 100) +
@@ -152,7 +274,16 @@ var formatLength = function(line) {
* @return {string} * @return {string}
*/ */
var formatArea = function(polygon) { var formatArea = function(polygon) {
var area = polygon.getArea(); var area;
if (geodesicCheckbox.checked) {
var sourceProj = map.getView().getProjection();
var geom = /** @type {ol.geom.Polygon} */(polygon.clone().transform(
sourceProj, 'EPSG:4326'));
var coordinates = geom.getLinearRing(0).getCoordinates();
area = Math.abs(wgs84Sphere.geodesicArea(coordinates));
} else {
area = polygon.getArea();
}
var output; var output;
if (area > 10000) { if (area > 10000) {
output = (Math.round(area / 1000000 * 100) / 100) + output = (Math.round(area / 1000000 * 100) / 100) +

View File

@@ -114,7 +114,8 @@ var source = new ol.source.GeoJSON(
'type': 'MultiLineString', 'type': 'MultiLineString',
'coordinates': [ 'coordinates': [
[[-1e6, -7.5e5], [-1e6, 7.5e5]], [[-1e6, -7.5e5], [-1e6, 7.5e5]],
[[1e6, -7.5e5], [1e6, 7.5e5]], [[-1e6, -7.5e5], [-1e6, 7.5e5], [-5e5, 0], [-1e6, -7.5e5]],
[[1e6, -7.5e5], [15e5, 0], [15e5, 0], [1e6, 7.5e5]],
[[-7.5e5, -1e6], [7.5e5, -1e6]], [[-7.5e5, -1e6], [7.5e5, -1e6]],
[[-7.5e5, 1e6], [7.5e5, 1e6]] [[-7.5e5, 1e6], [7.5e5, 1e6]]
] ]
@@ -127,8 +128,8 @@ var source = new ol.source.GeoJSON(
'coordinates': [ 'coordinates': [
[[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6],
[-3e6, 6e6], [-5e6, 6e6]]], [-3e6, 6e6], [-5e6, 6e6]]],
[[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6],
[0, 6e6], [-2e6, 6e6]]], [0, 6e6], [-3e6, 6e6]]],
[[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6],
[3e6, 6e6], [1e6, 6e6]]] [3e6, 6e6], [1e6, 6e6]]]
] ]

View File

@@ -0,0 +1,57 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Custom styles for polygons</title>
<style>
.map {
background: grey;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Custom styles for polygons</h4>
<p id="shortdesc">Showing the vertices of a polygon with a custom style geometry.</p>
<div id="docs">
<p>See the <a href="polygon-styles.js" target="_blank">polygon-styles.js source</a> to see how this is done.</p>
</div>
<div id="tags">polygon, vector, style, GeometryFunction</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=polygon-styles" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

101
examples/polygon-styles.js Normal file
View File

@@ -0,0 +1,101 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.MultiPoint');
goog.require('ol.layer.Vector');
goog.require('ol.source.GeoJSON');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var styles = [
/* We are using two different styles for the polygons:
* - The first style is for the polygons themselves.
* - The second style is to draw the vertices of the polygons.
* In a custom `geometry` function the vertices of a polygon are
* returned as `MultiPoint` geometry, which will be used to render
* the style.
*/
new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
width: 3
}),
fill: new ol.style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
}),
new ol.style.Style({
image: new ol.style.Circle({
radius: 5,
fill: new ol.style.Fill({
color: 'orange'
})
}),
geometry: function(feature) {
// return the coordinates of the first ring of the polygon
var coordinates = feature.getGeometry().getCoordinates()[0];
return new ol.geom.MultiPoint(coordinates);
}
})
];
var source = new ol.source.GeoJSON(/** @type {olx.source.GeoJSONOptions} */ ({
object: {
'type': 'FeatureCollection',
'crs': {
'type': 'name',
'properties': {
'name': 'EPSG:3857'
}
},
'features': [
{
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6],
[-3e6, 6e6], [-5e6, 6e6]]]
}
},
{
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6],
[0, 6e6], [-2e6, 6e6]]]
}
},
{
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6],
[3e6, 6e6], [1e6, 6e6]]]
}
},
{
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[-2e6, -1e6], [-1e6, 1e6],
[0, -1e6], [-2e6, -1e6]]]
}
}
]
}
}));
var layer = new ol.layer.Vector({
source: source,
style: styles
});
var map = new ol.Map({
layers: [layer],
target: 'map',
view: new ol.View({
center: [0, 1000000],
zoom: 2
})
});

View File

@@ -10,10 +10,8 @@
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css"> <link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style type="text/css"> <style type="text/css">
.ol-popup { .ol-popup {
display: none;
position: absolute; position: absolute;
background-color: white; background-color: white;
-moz-box-shadow: 0 1px 4px rgba(0,0,0,0.2);
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 15px; padding: 15px;

View File

@@ -20,7 +20,7 @@ var closer = document.getElementById('popup-closer');
* @return {boolean} Don't follow the href. * @return {boolean} Don't follow the href.
*/ */
closer.onclick = function() { closer.onclick = function() {
container.style.display = 'none'; overlay.setPosition(undefined);
closer.blur(); closer.blur();
return false; return false;
}; };
@@ -29,9 +29,13 @@ closer.onclick = function() {
/** /**
* Create an overlay to anchor the popup to the map. * Create an overlay to anchor the popup to the map.
*/ */
var overlay = new ol.Overlay({ var overlay = new ol.Overlay(/** @type {olx.OverlayOptions} */ ({
element: container element: container,
}); autoPan: true,
autoPanAnimation: {
duration: 250
}
}));
/** /**
@@ -60,14 +64,12 @@ var map = new ol.Map({
/** /**
* Add a click handler to the map to render the popup. * Add a click handler to the map to render the popup.
*/ */
map.on('click', function(evt) { map.on('singleclick', function(evt) {
var coordinate = evt.coordinate; var coordinate = evt.coordinate;
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform( var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
coordinate, 'EPSG:3857', 'EPSG:4326')); coordinate, 'EPSG:3857', 'EPSG:4326'));
overlay.setPosition(coordinate);
content.innerHTML = '<p>You clicked here:</p><code>' + hdms + content.innerHTML = '<p>You clicked here:</p><code>' + hdms +
'</code>'; '</code>';
container.style.display = 'block'; overlay.setPosition(coordinate);
}); });

View File

@@ -35,14 +35,16 @@
<h4 id="title">Select features example</h4> <h4 id="title">Select features example</h4>
<p id="shortdesc">Example of using the Select interaction. Choose between <code>Single-click</code>, <code>Click</code> and <code>Hover</code> as the event type for selection in the combobox below. When using <code>Single-click</code> or <code>Click</code> you can hold do <code>Shift</code> key to toggle the feature in the selection.</p> <p id="shortdesc">Example of using the Select interaction. Choose between <code>Single-click</code>, <code>Click</code> and <code>Hover</code> as the event type for selection in the combobox below. When using <code>Single-click</code> or <code>Click</code> you can hold do <code>Shift</code> key to toggle the feature in the selection.</p>
<p>Note: when <code>Single-click</code> is used double-clicks won't select features. This in contrast to <code>Click</code>, where a double-click will both select the feature and zoom the map (because of the <code>DoubleClickZoom</code> interaction). Note that <code>Single-click</code> is less responsive than <code>Click</code> because of the delay it uses to detect double-clicks.</p> <p>Note: when <code>Single-click</code> is used double-clicks won't select features. This in contrast to <code>Click</code>, where a double-click will both select the feature and zoom the map (because of the <code>DoubleClickZoom</code> interaction). Note that <code>Single-click</code> is less responsive than <code>Click</code> because of the delay it uses to detect double-clicks.</p>
<p>In this example, a listener is registered for the Select interaction's <code>select</code> event in order to update the selection status below.
<form class="form-inline"> <form class="form-inline">
<label>Action type &nbsp;</label> <label>Action type &nbsp;</label>
<select id="type"> <select id="type">
<option value="none" selected>None</option> <option value="none" selected>None</option>
<option value="singleclick">Single-click</option> <option value="singleclick">Single-click</option>
<option value="click">Click</option> <option value="click">Click</option>
<option value="mousemove">Hover</option> <option value="pointermove">Hover</option>
</select> </select>
<span id="status">&nbsp;0 selected features</span>
</form> </form>
<div id="docs"> <div id="docs">
<p>See the <a href="select-features.js" target="_blank">select-features.js source</a> to see how this is done.</p> <p>See the <a href="select-features.js" target="_blank">select-features.js source</a> to see how this is done.</p>

View File

@@ -1,7 +1,6 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.events.condition'); goog.require('ol.events.condition');
goog.require('ol.interaction');
goog.require('ol.interaction.Select'); goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
@@ -38,9 +37,9 @@ var selectClick = new ol.interaction.Select({
condition: ol.events.condition.click condition: ol.events.condition.click
}); });
// select interaction working on "mousemove" // select interaction working on "pointermove"
var selectMouseMove = new ol.interaction.Select({ var selectPointerMove = new ol.interaction.Select({
condition: ol.events.condition.mouseMove condition: ol.events.condition.pointerMove
}); });
var selectElement = document.getElementById('type'); var selectElement = document.getElementById('type');
@@ -54,13 +53,18 @@ var changeInteraction = function() {
select = selectSingleClick; select = selectSingleClick;
} else if (value == 'click') { } else if (value == 'click') {
select = selectClick; select = selectClick;
} else if (value == 'mousemove') { } else if (value == 'pointermove') {
select = selectMouseMove; select = selectPointerMove;
} else { } else {
select = null; select = null;
} }
if (select !== null) { if (select !== null) {
map.addInteraction(select); map.addInteraction(select);
select.on('select', function(e) {
$('#status').html('&nbsp;' + e.target.getFeatures().getLength() +
' selected features (last operation selected ' + e.selected.length +
' and deselected ' + e.deselected.length + ' features)');
});
} }
}; };

View File

@@ -2,7 +2,7 @@ goog.require('ol.Graticule');
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
goog.require('ol.proj'); goog.require('ol.proj.Projection');
goog.require('ol.source.GeoJSON'); goog.require('ol.source.GeoJSON');
@@ -11,11 +11,12 @@ proj4.defs('ESRI:53009', '+proj=moll +lon_0=0 +x_0=0 +y_0=0 +a=6371000 ' +
// Configure the Sphere Mollweide projection object with an extent, // Configure the Sphere Mollweide projection object with an extent,
// and a world extent. These are required for the Graticule. // and a world extent. These are required for the Graticule.
var sphereMollweideProjection = ol.proj.get('ESRI:53009'); var sphereMollweideProjection = new ol.proj.Projection({
sphereMollweideProjection.setExtent([ code: 'ESRI:53009',
-9009954.605703328, -9009954.605703328, extent: [-9009954.605703328, -9009954.605703328,
9009954.605703328, 9009954.605703328]); 9009954.605703328, 9009954.605703328],
sphereMollweideProjection.setWorldExtent([-179, -90, 179, 90]); worldExtent: [-179, -90, 179, 90]
});
var map = new ol.Map({ var map = new ol.Map({
keyboardEventTarget: document, keyboardEventTarget: document,

View File

@@ -83,7 +83,10 @@ var displaySnap = function(coordinate) {
map.render(); map.render();
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var coordinate = map.getEventCoordinate(evt.originalEvent); var coordinate = map.getEventCoordinate(evt.originalEvent);
displaySnap(coordinate); displaySnap(coordinate);
}); });
@@ -116,13 +119,12 @@ map.on('postcompose', function(evt) {
} }
}); });
$(map.getViewport()).on('mousemove', function(e) { map.on('pointermove', function(evt) {
var pixel = map.getEventPixel(e.originalEvent); if (evt.dragging) {
return;
var hit = map.forEachFeatureAtPixel(pixel, function(feature, layer) { }
return true; var pixel = map.getEventPixel(evt.originalEvent);
}); var hit = map.hasFeatureAtPixel(pixel);
if (hit) { if (hit) {
map.getTarget().style.cursor = 'pointer'; map.getTarget().style.cursor = 'pointer';
} else { } else {

View File

@@ -0,0 +1,79 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Tile load events example</title>
<style>
.map {
background: #E0ECED;
}
.wrapper {
position: relative;
}
#progress {
position: absolute;
bottom: 0;
left: 0;
height: 2px;
background: rgba(0, 60, 136, 0.4);
width: 0;
transition: width 250ms;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 wrapper">
<div id="map" class="map"></div>
<div id="progress"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Tile load events example</h4>
<p id="shortdesc">Example using tile load events.</p>
<div id="docs">
<p>
Image tile sources fire events related to tile loading. You can
listen for <code>tileloadstart</code>, <code>tileloadend</code>,
and <code>tileloaderror</code> type events to monitor tile loading
progress. This example registers listeners for these events and
renders a tile loading progress bar at the bottom of the map.
</p>
<p>
See the <a href="tile-load-events.js" target="_blank">tile-load-events.js source</a>
for more detail on how this is done.
</p>
</div>
<div id="tags">tile, events, loading</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=tile-load-events" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,104 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.TileJSON');
/**
* Renders a progress bar.
* @param {Element} el The target element.
* @constructor
*/
function Progress(el) {
this.el = el;
this.loading = 0;
this.loaded = 0;
}
/**
* Increment the count of loading tiles.
*/
Progress.prototype.addLoading = function() {
if (this.loading === 0) {
this.show();
}
++this.loading;
this.update();
};
/**
* Increment the count of loaded tiles.
*/
Progress.prototype.addLoaded = function() {
setTimeout(function() {
++this.loaded;
this.update();
}.bind(this), 100);
};
/**
* Update the progress bar.
*/
Progress.prototype.update = function() {
var width = (this.loaded / this.loading * 100).toFixed(1) + '%';
this.el.style.width = width;
if (this.loading === this.loaded) {
this.loading = 0;
this.loaded = 0;
setTimeout(this.hide.bind(this), 500);
}
};
/**
* Show the progress bar.
*/
Progress.prototype.show = function() {
this.el.style.visibility = 'visible';
};
/**
* Hide the progress bar.
*/
Progress.prototype.hide = function() {
if (this.loading === this.loaded) {
this.el.style.visibility = 'hidden';
this.el.style.width = 0;
}
};
var progress = new Progress(document.getElementById('progress'));
var source = new ol.source.TileJSON({
url: 'http://api.tiles.mapbox.com/v3/mapbox.world-bright.jsonp',
crossOrigin: 'anonymous'
});
source.on('tileloadstart', function(event) {
progress.addLoading();
});
source.on('tileloadend', function(event) {
progress.addLoaded();
});
source.on('tileloaderror', function(event) {
progress.addLoaded();
});
var map = new ol.Map({
logo: false,
layers: [
new ol.layer.Tile({source: source})
],
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});

View File

@@ -58,7 +58,10 @@ var displayCountryInfo = function(coordinate) {
}); });
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var coordinate = map.getEventCoordinate(evt.originalEvent); var coordinate = map.getEventCoordinate(evt.originalEvent);
displayCountryInfo(coordinate); displayCountryInfo(coordinate);
}); });

View File

@@ -37,7 +37,7 @@
<div class="span12"> <div class="span12">
<h4 id="title">Tissot indicatrix example</h4> <h4 id="title">Tissot indicatrix example</h4>
<p id="shortdesc">Example of <a href="http://en.wikipedia.org/wiki/Tissot's_indicatrix">Tissot indicatrix</a> maps. The map on the left is an EPSG:4326 map. The one on the left is EPSG:3857.</p> <p id="shortdesc">Example of <a href="http://en.wikipedia.org/wiki/Tissot's_indicatrix">Tissot indicatrix</a> maps. The map on the left is an EPSG:4326 map. The one on the right is EPSG:3857.</p>
<div id="docs"> <div id="docs">
<p>See the <a href="tissot.js" target="_blank">tissot.js source</a> to see how this is done.</p> <p>See the <a href="tissot.js" target="_blank">tissot.js source</a> to see how this is done.</p>
</div> </div>

View File

@@ -12,7 +12,7 @@
h2 { h2 {
font-size: 1.5em; font-size: 1.5em;
line-height: 15px; line-height: 15px;
}; }
.scale-cnt { .scale-cnt {
margin: 5px; margin: 5px;

View File

@@ -114,7 +114,10 @@ var displayFeatureInfo = function(pixel) {
}; };
$(map.getViewport()).on('mousemove', function(evt) { map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent); var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel); displayFeatureInfo(pixel);
}); });

View File

@@ -12,7 +12,8 @@ goog.require('ol.source.TileWMS');
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection. // By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
// So we create a projection instance for EPSG:21781 and pass it to // So we create a projection instance for EPSG:21781 and pass it to
// ol.proj.addProjection to make it available to the library. // ol.proj.addProjection to make it available to the library for lookup by its
// code.
var projection = new ol.proj.Projection({ var projection = new ol.proj.Projection({
code: 'EPSG:21781', code: 'EPSG:21781',

View File

@@ -5,21 +5,29 @@ goog.require('ol.control');
goog.require('ol.control.ScaleLine'); goog.require('ol.control.ScaleLine');
goog.require('ol.layer.Image'); goog.require('ol.layer.Image');
goog.require('ol.proj'); goog.require('ol.proj');
goog.require('ol.proj.Projection');
goog.require('ol.source.ImageWMS'); goog.require('ol.source.ImageWMS');
// Transparent Proj4js support: ol.proj.get() creates and returns a projection // Transparent Proj4js support:
// known to Proj4js if it is unknown to OpenLayers, and registers functions to //
// transform between all registered projections.
// EPSG:21781 is known to Proj4js because its definition was loaded in the html. // EPSG:21781 is known to Proj4js because its definition was loaded in the html.
// Note that we are getting the projection object here to set the extent. If // Now when we create an ol.proj.Projection instance with the 'EPSG:21781' code,
// you do not need this, you do not have to use ol.proj.get(); simply use the // OpenLayers will pick up parameters like units and transform functions from
// string code in the view projection below and the transforms will be // Proj4js.
// registered transparently. //
var projection = ol.proj.get('EPSG:21781'); // Note that we are setting the projection's extent here, which is used to
// The extent is used to determine zoom level 0. Recommended values for a // determine the view resolution for zoom level 0. Recommended values for a
// projection's validity extent can be found at http://epsg.io/. // projection's validity extent can be found at http://epsg.io/.
projection.setExtent([485869.5728, 76443.1884, 837076.5648, 299941.7864]); //
// If you use Proj4js only to transform coordinates, you don't even need to
// create an ol.proj.Projection instance. ol.proj.get() will take care of it
// internally.
var projection = new ol.proj.Projection({
code: 'EPSG:21781',
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864]
});
var extent = [420000, 30000, 900000, 350000]; var extent = [420000, 30000, 900000, 350000];
var layers = [ var layers = [
@@ -67,7 +75,7 @@ var map = new ol.Map({
target: 'map', target: 'map',
view: new ol.View({ view: new ol.View({
projection: projection, projection: projection,
center: ol.proj.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781'), center: ol.proj.transform([8.23, 46.86], 'EPSG:4326', projection),
extent: extent, extent: extent,
zoom: 2 zoom: 2
}) })

View File

@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Tiled WMS wrap 180° meridian example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Tiled WMS wrap 180° meridian example</h4>
<p id="shortdesc">Example of a tiled WMS layer that wraps across the 180° meridian.</p>
<div id="docs">
<p>See the <a href="wms-tiled-wrap-180.js" target="_blank">wms-tiled-wrap-180.js source</a> to see how this is done.</p>
</div>
<div id="tags">wms, tile, dateline, wrap, 180</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=wms-tiled-wrap-180" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,28 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileWMS');
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({
url: 'http://demo.boundlessgeo.com/geoserver/ne/wms',
params: {'LAYERS': 'ne:ne_10m_admin_0_countries', 'TILED': true},
serverType: 'geoserver',
wrapX: true
}))
})
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 1
})
});

View File

@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>WMTS GetCapabilities parsing example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<h4 id="title">WMTS GetCapabilities parsing example</h4>
<p id="shortdesc">Example of parsing a WMTS GetCapabilities response.</p>
<div id="docs">
<p>See the <a href="wmts-capabilities.js" target="_blank">wmts-capabilities.js source</a> to see how this is done.</p>
</div>
<div id="tags">wmts, capabilities, getcapabilities</div>
</div>
<div class="span8">
<pre id="log"></pre>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=wmts-capabilities" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,8 @@
goog.require('ol.format.WMTSCapabilities');
var parser = new ol.format.WMTSCapabilities();
$.ajax('data/WMTSCapabilities.xml').then(function(response) {
var result = parser.read(response);
$('#log').html(window.JSON.stringify(result, null, 2));
});

View File

@@ -0,0 +1,51 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>WMTS Layer example from capabilities </title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">WMTS Capabilities example</h4>
<p id="shortdesc">Example of a WMTS source created from a WMTS capabilities document.</p>
<div id="docs">
<p>See the <a href="wmts-layer-from-capabilities.js" target="_blank">wmts-layer-from-capabilities.js source</a> to see how this is done.</p>
</div>
<div id="tags">wmts, capabilities, getcapabilities</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=wmts-layer-from-capabilities" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,33 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.WMTSCapabilities');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.WMTS');
var parser = new ol.format.WMTSCapabilities();
var map;
$.ajax('data/WMTSCapabilities.xml').then(function(response) {
var result = parser.read(response);
var options = ol.source.WMTS.optionsFromCapabilities(result,
{layer: 'layer-7328', matrixSet: 'EPSG:3857'});
map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM(),
opacity: 0.7
}),
new ol.layer.Tile({
opacity: 1,
source: new ol.source.WMTS(options)
})
],
target: 'map',
view: new ol.View({
center: [19412406.33, -5050500.21],
zoom: 5
})
});
});

View File

@@ -35,7 +35,6 @@ var map = new ol.Map({
}), }),
new ol.layer.Tile({ new ol.layer.Tile({
opacity: 0.7, opacity: 0.7,
extent: projectionExtent,
source: new ol.source.WMTS({ source: new ol.source.WMTS({
attributions: [attribution], attributions: [attribution],
url: 'http://services.arcgisonline.com/arcgis/rest/' + url: 'http://services.arcgisonline.com/arcgis/rest/' +
@@ -49,7 +48,8 @@ var map = new ol.Map({
resolutions: resolutions, resolutions: resolutions,
matrixIds: matrixIds matrixIds: matrixIds
}), }),
style: 'default' style: 'default',
wrapX: true
}) })
}) })
], ],

View File

@@ -13,6 +13,12 @@
var GeoJSONObject = function() {}; var GeoJSONObject = function() {};
/**
* @type {!Array.<number>|undefined}
*/
GeoJSONObject.prototype.bbox;
/** /**
* @type {string} * @type {string}
*/ */
@@ -28,11 +34,17 @@ GeoJSONObject.prototype.crs;
/** /**
* @constructor * @constructor
* @extends {GeoJSONObject}
*/ */
var GeoJSONCRS = function() {}; var GeoJSONCRS = function() {};
/**
* CRS type. One of `link` or `name`.
* @type {string}
*/
GeoJSONCRS.prototype.type;
/** /**
* TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996 * TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996
* is fixed and widely deployed. * is fixed and widely deployed.
@@ -142,16 +154,9 @@ var GeoJSONFeatureCollection = function() {};
GeoJSONFeatureCollection.prototype.features; GeoJSONFeatureCollection.prototype.features;
/**
* @type {!Array.<number>|undefined}
*/
GeoJSONFeatureCollection.prototype.bbox;
/** /**
* @constructor * @constructor
* @extends {GeoJSONObject}
*/ */
var GeoJSONLink = function() {}; var GeoJSONLink = function() {};
@@ -160,3 +165,8 @@ var GeoJSONLink = function() {};
* @type {string} * @type {string}
*/ */
GeoJSONLink.prototype.href; GeoJSONLink.prototype.href;
/**
* @type {string}
*/
GeoJSONLink.prototype.type;

View File

@@ -92,6 +92,12 @@ oli.MapBrowserEvent.prototype.originalEvent;
oli.MapBrowserEvent.prototype.pixel; oli.MapBrowserEvent.prototype.pixel;
/**
* @type {boolean}
*/
oli.MapBrowserEvent.prototype.dragging;
/** /**
* @interface * @interface
@@ -111,6 +117,25 @@ oli.MapEvent.prototype.map;
oli.MapEvent.prototype.frameState; oli.MapEvent.prototype.frameState;
/**
* @interface
*/
oli.SelectEvent = function() {};
/**
* @type {Array.<ol.Feature>}
*/
oli.SelectEvent.prototype.deselected;
/**
* @type {Array.<ol.Feature>}
*/
oli.SelectEvent.prototype.selected;
/** /**
* @type {Object} * @type {Object}
*/ */
@@ -204,6 +229,29 @@ oli.render.Event.prototype.vectorContext;
oli.source; oli.source;
/**
* @interface
*/
oli.source.ImageEvent = function() {};
/**
* @type {ol.Image}
*/
oli.source.ImageEvent.prototype.image;
/**
* @interface
*/
oli.source.TileEvent = function() {};
/**
* @type {ol.Tile}
*/
oli.source.TileEvent.prototype.tile;
/** /**
* @interface * @interface

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "openlayers", "name": "openlayers",
"version": "3.1.0-pre.3", "version": "3.4.0",
"description": "Build tools and sources for developing OpenLayers based mapping applications", "description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [ "keywords": [
"map", "map",
@@ -25,13 +25,13 @@
}, },
"dependencies": { "dependencies": {
"async": "0.9.0", "async": "0.9.0",
"closure-util": "1.2.0", "closure-util": "1.3.0",
"fs-extra": "0.12.0", "fs-extra": "0.12.0",
"graceful-fs": "3.0.2", "graceful-fs": "3.0.2",
"htmlparser2": "3.7.3", "htmlparser2": "3.7.3",
"jsdoc": "3.3.0-alpha9", "jsdoc": "3.3.0-alpha9",
"nomnom": "1.8.0", "nomnom": "1.8.0",
"rbush": "1.3.4", "rbush": "1.3.5",
"temp": "0.8.1", "temp": "0.8.1",
"walk": "2.3.4" "walk": "2.3.4"
}, },

View File

@@ -29,11 +29,13 @@
pairs = [], pairs = [],
i, i,
pair, pair,
adjusted; adjusted,
modeFound = false;
for (i = chunks.length - 1; i >= 0; --i) { for (i = chunks.length - 1; i >= 0; --i) {
pair = chunks[i].split('='); pair = chunks[i].split('=');
if (pair[0].toLowerCase() === 'mode') { if (pair[0].toLowerCase() === 'mode') {
pair[1] = newMode; pair[1] = newMode;
modeFound = true;
} }
adjusted = encodeURIComponent(pair[0]); adjusted = encodeURIComponent(pair[0]);
if (typeof pair[1] !== undefined) { if (typeof pair[1] !== undefined) {
@@ -41,8 +43,8 @@
} }
pairs.push(adjusted); pairs.push(adjusted);
} }
if (pairs.length === 0) { if (!modeFound) {
pairs[0] = 'mode=' + encodeURIComponent(newMode); pairs.push('mode=' + encodeURIComponent(newMode));
} }
location.href = baseUrl + '?' + pairs.join('&'); location.href = baseUrl + '?' + pairs.join('&');
}; };

View File

@@ -1,5 +1,7 @@
goog.provide('ol.Attribution'); goog.provide('ol.Attribution');
goog.require('goog.asserts');
goog.require('goog.math');
goog.require('ol.TileRange'); goog.require('ol.TileRange');
@@ -54,22 +56,43 @@ ol.Attribution.prototype.getHTML = function() {
/** /**
* @param {Object.<string, ol.TileRange>} tileRanges Tile ranges. * @param {Object.<string, ol.TileRange>} tileRanges Tile ranges.
* @param {!ol.tilegrid.TileGrid} tileGrid Tile grid.
* @param {!ol.proj.Projection} projection Projection.
* @return {boolean} Intersects any tile range. * @return {boolean} Intersects any tile range.
*/ */
ol.Attribution.prototype.intersectsAnyTileRange = function(tileRanges) { ol.Attribution.prototype.intersectsAnyTileRange =
function(tileRanges, tileGrid, projection) {
if (goog.isNull(this.tileRanges_)) { if (goog.isNull(this.tileRanges_)) {
return true; return true;
} }
var i, ii, tileRange, z; var i, ii, tileRange, zKey;
for (z in tileRanges) { for (zKey in tileRanges) {
if (!(z in this.tileRanges_)) { if (!(zKey in this.tileRanges_)) {
continue; continue;
} }
tileRange = tileRanges[z]; tileRange = tileRanges[zKey];
for (i = 0, ii = this.tileRanges_[z].length; i < ii; ++i) { var testTileRange;
if (this.tileRanges_[z][i].intersects(tileRange)) { for (i = 0, ii = this.tileRanges_[zKey].length; i < ii; ++i) {
testTileRange = this.tileRanges_[zKey][i];
if (testTileRange.intersects(tileRange)) {
return true; return true;
} }
var extentTileRange = tileGrid.getTileRange(
parseInt(zKey, 10), projection);
var width = extentTileRange.getWidth();
if (tileRange.minX < extentTileRange.minX ||
tileRange.maxX > extentTileRange.maxX) {
if (testTileRange.intersects(new ol.TileRange(
goog.math.modulo(tileRange.minX, width),
goog.math.modulo(tileRange.maxX, width),
tileRange.minY, tileRange.maxY))) {
return true;
}
if (tileRange.getWidth() > width &&
testTileRange.intersects(extentTileRange)) {
return true;
}
}
} }
} }
return false; return false;

View File

@@ -95,7 +95,7 @@ ol.Collection = function(opt_array) {
* @private * @private
* @type {Array.<T>} * @type {Array.<T>}
*/ */
this.array_ = opt_array || []; this.array_ = goog.isDef(opt_array) ? opt_array : [];
this.updateLength_(); this.updateLength_();
@@ -216,7 +216,7 @@ ol.Collection.prototype.push = function(elem) {
/** /**
* Removes the first occurence of elem from the collection. * Removes the first occurrence of elem from the collection.
* @param {T} elem Element. * @param {T} elem Element.
* @return {T|undefined} The removed element or undefined if elem was not found. * @return {T|undefined} The removed element or undefined if elem was not found.
* @api stable * @api stable

View File

@@ -2,6 +2,7 @@
goog.provide('ol.control.Attribution'); goog.provide('ol.control.Attribution');
goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName'); goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
@@ -12,6 +13,7 @@ goog.require('goog.style');
goog.require('ol.Attribution'); goog.require('ol.Attribution');
goog.require('ol.control.Control'); goog.require('ol.control.Control');
goog.require('ol.css'); goog.require('ol.css');
goog.require('ol.source.Tile');
@@ -69,32 +71,33 @@ ol.control.Attribution = function(opt_options) {
var tipLabel = goog.isDef(options.tipLabel) ? var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Attributions'; options.tipLabel : 'Attributions';
/** var collapseLabel = goog.isDef(options.collapseLabel) ?
* @private
* @type {string}
*/
this.collapseLabel_ = goog.isDef(options.collapseLabel) ?
options.collapseLabel : '\u00BB'; options.collapseLabel : '\u00BB';
/** /**
* @private * @private
* @type {string} * @type {Node}
*/ */
this.label_ = goog.isDef(options.label) ? options.label : 'i'; this.collapseLabel_ = /** @type {Node} */ (goog.isString(collapseLabel) ?
var label = goog.dom.createDom(goog.dom.TagName.SPAN, {}, goog.dom.createDom(goog.dom.TagName.SPAN, {}, collapseLabel) :
(this.collapsible_ && !this.collapsed_) ? collapseLabel);
this.collapseLabel_ : this.label_);
var label = goog.isDef(options.label) ? options.label : 'i';
/** /**
* @private * @private
* @type {Element} * @type {Node}
*/ */
this.labelSpan_ = label; this.label_ = /** @type {Node} */ (goog.isString(label) ?
goog.dom.createDom(goog.dom.TagName.SPAN, {}, label) :
label);
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}, this.labelSpan_); }, activeLabel);
goog.events.listen(button, goog.events.EventType.CLICK, goog.events.listen(button, goog.events.EventType.CLICK,
this.handleClick_, false, this); this.handleClick_, false, this);
@@ -157,11 +160,14 @@ goog.inherits(ol.control.Attribution, ol.control.Control);
ol.control.Attribution.prototype.getSourceAttributions = function(frameState) { ol.control.Attribution.prototype.getSourceAttributions = function(frameState) {
var i, ii, j, jj, tileRanges, source, sourceAttribution, var i, ii, j, jj, tileRanges, source, sourceAttribution,
sourceAttributionKey, sourceAttributions, sourceKey; sourceAttributionKey, sourceAttributions, sourceKey;
var intersectsTileRange;
var layerStatesArray = frameState.layerStatesArray; var layerStatesArray = frameState.layerStatesArray;
/** @type {Object.<string, ol.Attribution>} */ /** @type {Object.<string, ol.Attribution>} */
var attributions = goog.object.clone(frameState.attributions); var attributions = goog.object.clone(frameState.attributions);
/** @type {Object.<string, ol.Attribution>} */ /** @type {Object.<string, ol.Attribution>} */
var hiddenAttributions = {}; var hiddenAttributions = {};
var projection = frameState.viewState.projection;
goog.asserts.assert(!goog.isNull(projection));
for (i = 0, ii = layerStatesArray.length; i < ii; i++) { for (i = 0, ii = layerStatesArray.length; i < ii; i++) {
source = layerStatesArray[i].layer.getSource(); source = layerStatesArray[i].layer.getSource();
if (goog.isNull(source)) { if (goog.isNull(source)) {
@@ -179,14 +185,21 @@ ol.control.Attribution.prototype.getSourceAttributions = function(frameState) {
continue; continue;
} }
tileRanges = frameState.usedTiles[sourceKey]; tileRanges = frameState.usedTiles[sourceKey];
if (goog.isDef(tileRanges) && if (goog.isDef(tileRanges)) {
sourceAttribution.intersectsAnyTileRange(tileRanges)) { goog.asserts.assertInstanceof(source, ol.source.Tile);
var tileGrid = source.getTileGridForProjection(projection);
goog.asserts.assert(!goog.isNull(tileGrid));
intersectsTileRange = sourceAttribution.intersectsAnyTileRange(
tileRanges, tileGrid, projection);
} else {
intersectsTileRange = false;
}
if (intersectsTileRange) {
if (sourceAttributionKey in hiddenAttributions) { if (sourceAttributionKey in hiddenAttributions) {
delete hiddenAttributions[sourceAttributionKey]; delete hiddenAttributions[sourceAttributionKey];
} }
attributions[sourceAttributionKey] = sourceAttribution; attributions[sourceAttributionKey] = sourceAttribution;
} } else {
else {
hiddenAttributions[sourceAttributionKey] = sourceAttribution; hiddenAttributions[sourceAttributionKey] = sourceAttribution;
} }
} }
@@ -341,8 +354,11 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
*/ */
ol.control.Attribution.prototype.handleToggle_ = function() { ol.control.Attribution.prototype.handleToggle_ = function() {
goog.dom.classlist.toggle(this.element, 'ol-collapsed'); goog.dom.classlist.toggle(this.element, 'ol-collapsed');
goog.dom.setTextContent(this.labelSpan_, if (this.collapsed_) {
(this.collapsed_) ? this.collapseLabel_ : this.label_); goog.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
goog.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_; this.collapsed_ = !this.collapsed_;
}; };

View File

@@ -51,8 +51,7 @@ ol.control.Control = function(options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.target_ = goog.isDef(options.target) ? this.target_ = null;
goog.dom.getElement(options.target) : null;
/** /**
* @private * @private
@@ -71,6 +70,10 @@ ol.control.Control = function(options) {
*/ */
this.render = goog.isDef(options.render) ? options.render : goog.nullFunction; this.render = goog.isDef(options.render) ? options.render : goog.nullFunction;
if (goog.isDef(options.target)) {
this.setTarget(options.target);
}
}; };
goog.inherits(ol.control.Control, ol.Object); goog.inherits(ol.control.Control, ol.Object);
@@ -121,3 +124,17 @@ ol.control.Control.prototype.setMap = function(map) {
map.render(); map.render();
} }
}; };
/**
* This function is used to set a target element for the control. It has no
* effect if it is called after the control has been added to the map (i.e.
* after `setMap` is called on the control). If no `target` is set in the
* options passed to the control constructor and if `setTarget` is not called
* then the control is added to the map's overlay container.
* @param {Element|string} target Target.
* @api
*/
ol.control.Control.prototype.setTarget = function(target) {
this.target_ = goog.dom.getElement(target);
};

View File

@@ -37,13 +37,32 @@ ol.control.FullScreen = function(opt_options) {
this.cssClassName_ = goog.isDef(options.className) ? this.cssClassName_ = goog.isDef(options.className) ?
options.className : 'ol-full-screen'; options.className : 'ol-full-screen';
var label = goog.isDef(options.label) ? options.label : '\u2194';
/**
* @private
* @type {Node}
*/
this.labelNode_ = /** @type {Node} */ (goog.isString(label) ?
goog.dom.createTextNode(label) : label);
var labelActive = goog.isDef(options.labelActive) ?
options.labelActive : '\u00d7';
/**
* @private
* @type {Node}
*/
this.labelActiveNode_ = /** @type {Node} */ (goog.isString(labelActive) ?
goog.dom.createTextNode(labelActive) : labelActive);
var tipLabel = goog.isDef(options.tipLabel) ? var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Toggle full-screen'; options.tipLabel : 'Toggle full-screen';
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(), 'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(),
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}); }, this.labelNode_);
goog.events.listen(button, goog.events.EventType.CLICK, goog.events.listen(button, goog.events.EventType.CLICK,
this.handleClick_, false, this); this.handleClick_, false, this);
@@ -122,12 +141,14 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() { ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
var opened = this.cssClassName_ + '-true'; var opened = this.cssClassName_ + '-true';
var closed = this.cssClassName_ + '-false'; var closed = this.cssClassName_ + '-false';
var anchor = goog.dom.getFirstElementChild(this.element); var button = goog.dom.getFirstElementChild(this.element);
var map = this.getMap(); var map = this.getMap();
if (goog.dom.fullscreen.isFullScreen()) { if (goog.dom.fullscreen.isFullScreen()) {
goog.dom.classlist.swap(anchor, closed, opened); goog.dom.classlist.swap(button, closed, opened);
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
} else { } else {
goog.dom.classlist.swap(anchor, opened, closed); goog.dom.classlist.swap(button, opened, closed);
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
} }
if (!goog.isNull(map)) { if (!goog.isNull(map)) {
map.updateSize(); map.updateSize();

View File

@@ -57,31 +57,33 @@ ol.control.OverviewMap = function(opt_options) {
var tipLabel = goog.isDef(options.tipLabel) ? var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Overview map'; options.tipLabel : 'Overview map';
/** var collapseLabel = goog.isDef(options.collapseLabel) ?
* @private
* @type {string}
*/
this.collapseLabel_ = goog.isDef(options.collapseLabel) ?
options.collapseLabel : '\u00AB'; options.collapseLabel : '\u00AB';
/** /**
* @private * @private
* @type {string} * @type {Node}
*/ */
this.label_ = goog.isDef(options.label) ? options.label : '\u00BB'; this.collapseLabel_ = /** @type {Node} */ (goog.isString(collapseLabel) ?
var label = goog.dom.createDom(goog.dom.TagName.SPAN, {}, goog.dom.createDom(goog.dom.TagName.SPAN, {}, collapseLabel) :
(this.collapsible_ && !this.collapsed_) ? collapseLabel);
this.collapseLabel_ : this.label_);
var label = goog.isDef(options.label) ? options.label : '\u00BB';
/** /**
* @private * @private
* @type {Element} * @type {Node}
*/ */
this.labelSpan_ = label; this.label_ = /** @type {Node} */ (goog.isString(label) ?
goog.dom.createDom(goog.dom.TagName.SPAN, {}, label) :
label);
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}, this.labelSpan_); }, activeLabel);
goog.events.listen(button, goog.events.EventType.CLICK, goog.events.listen(button, goog.events.EventType.CLICK,
this.handleClick_, false, this); this.handleClick_, false, this);
@@ -427,8 +429,11 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
*/ */
ol.control.OverviewMap.prototype.handleToggle_ = function() { ol.control.OverviewMap.prototype.handleToggle_ = function() {
goog.dom.classlist.toggle(this.element, 'ol-collapsed'); goog.dom.classlist.toggle(this.element, 'ol-collapsed');
goog.dom.setTextContent(this.labelSpan_, if (this.collapsed_) {
(this.collapsed_) ? this.collapseLabel_ : this.label_); goog.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
goog.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_; this.collapsed_ = !this.collapsed_;
// manage overview map if it had not been rendered before and control // manage overview map if it had not been rendered before and control

View File

@@ -1,6 +1,5 @@
goog.provide('ol.control.Rotate'); goog.provide('ol.control.Rotate');
goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName'); goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
@@ -32,12 +31,22 @@ ol.control.Rotate = function(opt_options) {
var className = goog.isDef(options.className) ? var className = goog.isDef(options.className) ?
options.className : 'ol-rotate'; options.className : 'ol-rotate';
var label = goog.isDef(options.label) ?
options.label : '\u21E7';
/** /**
* @type {Element} * @type {Node}
* @private * @private
*/ */
this.label_ = null;
if (goog.isString(label)) {
this.label_ = goog.dom.createDom(goog.dom.TagName.SPAN, this.label_ = goog.dom.createDom(goog.dom.TagName.SPAN,
'ol-compass', goog.isDef(options.label) ? options.label : '\u21E7'); 'ol-compass', label);
} else {
this.label_ = label;
goog.dom.classlist.add(this.label_, 'ol-compass');
}
var tipLabel = goog.isDef(options.tipLabel) ? var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Reset rotation'; options.tipLabel : 'Reset rotation';

View File

@@ -13,6 +13,7 @@ goog.require('ol.TransformFunction');
goog.require('ol.control.Control'); goog.require('ol.control.Control');
goog.require('ol.css'); goog.require('ol.css');
goog.require('ol.proj'); goog.require('ol.proj');
goog.require('ol.proj.METERS_PER_UNIT');
goog.require('ol.proj.Units'); goog.require('ol.proj.Units');
goog.require('ol.sphere.NORMAL'); goog.require('ol.sphere.NORMAL');
@@ -227,20 +228,18 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
pointResolution *= Math.PI * cosLatitude * ol.sphere.NORMAL.radius / 180; pointResolution *= Math.PI * cosLatitude * ol.sphere.NORMAL.radius / 180;
projectionUnits = ol.proj.Units.METERS; projectionUnits = ol.proj.Units.METERS;
} else if ((projectionUnits == ol.proj.Units.FEET || } else if (projectionUnits != ol.proj.Units.DEGREES &&
projectionUnits == ol.proj.Units.METERS) &&
units == ol.control.ScaleLineUnits.DEGREES) { units == ol.control.ScaleLineUnits.DEGREES) {
// Convert pointResolution from meters or feet to degrees // Convert pointResolution from other units to degrees
if (goog.isNull(this.toEPSG4326_)) { if (goog.isNull(this.toEPSG4326_)) {
this.toEPSG4326_ = ol.proj.getTransformFromProjections( this.toEPSG4326_ = ol.proj.getTransformFromProjections(
projection, ol.proj.get('EPSG:4326')); projection, ol.proj.get('EPSG:4326'));
} }
cosLatitude = Math.cos(goog.math.toRadians(this.toEPSG4326_(center)[1])); cosLatitude = Math.cos(goog.math.toRadians(this.toEPSG4326_(center)[1]));
var radius = ol.sphere.NORMAL.radius; var radius = ol.sphere.NORMAL.radius;
if (projectionUnits == ol.proj.Units.FEET) { goog.asserts.assert(goog.isDef(ol.proj.METERS_PER_UNIT[projectionUnits]));
radius /= 0.3048; radius /= ol.proj.METERS_PER_UNIT[projectionUnits];
}
pointResolution *= 180 / (Math.PI * cosLatitude * radius); pointResolution *= 180 / (Math.PI * cosLatitude * radius);
projectionUnits = ol.proj.Units.DEGREES; projectionUnits = ol.proj.Units.DEGREES;
@@ -325,7 +324,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
++i; ++i;
} }
var html = count + suffix; var html = count + ' ' + suffix;
if (this.renderedHTML_ != html) { if (this.renderedHTML_ != html) {
this.innerElement_.innerHTML = html; this.innerElement_.innerHTML = html;
this.renderedHTML_ = html; this.renderedHTML_ = html;

View File

@@ -32,12 +32,13 @@ ol.control.ZoomToExtent = function(opt_options) {
var className = goog.isDef(options.className) ? options.className : var className = goog.isDef(options.className) ? options.className :
'ol-zoom-extent'; 'ol-zoom-extent';
var label = goog.isDef(options.label) ? options.label : 'E';
var tipLabel = goog.isDef(options.tipLabel) ? var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Fit to extent'; options.tipLabel : 'Fit to extent';
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}); }, label);
goog.events.listen(button, goog.events.EventType.CLICK, goog.events.listen(button, goog.events.EventType.CLICK,
this.handleClick_, false, this); this.handleClick_, false, this);

View File

@@ -159,7 +159,7 @@ ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres) {
* that will be replaced by first and second coordinate values. * that will be replaced by first and second coordinate values.
* @param {number=} opt_fractionDigits The number of digits to include * @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`. * after the decimal point. Default is `0`.
* @return {string} Formated coordinate. * @return {string} Formatted coordinate.
* @api stable * @api stable
*/ */
ol.coordinate.format = function(coordinate, template, opt_fractionDigits) { ol.coordinate.format = function(coordinate, template, opt_fractionDigits) {

View File

@@ -28,7 +28,7 @@ ol.DeviceOrientationProperty = {
* *
* Many new computers, and especially mobile phones * Many new computers, and especially mobile phones
* and tablets, provide hardware support for device orientation. Web * and tablets, provide hardware support for device orientation. Web
* developers targetting mobile devices will be especially interested in this * developers targeting mobile devices will be especially interested in this
* class. * class.
* *
* Device orientation data are relative to a common starting point. For mobile * Device orientation data are relative to a common starting point. For mobile

View File

@@ -158,7 +158,7 @@ ol.dom.setOpacity = function(element, value) {
var alpha; var alpha;
if (goog.userAgent.VERSION == '8.0') { if (goog.userAgent.VERSION == '8.0') {
regex = /progid:DXImageTransform\.Microsoft\.Alpha\(.*?\)/i, regex = /progid:DXImageTransform\.Microsoft\.Alpha\(.*?\)/i;
alpha = 'progid:DXImageTransform.Microsoft.Alpha(Opacity=' + alpha = 'progid:DXImageTransform.Microsoft.Alpha(Opacity=' +
(value * 100) + ')'; (value * 100) + ')';
} else { } else {
@@ -298,3 +298,35 @@ ol.dom.transformElement2D =
// content size. // content size.
} }
}; };
/**
* Get the current computed width for the given element including margin,
* padding and border.
* Equivalent to jQuery's `$(el).outerWidth(true)`.
* @param {!Element} element Element.
* @return {number}
*/
ol.dom.outerWidth = function(element) {
var width = element.offsetWidth;
var style = element.currentStyle || window.getComputedStyle(element);
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
return width;
};
/**
* Get the current computed height for the given element including margin,
* padding and border.
* Equivalent to jQuery's `$(el).outerHeight(true)`.
* @param {!Element} element Element.
* @return {number}
*/
ol.dom.outerHeight = function(element) {
var height = element.offsetHeight;
var style = element.currentStyle || window.getComputedStyle(element);
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
return height;
};

View File

@@ -66,16 +66,6 @@ ol.events.condition.click = function(mapBrowserEvent) {
}; };
/**
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the browser event is a `mousemove` event.
* @api
*/
ol.events.condition.mouseMove = function(mapBrowserEvent) {
return mapBrowserEvent.originalEvent.type == 'mousemove';
};
/** /**
* Always false. * Always false.
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
@@ -86,6 +76,16 @@ ol.events.condition.mouseMove = function(mapBrowserEvent) {
ol.events.condition.never = goog.functions.FALSE; ol.events.condition.never = goog.functions.FALSE;
/**
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the browser event is a `pointermove` event.
* @api
*/
ol.events.condition.pointerMove = function(mapBrowserEvent) {
return mapBrowserEvent.type == 'pointermove';
};
/** /**
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `singleclick` event. * @return {boolean} True if the event is a map `singleclick` event.

Some files were not shown because too many files have changed in this diff Show More