Compare commits

..

62 Commits

Author SHA1 Message Date
Tim Schaub
eb5607544c Update package version to 3.11.2 2015-11-19 11:32:41 -07:00
Tim Schaub
4999c792f1 Changelog for v3.11.2 2015-11-19 11:28:02 -07:00
Andreas Hocevar
5af338f92b Fix select interaction regression caused by #4391 2015-11-19 10:53:57 -07:00
Frederic Junod
071aad4815 Check ol.source.UrlTile#urls property for null value
Fixes #4446
2015-11-19 10:53:12 -07:00
Andreas Hocevar
a43cca7720 Allow '' for crossOrigin (as Anonymous alias)
This fixes a regression introduced by the goog.isDef removal.

From the HTML 5 spec: "The empty string is also a valid keyword, and
maps to the Anonymous state"
2015-11-19 10:48:35 -07:00
Tim Schaub
4c19e13bf6 Update package version to 3.11.1 2015-11-12 16:17:57 -07:00
Tim Schaub
1c6a56f781 Changelog for v3.11.1 2015-11-12 16:17:06 -07:00
Bart van den Eijnden
3aabc44746 Merge pull request #4413 from bartvde/issue-4406
Revert "Merge pull request #4339 from bartvde/issue-4337"
2015-11-12 20:45:27 +01:00
Bart van den Eijnden
b426fa5509 Revert "Merge pull request #4339 from bartvde/issue-4337"
This reverts commit 7f4c6e3634, reversing
changes made to c5dac0aa70.
2015-11-12 20:29:54 +01:00
Andreas Hocevar
70d376f215 Merge pull request #4412 from ahocevar/revert-4344
Revert "Merge pull request #4344 from bartvde/issue-2844"
2015-11-12 19:36:27 +01:00
Andreas Hocevar
c5f4710b8d Revert "Merge pull request #4344 from bartvde/issue-2844"
This reverts commit e5c44b37c9, reversing
changes made to 7f4c6e3634.
2015-11-12 19:17:07 +01:00
Andreas Hocevar
14338e9c16 Merge pull request #4408 from ahocevar/fix-imagewms-ratio-3.11.x
Use ratio when calculating ImageWMS width and height
2015-11-12 18:30:31 +01:00
Andreas Hocevar
ce5ab5b59c Use ratio when calculating width and height 2015-11-12 18:10:10 +01:00
Tim Schaub
bb5377fb8c Merge pull request #4399 from openlayers/release-v3.11.0
Release v3.11.0.
2015-11-11 14:46:44 -07:00
Tim Schaub
657af1983d Update package version to 3.11.0 2015-11-11 14:25:37 -07:00
Tim Schaub
ab7e608129 Changelog for v3.11.0 2015-11-11 14:24:56 -07:00
Tim Schaub
0c2c058534 Merge pull request #4394 from openlayers/silent-update
Allow ol.Object property update without notification.
2015-11-11 12:59:06 -07:00
Tim Schaub
a9987de308 Merge pull request #4395 from adube/api-styletext-offsetxy
Flag ol.style.Text setOffsetX and Y as @api.
2015-11-11 11:15:17 -07:00
Tim Schaub
c02fdf2393 Doc corrections and truthy check 2015-11-11 11:12:58 -07:00
Alexandre Dubé
ca50e9e5b7 Flag ol.style.Text setOffsetX and Y as @api 2015-11-11 12:44:12 -05:00
DavidHequet
069a81db74 Allow ol.Object property update without notification
Add an optional notify argument to object set and setProperties methods.

If the argument is not provided, set and setProperties trigger an event.

If you update many objects or do so frequently and do not need notification, performance is improved by setting silent to true.
2015-11-11 10:35:30 -07:00
Andreas Hocevar
df460d2ed1 Merge pull request #4393 from ahocevar/faster-vector-tiles
Faster vector tiles
2015-11-10 19:15:30 +01:00
Andreas Hocevar
b29b969cfe Avoid goog.getUid() with empty skippedFeaturesHash 2015-11-10 19:01:03 +01:00
Andreas Hocevar
a020251f69 Do not use fractional stroke widths 2015-11-10 18:43:28 +01:00
Tim Schaub
b2292cc6fd Merge pull request #4392 from openlayers/greenkeeper-clean-css-3.4.7
Update clean-css to version 3.4.7 🚀
2015-11-10 08:47:50 -07:00
greenkeeperio-bot
647c1a6351 chore(package): update clean-css to version 3.4.7
http://greenkeeper.io/
2015-11-10 07:55:13 -07:00
Andreas Hocevar
bfbb802b85 Merge pull request #4391 from ahocevar/unmanaged-layer-foreachfeatureatpixel
Pass null as forEachFeatureAtPixel layer arg for unmanaged layers
2015-11-09 10:19:26 +01:00
Andreas Hocevar
a446147902 Add upgrade note about forEachFeatureAtPixel change 2015-11-09 09:45:21 +01:00
Andreas Hocevar
d968f32456 Exclude unmanaged layers from selection 2015-11-09 09:45:21 +01:00
Andreas Hocevar
1aea2c2b0c Pass null as forEachFeatureAtPixel layer arg for unmanaged layers 2015-11-09 09:45:21 +01:00
Andreas Hocevar
5b817f3146 Merge pull request #4390 from ahocevar/fix-mocha-phantomjs-usage
Fix usage of mocha-phantomjs-core after update
2015-11-07 07:37:08 +01:00
Andreas Hocevar
a58f66a9a9 Fix usage of mocha-phantomjs-core after update 2015-11-06 20:34:30 +01:00
Andreas Hocevar
8e15f80d7a Merge pull request #4387 from ahocevar/common-renderer-default
Add default argument to getRendererFromQueryString
2015-11-06 17:11:35 +01:00
Andreas Hocevar
a35b3a5f52 Add default argument to getRendererFromQueryString 2015-11-06 16:58:58 +01:00
Éric Lemoine
9cf26f1fac Merge pull request #4376 from elemoine/kml-non-icon
Make KML format ignore image styles that aren't icons
2015-11-06 16:46:10 +01:00
Bart van den Eijnden
fadf63cbd0 Merge pull request #4385 from oterral/scaledflt
Don't transform the scale specified by the user
2015-11-06 16:23:41 +01:00
Éric Lemoine
daa970fe4c Make KML format ignore image styles that aren't icons 2015-11-06 15:35:20 +01:00
Andreas Hocevar
3254e08785 Merge pull request #4388 from ahocevar/fix-mocha-phantomjs
Quick-fix running tests with PhantomJS
2015-11-06 15:04:27 +01:00
Andreas Hocevar
544f951c14 Quick-fix running tests with PhantomJS 2015-11-06 14:50:58 +01:00
oterral
08a640b793 Don't transform the scale specified by the user 2015-11-06 14:29:16 +01:00
Éric Lemoine
d29f3b9068 Merge pull request #4378 from elemoine/kml-write-styles
Add a writeStyles option to KML format
2015-11-06 11:26:48 +01:00
Andreas Hocevar
d68991e982 Merge pull request #4375 from simonseyock/master
Fixed documentation typo (ol.source.ImageWMS)
2015-11-05 08:11:26 +01:00
Éric Lemoine
5c536aafc7 Add a writeStyles option to KML format 2015-11-04 17:12:04 +01:00
Simon Seyock
757d46541c Fixed documentation error
the imageLoadFunction you can give the constructor of ol.source.ImageWMS is an ol.ImageLoadFunctionType not an ol.TileLoadFunctionType
2015-11-04 12:56:41 +01:00
Éric Lemoine
dc3bf0d04b Merge pull request #4371 from dtreiter/master
Fix typo in closure compilation tutorial
2015-11-03 21:52:52 +01:00
Daniel Reiter
9cde0ab860 Fix typo in closure compilation tutorial 2015-11-03 14:37:37 -06:00
Bart van den Eijnden
bb00f4dafd Merge pull request #4370 from jonataswalker/getLayer-improve-docs
Improve ol.interaction.Select#getLayer documentation.
2015-11-03 18:58:52 +01:00
jonataswalker
16670e4015 Improve ol.interaction.Select#getLayer documentation. 2015-11-03 14:35:17 -02:00
Tim Schaub
4b85dd89a5 Merge pull request #4365 from openlayers/greenkeeper-fs-extra-0.26.2
Update fs-extra to version 0.26.2 🚀
2015-11-03 07:45:46 -08:00
Tim Schaub
71f7c70279 Merge pull request #4366 from openlayers/greenkeeper-resemblejs-2.0.1
Update resemblejs to version 2.0.1 🚀
2015-11-03 07:43:49 -08:00
Marc Jansen
2d24c8942e Merge pull request #4368 from marcjansen/fix-4367
Append KML placemark text style to existing styles
2015-11-03 15:06:33 +01:00
Marc Jansen
d24dcc7753 Be less verbose when creating text style 2015-11-03 14:27:06 +01:00
Marc Jansen
bea1501bb7 Append textStyle to existing style 2015-11-03 14:26:16 +01:00
greenkeeperio-bot
5751d342ff chore(package): update resemblejs to version 2.0.1
http://greenkeeper.io/
2015-11-03 02:21:55 -08:00
greenkeeperio-bot
8514a85353 chore(package): update fs-extra to version 0.26.2
http://greenkeeper.io/
2015-11-02 19:07:52 -08:00
Éric Lemoine
ad85e0e98d Merge pull request #4361 from elemoine/gpx
Make GPX format not fail on unsupported geometries
2015-11-02 17:54:47 +01:00
Frédéric Junod
66a99dd6c4 Merge pull request #4360 from fredj/getExtent_undef
Update getExtent return value jsdoc tag
2015-11-02 16:56:08 +01:00
Frederic Junod
eb762b6f4a Update getExtent return value jsdoc tag
The extent is never `null`; if the source is empty, the extent is
`[Infinity, Infinity, -Infinity, -Infinity]`
2015-11-02 16:30:54 +01:00
Éric Lemoine
14a1add08d Make GPX format no fail on unsupported geometries 2015-11-02 16:26:17 +01:00
Éric Lemoine
cbd1aee0cc Remove describe('readFeatures') in GPX tests
Just a remove an unnecessary level of nesting. No functional change.
2015-11-02 15:58:47 +01:00
Frédéric Junod
135d66dac7 Merge pull request #4359 from openlayers/greenkeeper-closure-util-1.9.0
Update closure-util to version 1.9.0 🚀
2015-11-02 14:31:26 +01:00
greenkeeperio-bot
3f30072de5 chore(package): update closure-util to version 1.9.0
http://greenkeeper.io/
2015-11-02 05:44:34 -07:00
49 changed files with 985 additions and 730 deletions

View File

@@ -46,6 +46,12 @@ but with additional css:
With the introduction of true vector tile support, `ol.source.TileVector` becomes obsolete. Change your code to use `ol.layer.VectorTile` and `ol.source.VectorTile` instead of `ol.layer.Vector` and `ol.source.TileVector`.
#### `ol.Map#forEachFeatureAtPixel` changes for unmanaged layers
`ol.Map#forEachFeatureAtPixel` will still be called for unmanaged layers, but the 2nd argument to the callback function will be `null` instead of a reference to the unmanaged layer. This brings back the behavior of the abandoned `ol.FeatureOverlay` that was replaced by unmanaged layers.
If you are affected by this change, please change your unmanaged layer to a regular layer by using e.g. `ol.Map#addLayer` instead of `ol.layer.Layer#setMap`.
### v3.10.0
#### `ol.layer.Layer` changes

136
changelog/v3.11.0.md Normal file
View File

@@ -0,0 +1,136 @@
# v3.11.0
## Summary
The v3.11.0 release includes features and fixes from 73 pull requests since the v3.10.1 release. New features and improvements include:
* Support for raster reprojection - load raster sources in one projection and view them in another.
* Support for Mapbox Vector Tiles!
* Improved KML support, GeoJSON & TopoJSON fixes, and much more. See below for the full list.
## Upgrade notes
#### `ol.format.KML` changes
KML icons are scaled 50% so that the rendering better matches Google Earth rendering.
If a KML placemark has a name and is a point, an `ol.style.Text` is created with the name displayed to the right of the icon (if there is an icon).
This can be controlled with the showPointNames option which defaults to true.
To disable rendering of the point names for placemarks, use the option:
new ol.format.KML({ showPointNames: false });
#### `ol.interaction.DragBox` and `ol.interaction.DragZoom` changes
Styling is no longer done with `ol.Style`, but with pure CSS. The `style` constructor option is no longer required, and no longer available. Instead, there is a `className` option for the CSS selector. The default for `ol.interaction.DragBox` is `ol-dragbox`, and `ol.interaction.DragZoom` uses `ol-dragzoom`. If you previously had
```js
new ol.interaction.DragZoom({
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'red',
width: 3
}),
fill: new ol.style.Fill({
color: [255, 255, 255, 0.4]
})
})
});
```
you'll now just need
```js
new ol.interaction.DragZoom();
```
but with additional css:
```css
.ol-dragzoom {
border-color: red;
border-width: 3px;
background-color: rgba(255,255,255,0.4);
}
```
#### Removal of `ol.source.TileVector`
With the introduction of true vector tile support, `ol.source.TileVector` becomes obsolete. Change your code to use `ol.layer.VectorTile` and `ol.source.VectorTile` instead of `ol.layer.Vector` and `ol.source.TileVector`.
#### `ol.Map#forEachFeatureAtPixel` changes for unmanaged layers
`ol.Map#forEachFeatureAtPixel` will still be called for unmanaged layers, but the 2nd argument to the callback function will be `null` instead of a reference to the unmanaged layer. This brings back the behavior of the abandoned `ol.FeatureOverlay` that was replaced by unmanaged layers.
If you are affected by this change, please change your unmanaged layer to a regular layer by using e.g. `ol.Map#addLayer` instead of `ol.layer.Layer#setMap`.
## Full list of changes
* [#4394](https://github.com/openlayers/ol3/pull/4394) - Allow ol.Object property update without notification. ([@DavidHequet](https://github.com/DavidHequet))
* [#4395](https://github.com/openlayers/ol3/pull/4395) - Flag ol.style.Text setOffsetX and Y as @api. ([@adube](https://github.com/adube))
* [#4393](https://github.com/openlayers/ol3/pull/4393) - Faster vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#4392](https://github.com/openlayers/ol3/pull/4392) - Update clean-css to version 3.4.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#4391](https://github.com/openlayers/ol3/pull/4391) - Pass null as forEachFeatureAtPixel layer arg for unmanaged layers ([@ahocevar](https://github.com/ahocevar))
* [#4390](https://github.com/openlayers/ol3/pull/4390) - Fix usage of mocha-phantomjs-core after update ([@ahocevar](https://github.com/ahocevar))
* [#4387](https://github.com/openlayers/ol3/pull/4387) - Add default argument to getRendererFromQueryString ([@ahocevar](https://github.com/ahocevar))
* [#4376](https://github.com/openlayers/ol3/pull/4376) - Make KML format ignore image styles that aren't icons ([@elemoine](https://github.com/elemoine))
* [#4385](https://github.com/openlayers/ol3/pull/4385) - Don't transform the scale specified by the user ([@oterral](https://github.com/oterral))
* [#4388](https://github.com/openlayers/ol3/pull/4388) - Quick-fix running tests with PhantomJS ([@ahocevar](https://github.com/ahocevar))
* [#4378](https://github.com/openlayers/ol3/pull/4378) - Add a writeStyles option to KML format ([@elemoine](https://github.com/elemoine))
* [#4375](https://github.com/openlayers/ol3/pull/4375) - Fixed documentation typo (ol.source.ImageWMS) ([@simonseyock](https://github.com/simonseyock))
* [#4371](https://github.com/openlayers/ol3/pull/4371) - Fix typo in closure compilation tutorial ([@dtreiter](https://github.com/dtreiter))
* [#4370](https://github.com/openlayers/ol3/pull/4370) - Improve ol.interaction.Select#getLayer documentation. ([@jonataswalker](https://github.com/jonataswalker))
* [#4365](https://github.com/openlayers/ol3/pull/4365) - Update fs-extra to version 0.26.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#4366](https://github.com/openlayers/ol3/pull/4366) - Update resemblejs to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4368](https://github.com/openlayers/ol3/pull/4368) - Append KML placemark text style to existing styles ([@marcjansen](https://github.com/marcjansen))
* [#4361](https://github.com/openlayers/ol3/pull/4361) - Make GPX format not fail on unsupported geometries ([@elemoine](https://github.com/elemoine))
* [#4360](https://github.com/openlayers/ol3/pull/4360) - Update getExtent return value jsdoc tag ([@fredj](https://github.com/fredj))
* [#4359](https://github.com/openlayers/ol3/pull/4359) - Update closure-util to version 1.9.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4357](https://github.com/openlayers/ol3/pull/4357) - Update all dependencies. ([@openlayers](https://github.com/openlayers))
* [#4356](https://github.com/openlayers/ol3/pull/4356) - Update Metalsmith and layouts plugin. ([@tschaub](https://github.com/tschaub))
* [#4355](https://github.com/openlayers/ol3/pull/4355) - Update PhantomJS. ([@tschaub](https://github.com/tschaub))
* [#4353](https://github.com/openlayers/ol3/pull/4353) - Resolve path to jsdoc-fork. ([@tschaub](https://github.com/tschaub))
* [#3627](https://github.com/openlayers/ol3/pull/3627) - Make package.json compatible for npm frontend use. ([@ThomasG77](https://github.com/ThomasG77))
* [#4163](https://github.com/openlayers/ol3/pull/4163) - Fixes for building with Node 4.x. ([@tschaub](https://github.com/tschaub))
* [#4347](https://github.com/openlayers/ol3/pull/4347) - Use require.resolve() to find jsdoc. ([@tschaub](https://github.com/tschaub))
* [#4291](https://github.com/openlayers/ol3/pull/4291) - Add 'Move a feature along a line' example. ([@jonataswalker](https://github.com/jonataswalker))
* [#4344](https://github.com/openlayers/ol3/pull/4344) - Allow different resolutions in x and y direction for ol.source.ImageStatic ([@bartvde](https://github.com/bartvde))
* [#4339](https://github.com/openlayers/ol3/pull/4339) - Make sure drawImage width and height are not too big ([@bartvde](https://github.com/bartvde))
* [#4334](https://github.com/openlayers/ol3/pull/4334) - Check view extent within image extent ([@ahocevar](https://github.com/ahocevar))
* [#4332](https://github.com/openlayers/ol3/pull/4332) - Fix write out GeoJSON features with id equal to 0 ([@fredj](https://github.com/fredj))
* [#4331](https://github.com/openlayers/ol3/pull/4331) - Allow TopoJSON features with id equal to 0 ([@fredj](https://github.com/fredj))
* [#4330](https://github.com/openlayers/ol3/pull/4330) - ol.format.TopoJSON is read only, update the jsdoc ([@openlayers](https://github.com/openlayers))
* [#4327](https://github.com/openlayers/ol3/pull/4327) - Allow GeoJSON features with id equal to 0 ([@fredj](https://github.com/fredj))
* [#4219](https://github.com/openlayers/ol3/pull/4219) - Support tiled vector data and Mapbox vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#4322](https://github.com/openlayers/ol3/pull/4322) - Add wrapX override support for ol.source.Cluster ([@FRizZL](https://github.com/FRizZL))
* [#4316](https://github.com/openlayers/ol3/pull/4316) - Render name labels if the geometry is a point in KML format (@tamarmot) ([@marcjansen](https://github.com/marcjansen))
* [#4313](https://github.com/openlayers/ol3/pull/4313) - Align logos nicely with attribution text ([@ahocevar](https://github.com/ahocevar))
* [#4297](https://github.com/openlayers/ol3/pull/4297) - Create standalone versions of ol.ext packages ([@ahocevar](https://github.com/ahocevar))
* [#4302](https://github.com/openlayers/ol3/pull/4302) - scale icons by 0.5 so they are not huge ([@tamarmot](https://github.com/tamarmot))
* [#4301](https://github.com/openlayers/ol3/pull/4301) - Remove jshint -W069 tags in source code ([@fredj](https://github.com/fredj))
* [#4273](https://github.com/openlayers/ol3/pull/4273) - Expand docs on ol.source url prop. ([@Barryrowe](https://github.com/Barryrowe))
* [#4293](https://github.com/openlayers/ol3/pull/4293) - Refine the pull request process ([@ahocevar](https://github.com/ahocevar))
* [#4289](https://github.com/openlayers/ol3/pull/4289) - Restrict maxZoom of the static-image example ([@ahocevar](https://github.com/ahocevar))
* [#4275](https://github.com/openlayers/ol3/pull/4275) - Fix ol.events.condition.mouseOnly parameter type ([@fredj](https://github.com/fredj))
* [#4248](https://github.com/openlayers/ol3/pull/4248) - Use Math.cosh of ES6/2015 if available ([@marcjansen](https://github.com/marcjansen))
* [#4286](https://github.com/openlayers/ol3/pull/4286) - Add a color manipulation example. ([@tschaub](https://github.com/tschaub))
* [#4122](https://github.com/openlayers/ol3/pull/4122) - Raster reprojection ([@klokantech](https://github.com/klokantech))
* [#4283](https://github.com/openlayers/ol3/pull/4283) - Flag ol.tilegrid.TileGrid getTileCoordExtent as @api ([@adube](https://github.com/adube))
* [#4280](https://github.com/openlayers/ol3/pull/4280) - Use overlay container instead of viewport for ol.render.Box ([@ahocevar](https://github.com/ahocevar))
* [#4278](https://github.com/openlayers/ol3/pull/4278) - Use DOM instead of map canvas for ol.render.Box ([@ahocevar](https://github.com/ahocevar))
* [#4277](https://github.com/openlayers/ol3/pull/4277) - Improve the box select example ([@fredj](https://github.com/fredj))
* [#4276](https://github.com/openlayers/ol3/pull/4276) - Better ol.events.condition.platformModifierKeyOnly documentation ([@fredj](https://github.com/fredj))
* [#4102](https://github.com/openlayers/ol3/pull/4102) - Export ol.Observable#dispatchEvent function ([@fredj](https://github.com/fredj))
* [#4261](https://github.com/openlayers/ol3/pull/4261) - ol.events.condition.mouseOnly may be wrong ([@fredj](https://github.com/fredj))
* [#4269](https://github.com/openlayers/ol3/pull/4269) - Fix Zoom control duration option - allow `0` as value ([@adube](https://github.com/adube))
* [#4268](https://github.com/openlayers/ol3/pull/4268) - Add method for retrieving ol.Overlay by id ([@jonataswalker](https://github.com/jonataswalker))
* [#4257](https://github.com/openlayers/ol3/pull/4257) - Remove unused ol.math-methods ([@marcjansen](https://github.com/marcjansen))
* [#4270](https://github.com/openlayers/ol3/pull/4270) - Fix Keyboard zoom interation options ([@adube](https://github.com/adube))
* [#4272](https://github.com/openlayers/ol3/pull/4272) - Allow the DragZoom interaction created in defaults to use zoomDuration option. ([@adube](https://github.com/adube))
* [#4271](https://github.com/openlayers/ol3/pull/4271) - Fix DragZoom interaction duration, allow `0` value ([@adube](https://github.com/adube))
* [#4267](https://github.com/openlayers/ol3/pull/4267) - Example usability improvements ([@ahocevar](https://github.com/ahocevar))
* [#4263](https://github.com/openlayers/ol3/pull/4263) - Add back CSSProperties.prototype.touchAction extern ([@fredj](https://github.com/fredj))
* [#4259](https://github.com/openlayers/ol3/pull/4259) - Remove use of toDegrees/toRadians util functions ([@marcjansen](https://github.com/marcjansen))
* [#4258](https://github.com/openlayers/ol3/pull/4258) - Remove usage of goog.dom.TagName enum ([@marcjansen](https://github.com/marcjansen))
* [#4255](https://github.com/openlayers/ol3/pull/4255) - Fix zoom slider width for retina displays ([@ahocevar](https://github.com/ahocevar))
* [#4249](https://github.com/openlayers/ol3/pull/4249) - Make whole example box clickable ([@ahocevar](https://github.com/ahocevar))
* [#4045](https://github.com/openlayers/ol3/pull/4045) - Add parser for dimension property from WMTS Capabilities.xml ([@Jenselme](https://github.com/Jenselme))
* [#4161](https://github.com/openlayers/ol3/pull/4161) - Add `translatestart`, `translateend` and `translating` events to `ol.interaction.Translate` ([@jonataswalker](https://github.com/jonataswalker))
* [#4186](https://github.com/openlayers/ol3/pull/4186) - Do not export ol.webgl.Context ([@elemoine](https://github.com/elemoine))
* [#4239](https://github.com/openlayers/ol3/pull/4239) - Changing highlighted to highlight ([@austinkeeley](https://github.com/austinkeeley))
* [#3727](https://github.com/openlayers/ol3/pull/3727) - Added getOverviewMap getter method in overviewmapcontrol.js ([@bogdanvaduva](https://github.com/bogdanvaduva))

11
changelog/v3.11.1.md Normal file
View File

@@ -0,0 +1,11 @@
# v3.11.1
## Summary
The v3.11.1 release is a patch release that addresses a few regressions in the v3.11.0 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10.
## Fixes
* [#4413](https://github.com/openlayers/ol3/pull/4413) - Revert "Merge pull request #4339 from bartvde/issue-4337" ([@bartvde](https://github.com/bartvde))
* [#4412](https://github.com/openlayers/ol3/pull/4412) - Revert "Merge pull request #4344 from bartvde/issue-2844" ([@ahocevar](https://github.com/ahocevar))
* [#4408](https://github.com/openlayers/ol3/pull/4408) - Use ratio when calculating ImageWMS width and height ([@ahocevar](https://github.com/ahocevar))

11
changelog/v3.11.2.md Normal file
View File

@@ -0,0 +1,11 @@
# v3.11.2
## Summary
The v3.11.2 release is a patch release that addresses a few regressions in the v3.11.1 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10.
## Fixes
* [#4450](https://github.com/openlayers/ol3/pull/4450) - Fix select interaction regression caused by #4391 ([@ahocevar](https://github.com/ahocevar))
* [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj))
* [#4439](https://github.com/openlayers/ol3/pull/4439) - Allow '' for crossOrigin (as Anonymous alias) ([@ahocevar](https://github.com/ahocevar))

View File

@@ -312,7 +312,7 @@ directory:
```
Note that the page includes a `script` tag referencing the `app.js` file,
which is the file resuted from the compilation.
which is the file resulting from the compilation.
You are done!

View File

@@ -78,14 +78,8 @@ var vector = new ol.layer.Vector({
source: vectorSource
});
// Use the "webgl" renderer by default.
var renderer = common.getRendererFromQueryString();
if (!renderer) {
renderer = 'webgl';
}
var map = new ol.Map({
renderer: renderer,
renderer: common.getRendererFromQueryString('webgl'),
layers: [vector],
target: document.getElementById('map'),
view: new ol.View({

View File

@@ -83,7 +83,7 @@
var common = {};
common.getRendererFromQueryString = function() {
common.getRendererFromQueryString = function(opt_default) {
var obj = {};
var queryString = location.search.slice(1);
var re = /([^&=]+)=([^&]*)/g;
@@ -98,6 +98,6 @@ common.getRendererFromQueryString = function() {
} else if ('renderer' in obj) {
return [obj['renderer']];
} else {
return undefined;
return opt_default;
}
};

View File

@@ -53,16 +53,16 @@ function createMapboxStreetsV6Style() {
} else if (layer == 'waterway' &&
cls != 'river' && cls != 'stream' && cls != 'canal') {
stroke.setColor('#a0c8f0');
stroke.setWidth(1.3);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'waterway' && cls == 'river') {
stroke.setColor('#a0c8f0');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'waterway' && (cls == 'stream' ||
cls == 'canal')) {
stroke.setColor('#a0c8f0');
stroke.setWidth(1.3);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'water') {
fill.setColor('#a0c8f0');
@@ -73,7 +73,7 @@ function createMapboxStreetsV6Style() {
} else if (layer == 'aeroway' && geom == 'LineString' &&
resolution <= 76.43702828517625) {
stroke.setColor('#f0ede9');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'building') {
fill.setColor('#f2eae2');
@@ -82,90 +82,90 @@ function createMapboxStreetsV6Style() {
styles[length++] = strokedPolygon;
} else if (layer == 'tunnel' && cls == 'motorway_link') {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'tunnel' && cls == 'service') {
stroke.setColor('#cfcdca');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'tunnel' &&
(cls == 'street' || cls == 'street_limited')) {
stroke.setColor('#cfcdca');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'tunnel' && cls == 'main' &&
resolution <= 1222.99245256282) {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'tunnel' && cls == 'motorway') {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'tunnel' && cls == 'path') {
stroke.setColor('#cba');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'tunnel' && cls == 'major_rail') {
stroke.setColor('#bbb');
stroke.setWidth(1.4);
stroke.setWidth(2);
styles[length++] = line;
} else if (layer == 'road' && cls == 'motorway_link') {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'road' && (cls == 'street' ||
cls == 'street_limited') && geom == 'LineString') {
stroke.setColor('#cfcdca');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'road' && cls == 'main' &&
resolution <= 1222.99245256282) {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'road' && cls == 'motorway' &&
resolution <= 4891.96981025128) {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'road' && cls == 'path') {
stroke.setColor('#cba');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'road' && cls == 'major_rail') {
stroke.setColor('#bbb');
stroke.setWidth(1.4);
stroke.setWidth(2);
styles[length++] = line;
} else if (layer == 'bridge' && cls == 'motorway_link') {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'bridge' && cls == 'motorway') {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'bridge' && cls == 'service') {
stroke.setColor('#cfcdca');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'bridge' &&
(cls == 'street' || cls == 'street_limited')) {
stroke.setColor('#cfcdca');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'bridge' && cls == 'main' &&
resolution <= 1222.99245256282) {
stroke.setColor('#e9ac77');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'bridge' && cls == 'path') {
stroke.setColor('#cba');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = line;
} else if (layer == 'bridge' && cls == 'major_rail') {
stroke.setColor('#bbb');
stroke.setWidth(1.4);
stroke.setWidth(2);
styles[length++] = line;
} else if (layer == 'admin' && adminLevel >= 3 && maritime === 0) {
stroke.setColor('#9e9cab');
@@ -227,7 +227,7 @@ function createMapboxStreetsV6Style() {
'italic 11px "Open Sans", "Arial Unicode MS"');
fill.setColor('#74aee9');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(0.75);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'marine_label' && labelrank === 2 &&
geom == 'Point') {
@@ -236,7 +236,7 @@ function createMapboxStreetsV6Style() {
'italic 11px "Open Sans", "Arial Unicode MS"');
fill.setColor('#74aee9');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(0.75);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'marine_label' && labelrank === 3 &&
geom == 'Point') {
@@ -245,7 +245,7 @@ function createMapboxStreetsV6Style() {
'italic 10px "Open Sans", "Arial Unicode MS"');
fill.setColor('#74aee9');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(0.75);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'marine_label' && labelrank === 4 &&
geom == 'Point') {
@@ -254,7 +254,7 @@ function createMapboxStreetsV6Style() {
'italic 9px "Open Sans", "Arial Unicode MS"');
fill.setColor('#74aee9');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(0.75);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'place_label' && type == 'city' &&
resolution <= 1222.99245256282) {
@@ -262,7 +262,7 @@ function createMapboxStreetsV6Style() {
text.getText().setFont('11px "Open Sans", "Arial Unicode MS"');
fill.setColor('#333');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'place_label' && type == 'town' &&
resolution <= 305.748113140705) {
@@ -270,7 +270,7 @@ function createMapboxStreetsV6Style() {
text.getText().setFont('9px "Open Sans", "Arial Unicode MS"');
fill.setColor('#333');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'place_label' && type == 'village' &&
resolution <= 38.21851414258813) {
@@ -278,7 +278,7 @@ function createMapboxStreetsV6Style() {
text.getText().setFont('8px "Open Sans", "Arial Unicode MS"');
fill.setColor('#333');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'place_label' &&
resolution <= 19.109257071294063 && (type == 'hamlet' ||
@@ -287,7 +287,7 @@ function createMapboxStreetsV6Style() {
text.getText().setFont('bold 9px "Arial Narrow"');
fill.setColor('#633');
stroke.setColor('rgba(255,255,255,0.8)');
stroke.setWidth(1.2);
stroke.setWidth(1);
styles[length++] = text;
} else if (layer == 'poi_label' && resolution <= 19.109257071294063 &&
scalerank == 1 && maki !== 'marker') {

View File

@@ -106,14 +106,8 @@ var vector = new ol.layer.Vector({
source: vectorSource
});
// Use the "webgl" renderer by default.
var renderer = common.getRendererFromQueryString();
if (!renderer) {
renderer = 'webgl';
}
var map = new ol.Map({
renderer: renderer,
renderer: common.getRendererFromQueryString('webgl'),
layers: [vector],
target: document.getElementById('map'),
view: new ol.View({

View File

@@ -6,9 +6,10 @@ var common;
/**
* @param {string=} opt_default Default renderer.
* @return {string} Renderer type.
*/
common.getRendererFromQueryString = function() {};
common.getRendererFromQueryString = function(opt_default) {};
/**

View File

@@ -1796,7 +1796,8 @@ olx.format.IGCOptions.prototype.altitudeMode;
/**
* @typedef {{extractStyles: (boolean|undefined),
* defaultStyle: (Array.<ol.style.Style>|undefined),
* showPointNames: (boolean|undefined)}}
* showPointNames: (boolean|undefined),
* writeStyles: (boolean|undefined)}}
* @api
*/
olx.format.KMLOptions;
@@ -1826,6 +1827,14 @@ olx.format.KMLOptions.prototype.showPointNames;
olx.format.KMLOptions.prototype.defaultStyle;
/**
* Write styles into KML. Default is `true`.
* @type {boolean|undefined}
* @api stable
*/
olx.format.KMLOptions.prototype.writeStyles;
/**
* @typedef {{featureNS: (Object.<string, string>|string|undefined),
* featureType: (Array.<string>|string|undefined),
@@ -4784,7 +4793,7 @@ olx.source.ImageWMSOptions.prototype.serverType;
/**
* Optional function to load an image given a URL.
* @type {ol.TileLoadFunctionType|undefined}
* @type {ol.ImageLoadFunctionType|undefined}
* @api
*/
olx.source.ImageWMSOptions.prototype.imageLoadFunction;

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "3.11.0-beta.2",
"version": "3.11.2",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -32,9 +32,9 @@
"async": "1.5.0",
"bluebird": "^3.0.5",
"browserify": "12.0.1",
"closure-util": "1.8.0",
"closure-util": "1.9.0",
"derequire": "2.0.3",
"fs-extra": "0.26.0",
"fs-extra": "0.26.2",
"glob": "5.0.15",
"graceful-fs": "4.1.2",
"handlebars": "4.0.4",
@@ -51,7 +51,7 @@
"walk": "2.3.9"
},
"devDependencies": {
"clean-css": "3.4.6",
"clean-css": "3.4.7",
"coveralls": "2.11.4",
"debounce": "^1.0.0",
"expect.js": "0.3.1",
@@ -60,11 +60,11 @@
"jquery": "2.1.4",
"jshint": "2.8.0",
"mocha": "2.3.3",
"mocha-phantomjs-core": "^1.2.1",
"mocha-phantomjs-core": "^1.3.0",
"mustache": "2.2.0",
"phantomjs": "1.9.18",
"proj4": "2.3.12",
"resemblejs": "1.3.1",
"resemblejs": "2.0.1",
"sinon": "1.17.2",
"slimerjs-edge": "0.10.0-pre-3",
"wrench": "1.5.8"

View File

@@ -839,11 +839,13 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
'value should be an ol.Feature');
var geometry = value.getGeometry();
if (geometry) {
var parentNode = objectStack[objectStack.length - 1].node;
goog.asserts.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI,
ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()]);
var nodeName = ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_[geometry.getType()];
if (nodeName) {
var parentNode = objectStack[objectStack.length - 1].node;
goog.asserts.assert(ol.xml.isNode(parentNode),
'parentNode should be an XML node');
return ol.xml.createElementNS(parentNode.namespaceURI, nodeName);
}
}
};

View File

@@ -92,6 +92,13 @@ ol.format.KML = function(opt_options) {
this.extractStyles_ = options.extractStyles !== undefined ?
options.extractStyles : true;
/**
* @private
* @type {boolean}
*/
this.writeStyles_ = options.writeStyles !== undefined ?
options.writeStyles : true;
/**
* @private
* @type {Object.<string, (Array.<ol.style.Style>|string)>}
@@ -342,11 +349,7 @@ ol.format.KML.createNameStyleFunction_ = function(foundStyle, name) {
});
}
var nameStyle = new ol.style.Style({
fill: undefined,
image: undefined,
text: textStyle,
stroke: undefined,
zIndex: undefined
text: textStyle
});
return nameStyle;
};
@@ -394,7 +397,7 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl,
if (drawName) {
nameStyle = ol.format.KML.createNameStyleFunction_(style[0],
name);
return [style, nameStyle];
return style.concat(nameStyle);
}
return style;
}
@@ -651,6 +654,9 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
(object['scale']);
if (src == ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_) {
size = ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_;
if (scale === undefined) {
scale = ol.format.KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_;
}
}
var imageStyle = new ol.style.Icon({
@@ -662,7 +668,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
offset: offset,
offsetOrigin: ol.style.IconOrigin.BOTTOM_LEFT,
rotation: rotation,
scale: ol.format.KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_ * scale,
scale: scale,
size: size,
src: src
});
@@ -2173,6 +2179,7 @@ ol.format.KML.writeCoordinatesTextNode_ =
* @param {Node} node Node.
* @param {Array.<ol.Feature>} features Features.
* @param {Array.<*>} objectStack Object stack.
* @this {ol.format.KML}
* @private
*/
ol.format.KML.writeDocument_ = function(node, features, objectStack) {
@@ -2370,6 +2377,7 @@ ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
* @param {Node} node Node.
* @param {ol.Feature} feature Feature.
* @param {Array.<*>} objectStack Object stack.
* @this {ol.format.KML}
* @private
*/
ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
@@ -2382,14 +2390,18 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
// serialize properties (properties unknown to KML are not serialized)
var properties = feature.getProperties();
var styleFunction = feature.getStyleFunction();
if (styleFunction) {
// FIXME the styles returned by the style function are supposed to be
// resolution-independent here
var styles = styleFunction.call(feature, 0);
if (styles && styles.length > 0) {
properties['Style'] = styles[0];
var textStyle = styles[0].getText();
var style = styles[0];
if (this.writeStyles_) {
properties['Style'] = styles[0];
}
var textStyle = style.getText();
if (textStyle) {
properties['name'] = textStyle.getText();
}
@@ -2500,7 +2512,7 @@ ol.format.KML.writeStyle_ = function(node, style, objectStack) {
var strokeStyle = style.getStroke();
var imageStyle = style.getImage();
var textStyle = style.getText();
if (imageStyle) {
if (imageStyle instanceof ol.style.Icon) {
properties['IconStyle'] = imageStyle;
}
if (textStyle) {
@@ -2992,6 +3004,7 @@ ol.format.KML.prototype.writeFeaturesNode = function(features, opt_options) {
var orderedKeys = ol.format.KML.KML_SEQUENCE_[kml.namespaceURI];
var values = ol.xml.makeSequence(properties, orderedKeys);
ol.xml.pushSerializeAndPop(context, ol.format.KML.KML_SERIALIZERS_,
ol.xml.OBJECT_PROPERTY_NODE_FACTORY, values, [opt_options], orderedKeys);
ol.xml.OBJECT_PROPERTY_NODE_FACTORY, values, [opt_options], orderedKeys,
this);
return kml;
};

View File

@@ -14,7 +14,7 @@ goog.require('ol.extent');
* @constructor
* @extends {ol.ImageBase}
* @param {ol.Extent} extent Extent.
* @param {Array.<number>|undefined} resolution Resolution.
* @param {number|undefined} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {Array.<ol.Attribution>} attributions Attributions.
* @param {string} src Image source URI.
@@ -38,7 +38,7 @@ ol.Image = function(extent, resolution, pixelRatio, attributions, src,
* @type {Image}
*/
this.image_ = new Image();
if (crossOrigin) {
if (crossOrigin !== null) {
this.image_.crossOrigin = crossOrigin;
}
@@ -114,10 +114,7 @@ ol.Image.prototype.handleImageError_ = function() {
*/
ol.Image.prototype.handleImageLoad_ = function() {
if (this.resolution === undefined) {
this.resolution = [
ol.extent.getWidth(this.extent) / this.image_.width,
ol.extent.getHeight(this.extent) / this.image_.height
];
this.resolution = ol.extent.getHeight(this.extent) / this.image_.height;
}
this.state = ol.ImageState.LOADED;
this.unlistenImage_();

View File

@@ -24,9 +24,7 @@ ol.ImageState = {
* @constructor
* @extends {goog.events.EventTarget}
* @param {ol.Extent} extent Extent.
* @param {Array.<number>|undefined} resolution Resolution, first value
* is the resolution in the x direction, second value is the resolution
* in the y direction.
* @param {number|undefined} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.ImageState} state State.
* @param {Array.<ol.Attribution>} attributions Attributions.
@@ -55,7 +53,7 @@ ol.ImageBase = function(extent, resolution, pixelRatio, state, attributions) {
/**
* @protected
* @type {Array.<number>|undefined}
* @type {number|undefined}
*/
this.resolution = resolution;
@@ -109,7 +107,7 @@ ol.ImageBase.prototype.getPixelRatio = function() {
/**
* @return {Array.<number>} Resolution.
* @return {number} Resolution.
*/
ol.ImageBase.prototype.getResolution = function() {
goog.asserts.assert(this.resolution !== undefined, 'resolution not yet set');

View File

@@ -30,8 +30,7 @@ ol.ImageCanvas = function(extent, resolution, pixelRatio, attributions,
var state = opt_loader !== undefined ?
ol.ImageState.IDLE : ol.ImageState.LOADED;
goog.base(this, extent, [resolution, resolution], pixelRatio, state,
attributions);
goog.base(this, extent, resolution, pixelRatio, state, attributions);
/**
* @private

View File

@@ -37,7 +37,7 @@ ol.ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction) {
* @type {Image}
*/
this.image_ = new Image();
if (crossOrigin) {
if (crossOrigin !== null) {
this.image_.crossOrigin = crossOrigin;
}

View File

@@ -97,6 +97,8 @@ goog.inherits(ol.interaction.SelectEvent, goog.events.Event);
* `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a
* further feature filter using the `filter` option.
*
* Selected features are added to an internal unmanaged layer.
*
* @constructor
* @extends {ol.interaction.Interaction}
* @param {olx.interaction.SelectOptions=} opt_options Options.
@@ -235,7 +237,9 @@ ol.interaction.Select.prototype.getFeatures = function() {
/**
* Returns the associated {@link ol.layer.Vector vectorlayer} of
* the (last) selected feature.
* the (last) selected feature. Note that this will not work with any
* programmatic method like pushing features to
* {@link ol.interaction.Select#getFeatures collection}.
* @param {ol.Feature|ol.render.Feature} feature Feature
* @return {ol.layer.Vector} Layer.
* @api
@@ -279,7 +283,7 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
* @param {ol.layer.Layer} layer Layer.
*/
function(feature, layer) {
if (this.filter_(feature, layer)) {
if (!layer || this.filter_(feature, layer)) {
selected.push(feature);
this.addFeatureLayerAssociation_(feature, layer);
return !this.multi_;

View File

@@ -20,6 +20,11 @@ goog.require('ol.source.State');
* Layers group together those properties that pertain to how the data is to be
* displayed, irrespective of the source of that data.
*
* Layers are usually added to a map with {@link ol.Map#addLayer}. Components
* like {@link ol.interaction.Select} use unmanaged layers internally. These
* unmanaged layers are associated with the map using
* {@link ol.layer.Layer#setMap} instead.
*
* A generic `change` event is fired when the state of the source changes.
*
* @constructor

View File

@@ -599,8 +599,9 @@ ol.Map.prototype.disposeInternal = function() {
* called with two arguments. The first argument is one
* {@link ol.Feature feature} or
* {@link ol.render.Feature render feature} at the pixel, the second is
* the {@link ol.layer.Layer layer} of the feature. To stop detection,
* callback functions can return a truthy value.
* the {@link ol.layer.Layer layer} of the feature and will be null for
* unmanaged layers. To stop detection, callback functions can return a
* truthy value.
* @param {S=} opt_this Value to use as `this` when executing `callback`.
* @param {(function(this: U, ol.layer.Layer): boolean)=} opt_layerFilter Layer
* filter function. The filter function will receive one argument, the

View File

@@ -197,12 +197,17 @@ ol.Object.prototype.notify = function(key, oldValue) {
* Sets a value.
* @param {string} key Key name.
* @param {*} value Value.
* @param {boolean=} opt_silent Update without triggering an event.
* @api stable
*/
ol.Object.prototype.set = function(key, value) {
var oldValue = this.values_[key];
this.values_[key] = value;
this.notify(key, oldValue);
ol.Object.prototype.set = function(key, value, opt_silent) {
if (opt_silent) {
this.values_[key] = value;
} else {
var oldValue = this.values_[key];
this.values_[key] = value;
this.notify(key, oldValue);
}
};
@@ -210,12 +215,13 @@ ol.Object.prototype.set = function(key, value) {
* Sets a collection of key-value pairs. Note that this changes any existing
* properties and adds new ones (it does not remove any existing properties).
* @param {Object.<string, *>} values Values.
* @param {boolean=} opt_silent Update without triggering an event.
* @api stable
*/
ol.Object.prototype.setProperties = function(values) {
ol.Object.prototype.setProperties = function(values, opt_silent) {
var key;
for (key in values) {
this.set(key, values[key]);
this.set(key, values[key], opt_silent);
}
};
@@ -223,12 +229,15 @@ ol.Object.prototype.setProperties = function(values) {
/**
* Unsets a property.
* @param {string} key Key name.
* @param {boolean=} opt_silent Unset without triggering an event.
* @api stable
*/
ol.Object.prototype.unset = function(key) {
ol.Object.prototype.unset = function(key, opt_silent) {
if (key in this.values_) {
var oldValue = this.values_[key];
delete this.values_[key];
this.notify(key, oldValue);
if (!opt_silent) {
this.notify(key, oldValue);
}
}
};

View File

@@ -246,6 +246,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
goog.asserts.assert(pixelCoordinates === this.pixelCoordinates_,
'pixelCoordinates should be the same as this.pixelCoordinates_');
}
var skipFeatures = !goog.object.isEmpty(skippedFeaturesHash);
var i = 0; // instruction index
var ii = instructions.length; // end of instructions
var d = 0; // data index
@@ -259,8 +260,8 @@ ol.render.canvas.Replay.prototype.replay_ = function(
switch (type) {
case ol.render.canvas.Instruction.BEGIN_GEOMETRY:
feature = /** @type {ol.Feature|ol.render.Feature} */ (instruction[1]);
var featureUid = goog.getUid(feature).toString();
if (skippedFeaturesHash[featureUid] !== undefined ||
if ((skipFeatures &&
skippedFeaturesHash[goog.getUid(feature).toString()]) ||
!feature.getGeometry()) {
i = /** @type {number} */ (instruction[2]);
} else if (opt_hitExtent !== undefined && !ol.extent.intersects(
@@ -343,10 +344,8 @@ ol.render.canvas.Replay.prototype.replay_ = function(
context.globalAlpha = alpha * opacity;
}
var w = width - originX;
var h = height - originY;
context.drawImage(image, originX, originY, w, h, x, y,
w * pixelRatio, h * pixelRatio);
context.drawImage(image, originX, originY, width, height,
x, y, width * pixelRatio, height * pixelRatio);
if (opacity != 1) {
context.globalAlpha = alpha;

View File

@@ -193,19 +193,15 @@ ol.renderer.canvas.ImageLayer.prototype.prepareFrame =
var imageExtent = image.getExtent();
var imageResolution = image.getResolution();
var imagePixelRatio = image.getPixelRatio();
var xImageResolution = imageResolution[0];
var yImageResolution = imageResolution[1];
var xScale = pixelRatio * xImageResolution /
(viewResolution * imagePixelRatio);
var yScale = pixelRatio * yImageResolution /
var scale = pixelRatio * imageResolution /
(viewResolution * imagePixelRatio);
ol.vec.Mat4.makeTransform2D(this.imageTransform_,
pixelRatio * frameState.size[0] / 2,
pixelRatio * frameState.size[1] / 2,
xScale, yScale,
scale, scale,
viewRotation,
imagePixelRatio * (imageExtent[0] - viewCenter[0]) / xImageResolution,
imagePixelRatio * (viewCenter[1] - imageExtent[3]) / yImageResolution);
imagePixelRatio * (imageExtent[0] - viewCenter[0]) / imageResolution,
imagePixelRatio * (viewCenter[1] - imageExtent[3]) / imageResolution);
this.imageTransformInv_ = null;
this.updateAttributions(frameState.attributions, image.getAttributions());
this.updateLogos(frameState, imageSource);

View File

@@ -174,7 +174,9 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate =
if (layer.getSource()) {
result = layerRenderer.forEachFeatureAtCoordinate(
layer.getSource().getWrapX() ? translatedCoordinate : coordinate,
frameState, callback, thisArg);
frameState,
layerState.managed ? callback : forEachFeatureAtCoordinate,
thisArg);
}
if (result) {
return result;

View File

@@ -116,9 +116,8 @@ ol.reproj.Image = function(sourceProj, targetProj,
attributions = this.sourceImage_.getAttributions();
}
goog.base(this, targetExtent, [targetResolution, targetResolution],
this.sourcePixelRatio_, state, attributions);
goog.base(this, targetExtent, targetResolution, this.sourcePixelRatio_,
state, attributions);
};
goog.inherits(ol.reproj.Image, ol.ImageBase);

View File

@@ -93,7 +93,7 @@ ol.reproj.enlargeClipPoint_ = function(centroidX, centroidY, x, y) {
* @param {number} width Width of the canvas.
* @param {number} height Height of the canvas.
* @param {number} pixelRatio Pixel ratio.
* @param {Array.<number>} sourceResolution Source resolution.
* @param {number} sourceResolution Source resolution.
* @param {ol.Extent} sourceExtent Extent of the data source.
* @param {number} targetResolution Target resolution.
* @param {ol.Extent} targetExtent Target extent.
@@ -124,14 +124,12 @@ ol.reproj.render = function(width, height, pixelRatio,
var canvasWidthInUnits = ol.extent.getWidth(sourceDataExtent);
var canvasHeightInUnits = ol.extent.getHeight(sourceDataExtent);
var sourceResolutionX = sourceResolution[0];
var sourceResolutionY = sourceResolution[1];
var stitchContext = ol.dom.createCanvasContext2D(
Math.round(pixelRatio * canvasWidthInUnits / sourceResolutionX),
Math.round(pixelRatio * canvasHeightInUnits / sourceResolutionY));
Math.round(pixelRatio * canvasWidthInUnits / sourceResolution),
Math.round(pixelRatio * canvasHeightInUnits / sourceResolution));
stitchContext.scale(pixelRatio / sourceResolutionX,
pixelRatio / sourceResolutionY);
stitchContext.scale(pixelRatio / sourceResolution,
pixelRatio / sourceResolution);
stitchContext.translate(-sourceDataExtent[0], sourceDataExtent[3]);
sources.forEach(function(src, i, arr) {
@@ -224,8 +222,8 @@ ol.reproj.render = function(width, height, pixelRatio,
context.translate(sourceDataExtent[0] - sourceNumericalShiftX,
sourceDataExtent[3] - sourceNumericalShiftY);
context.scale(sourceResolutionX / pixelRatio,
-sourceResolutionY / pixelRatio);
context.scale(sourceResolution / pixelRatio,
-sourceResolution / pixelRatio);
context.drawImage(stitchContext.canvas, 0, 0);
context.restore();

View File

@@ -258,7 +258,7 @@ ol.reproj.Tile.prototype.reproject_ = function() {
var targetExtent = this.targetTileGrid_.getTileCoordExtent(tileCoord);
this.canvas_ = ol.reproj.render(width, height, this.pixelRatio_,
[sourceResolution, sourceResolution], this.sourceTileGrid_.getExtent(),
sourceResolution, this.sourceTileGrid_.getExtent(),
targetResolution, targetExtent, this.triangulation_, sources,
this.renderEdges_);

View File

@@ -150,7 +150,7 @@ ol.source.ImageMapGuide.prototype.getImageInternal =
var imageUrl = this.imageUrlFunction_(extent, size, projection);
if (imageUrl !== undefined) {
image = new ol.Image(extent, [resolution, resolution], pixelRatio,
image = new ol.Image(extent, resolution, pixelRatio,
this.getAttributions(), imageUrl, this.crossOrigin_,
this.imageLoadFunction_);
goog.events.listen(image, goog.events.EventType.CHANGE,

View File

@@ -26,12 +26,10 @@ ol.source.ImageStatic = function(options) {
var imageExtent = options.imageExtent;
var xResolution, yResolution, resolutions, imgResolution;
var resolution, resolutions;
if (options.imageSize !== undefined) {
xResolution = ol.extent.getWidth(imageExtent) / options.imageSize[0];
yResolution = ol.extent.getHeight(imageExtent) / options.imageSize[1];
imgResolution = [xResolution, yResolution];
resolutions = [yResolution];
resolution = ol.extent.getHeight(imageExtent) / options.imageSize[1];
resolutions = [resolution];
}
var crossOrigin = options.crossOrigin !== undefined ?
@@ -52,8 +50,8 @@ ol.source.ImageStatic = function(options) {
* @private
* @type {ol.Image}
*/
this.image_ = new ol.Image(imageExtent, imgResolution, 1,
attributions, options.url, crossOrigin, imageLoadFunction);
this.image_ = new ol.Image(imageExtent, resolution, 1, attributions,
options.url, crossOrigin, imageLoadFunction);
goog.events.listen(this.image_, goog.events.EventType.CHANGE,
this.handleImageChange, false, this);

View File

@@ -203,21 +203,13 @@ ol.source.ImageWMS.prototype.getImageInternal =
var centerY = (extent[1] + extent[3]) / 2;
var imageResolution = resolution / pixelRatio;
// Compute an integer width and height.
var width = Math.ceil(ol.extent.getWidth(extent) / imageResolution);
var height = Math.ceil(ol.extent.getHeight(extent) / imageResolution);
// Modify the extent to match the integer width and height.
extent[0] = centerX - imageResolution * width / 2;
extent[2] = centerX + imageResolution * width / 2;
extent[1] = centerY - imageResolution * height / 2;
extent[3] = centerY + imageResolution * height / 2;
var imageWidth = ol.extent.getWidth(extent) / imageResolution;
var imageHeight = ol.extent.getHeight(extent) / imageResolution;
var image = this.image_;
if (image &&
this.renderedRevision_ == this.getRevision() &&
image.getResolution()[0] == resolution &&
image.getResolution() == resolution &&
image.getPixelRatio() == pixelRatio &&
ol.extent.containsExtent(image.getExtent(), extent)) {
return image;
@@ -241,13 +233,13 @@ ol.source.ImageWMS.prototype.getImageInternal =
};
goog.object.extend(params, this.params_);
this.imageSize_[0] = width;
this.imageSize_[1] = height;
this.imageSize_[0] = Math.ceil(imageWidth * this.ratio_);
this.imageSize_[1] = Math.ceil(imageHeight * this.ratio_);
var url = this.getRequestUrl_(extent, this.imageSize_, pixelRatio,
projection, params);
this.image_ = new ol.Image(extent, [resolution, resolution], pixelRatio,
this.image_ = new ol.Image(extent, resolution, pixelRatio,
this.getAttributions(), url, this.crossOrigin_, this.imageLoadFunction_);
this.renderedRevision_ = this.getRevision();

View File

@@ -91,7 +91,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ =
pixelRatio, projection, params) {
var urls = this.urls;
if (urls.length === 0) {
if (!urls) {
return undefined;
}

View File

@@ -212,7 +212,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ =
pixelRatio, projection, params) {
var urls = this.urls;
if (urls.length === 0) {
if (!urls) {
return undefined;
}
@@ -298,9 +298,11 @@ ol.source.TileWMS.prototype.resetCoordKeyPrefix_ = function() {
var i = 0;
var res = [];
var j, jj;
for (j = 0, jj = this.urls.length; j < jj; ++j) {
res[i++] = this.urls[j];
if (this.urls) {
var j, jj;
for (j = 0, jj = this.urls.length; j < jj; ++j) {
res[i++] = this.urls[j];
}
}
var key;

View File

@@ -659,7 +659,7 @@ ol.source.Vector.prototype.getClosestFeatureToCoordinate =
*
* This method is not available when the source is configured with
* `useSpatialIndex` set to `false`.
* @return {ol.Extent} Extent.
* @return {!ol.Extent} Extent.
* @api stable
*/
ol.source.Vector.prototype.getExtent = function() {

View File

@@ -253,7 +253,7 @@ ol.structs.RBush.prototype.clear = function() {
/**
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @return {!ol.Extent} Extent.
*/
ol.structs.RBush.prototype.getExtent = function(opt_extent) {
// FIXME add getExtent() to rbush

View File

@@ -392,7 +392,7 @@ ol.style.IconImage_ = function(image, src, size, crossOrigin, imageState) {
*/
this.image_ = !image ? new Image() : image;
if (crossOrigin) {
if (crossOrigin !== null) {
this.image_.crossOrigin = crossOrigin;
}

View File

@@ -205,6 +205,7 @@ ol.style.Text.prototype.setFont = function(font) {
* Set the x offset.
*
* @param {number} offsetX Horizontal text offset.
* @api
*/
ol.style.Text.prototype.setOffsetX = function(offsetX) {
this.offsetX_ = offsetX;
@@ -215,6 +216,7 @@ ol.style.Text.prototype.setOffsetX = function(offsetX) {
* Set the y offset.
*
* @param {number} offsetY Vertical text offset.
* @api
*/
ol.style.Text.prototype.setOffsetY = function(offsetY) {
this.offsetY_ = offsetY;

View File

@@ -59,14 +59,20 @@ function runTests(includeCoverage, callback) {
var url = 'http://' + address.address + ':' + address.port;
var args = [
require.resolve('mocha-phantomjs-core'),
url + '/test/index.html'
url + '/test/index.html',
'spec'
];
var config = {
ignoreResourceErrors: true,
useColors: true,
};
if (includeCoverage) {
args.push('spec', '{"hooks": "' +
path.join(__dirname, '../test/phantom_hooks.js') + '"}');
config.hooks = path.join(__dirname, '../test/phantom_hooks.js');
}
args.push(JSON.stringify(config));
var child = spawn(phantomjs.path, args, {stdio: 'inherit'});
child.on('exit', function(code) {
callback(code);

File diff suppressed because it is too large Load Diff

View File

@@ -1337,6 +1337,7 @@ describe('ol.format.KML', function() {
expect(imageStyle.getOrigin()).to.be(null);
expect(imageStyle.getRotation()).to.eql(0);
expect(imageStyle.getSize()).to.be(null);
expect(imageStyle.getScale()).to.be(1);
expect(style.getText()).to.be(ol.format.KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -1348,6 +1349,7 @@ describe('ol.format.KML', function() {
' <Placemark>' +
' <Style>' +
' <IconStyle>' +
' <scale>3.0</scale>' +
' <Icon>' +
' <href>http://foo.png</href>' +
' <gx:x>24</gx:x>' +
@@ -1380,6 +1382,7 @@ describe('ol.format.KML', function() {
expect(imageStyle.getAnchor()).to.eql([24, 36]);
expect(imageStyle.getOrigin()).to.eql([24, 108]);
expect(imageStyle.getRotation()).to.eql(0);
expect(imageStyle.getScale()).to.eql(Math.sqrt(3));
expect(style.getText()).to.be(ol.format.KML.DEFAULT_TEXT_STYLE_);
expect(style.getZIndex()).to.be(undefined);
});
@@ -1779,6 +1782,54 @@ describe('ol.format.KML', function() {
expect(node).to.xmleql(ol.xml.parse(text));
});
it('does not write styles when writeStyles option is false', function() {
format = new ol.format.KML({writeStyles: false});
var style = new ol.style.Style({
image: new ol.style.Icon({
src: 'http://foo.png'
})
});
var feature = new ol.Feature();
feature.setStyle([style]);
var node = format.writeFeaturesNode([feature]);
var text =
'<kml xmlns="http://www.opengis.net/kml/2.2"' +
' xmlns:gx="http://www.google.com/kml/ext/2.2"' +
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
' xsi:schemaLocation="http://www.opengis.net/kml/2.2' +
' https://developers.google.com/kml/schema/kml22gx.xsd">' +
' <Placemark>' +
' </Placemark>' +
'</kml>';
expect(node).to.xmleql(ol.xml.parse(text));
});
it('skips image styles that are not icon styles', function() {
var style = new ol.style.Style({
image: new ol.style.Circle({
radius: 4,
fill: new ol.style.Fill({
color: 'rgb(12, 34, 223)'
})
})
});
var feature = new ol.Feature();
feature.setStyle([style]);
var node = format.writeFeaturesNode([feature]);
var text =
'<kml xmlns="http://www.opengis.net/kml/2.2"' +
' xmlns:gx="http://www.google.com/kml/ext/2.2"' +
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
' xsi:schemaLocation="http://www.opengis.net/kml/2.2' +
' https://developers.google.com/kml/schema/kml22gx.xsd">' +
' <Placemark>' +
' <Style>' +
' </Style>' +
' </Placemark>' +
'</kml>';
expect(node).to.xmleql(ol.xml.parse(text));
});
it('can write an feature\'s text style', function() {
var style = new ol.style.Style({
text: new ol.style.Text({
@@ -2725,6 +2776,7 @@ goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.MultiPolygon');
goog.require('ol.geom.Point');
goog.require('ol.geom.Polygon');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.IconOrigin');

View File

@@ -161,6 +161,29 @@ describe('ol.interaction.Select', function() {
describe('filter features using the filter option', function() {
var select;
describe('with unmanaged layers', function() {
it('does not call filter for unmanaged layers', function() {
var spy = sinon.spy();
var select = new ol.interaction.Select({
multi: false,
filter: spy
});
map.addInteraction(select);
var feature = new ol.Feature(
new ol.geom.Polygon([[[0, 0], [0, 40], [40, 40], [40, 0]]]));
var unmanaged = new ol.layer.Vector({
source: new ol.source.Vector({
features: [feature]
})
});
unmanaged.setMap(map);
map.renderSync();
simulateEvent(ol.MapBrowserEvent.EventType.SINGLECLICK, 10, -20);
expect(spy.getCalls().length).to.be(0);
unmanaged.setMap(null);
});
});
describe('with multi set to true', function() {
it('only selects features that pass the filter', function() {

View File

@@ -46,13 +46,23 @@ describe('ol.renderer.canvas.Map', function() {
document.body.removeChild(target);
});
it('always includes unmanaged layers', function() {
it('calls callback with layer for managed layers', function() {
map.addLayer(layer);
map.renderSync();
var cb = sinon.spy();
map.forEachFeatureAtPixel(map.getPixelFromCoordinate([0, 0]), cb);
expect(cb).to.be.called();
expect(cb.firstCall.args[1]).to.be(layer);
});
it('includes unmanaged layers, but calls callback with null', function() {
layer.setMap(map);
map.renderSync();
var cb = sinon.spy();
map.forEachFeatureAtPixel(map.getPixelFromCoordinate([0, 0]), cb, null,
function() { return false; });
expect(cb).to.be.called();
expect(cb.firstCall.args[1]).to.be(null);
});
it('filters managed layers', function() {

View File

@@ -10,7 +10,7 @@ var blue = 'data:image/gif;base64,R0lGODlhAQABAPAAAAAA/////yH5BAAAAAAALAAAAA' +
'ABAAEAAAICRAEAOw==';
function itNoPhantom() {
if (window.initMochaPhantomJS) {
if (window.checkForMocha) {
return xit.apply(this, arguments);
} else {
return it.apply(this, arguments);

View File

@@ -13,6 +13,16 @@ describe('ol.source.TileWMS', function() {
};
});
describe('constructor', function() {
it('can be constructed without url or urls params', function() {
var source = new ol.source.TileWMS({
projection: 'EPSG:3857',
tileGrid: ol.tilegrid.createXYZ({maxZoom: 6})
});
expect(source).to.be.an(ol.source.TileWMS);
});
});
describe('#getTile', function() {
it('returns a tile with the expected URL', function() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -4,16 +4,16 @@ describe('ol.rendering.layer.Image', function() {
var target, map;
function createMap(renderer, center, zoom) {
function createMap(renderer) {
target = createMapDiv(50, 50);
map = new ol.Map({
target: target,
renderer: renderer,
view: new ol.View({
center: center ? center : ol.proj.transform(
center: ol.proj.transform(
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
zoom: zoom ? zoom : 5
zoom: 5
})
});
return map;
@@ -82,35 +82,6 @@ describe('ol.rendering.layer.Image', function() {
});
});
});
describe('single image layer with different x and y resolutions', function() {
var source;
beforeEach(function() {
source = new ol.source.ImageStatic({
url: 'spec/ol/data/dem.jpg',
projection: ol.proj.get('EPSG:3857'),
alwaysInRange: true,
imageSize: [373, 350],
imageExtent: [2077922.782144, 5744637.392734, 2082074.999150,
5750225.419064]
});
});
afterEach(function() {
disposeMap(map);
});
it('tests the canvas renderer', function(done) {
map = createMap('canvas', [2080687.2732495, 5747435.594262], 10);
waitForImages([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/image-canvas-resxy.png',
IMAGE_TOLERANCE, done);
});
});
});
});
goog.require('goog.object');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

View File

@@ -30,7 +30,7 @@ describe('ol.rendering.style.Icon', function() {
disposeMap(map);
});
function createFeatures(callback, offset) {
function createFeatures(callback) {
var feature;
feature = new ol.Feature({
geometry: new ol.geom.Point([0, 0])
@@ -44,7 +44,6 @@ describe('ol.rendering.style.Icon', function() {
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.75,
offset: offset,
scale: 0.5,
img: img,
imgSize: [32, 48]
@@ -64,14 +63,6 @@ describe('ol.rendering.style.Icon', function() {
});
});
it('tests the canvas renderer with an offset', function(done) {
map = createMap('canvas');
createFeatures(function() {
expectResemble(map, 'spec/ol/style/expected/icon-canvas-offset.png',
IMAGE_TOLERANCE, done);
}, [10, 10]);
});
it('tests the WebGL renderer', function(done) {
assertWebGL();
map = createMap('webgl');