Compare commits

..

8 Commits

Author SHA1 Message Date
Tim Schaub
35b19d1974 3.16.0-alpha.2 2016-05-18 21:24:15 -06:00
Tim Schaub
94ae282c57 Less weird name 2016-05-18 21:22:14 -06:00
Tim Schaub
9050ee550f Demonstrate how source.setUrl() works 2016-05-18 21:14:25 -06:00
Tim Schaub
2c1353f6e9 Allow XYZ source construction without options 2016-05-18 21:13:55 -06:00
Tim Schaub
783721951a Less special handling for WMTS tiles 2016-05-18 18:52:42 -06:00
Tim Schaub
c5dcde4455 Less special handling for WMS tiles 2016-05-18 18:47:38 -06:00
Tim Schaub
47cc4aac62 Rename source.getKeyParams() to source.getKey() 2016-05-18 18:34:50 -06:00
Tim Schaub
f86e7e5a71 Add a settable key for all tile sources
The source's key is used as the key for all tiles in the source.  For URL tile sources, the URL is the key.
2016-05-18 18:27:19 -06:00
291 changed files with 2424 additions and 3154 deletions

View File

@@ -1,56 +1,8 @@
## Upgrade notes
### v3.17.0
#### `ol.source.MapQuest` removal
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
#### `ol.interaction.ModifyEvent` changes
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
#### Removal of ol.raster namespace
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
* `ol.raster.Operation` to `ol.RasterOperation`
* `ol.raster.OperationType` to `ol.RasterOperationType`
#### All typedefs now in ol namespace
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
* ol.events.ConditionType to ol.EventsConditionType
* ol.events.EventTargetLike to ol.EventTargetLike
* ol.events.Key to ol.EventsKey
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
* ol.interaction.SnapResultType to ol.SnapResultType
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
* ol.proj.ProjectionLike to ol.ProjectionLike
* ol.style.AtlasBlock to ol.AtlasBlock
* ol.style.AtlasInfo to ol.AtlasInfo
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
* ol.style.ImageOptions to ol.StyleImageOptions
* ol.style.GeometryFunction to ol.StyleGeometryFunction
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
* ol.style.StyleFunction to ol.StyleFunction
### v3.16.0
#### Rendering change for tile sources
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
#### Move of typedefs out of code and into separate file
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
#### Removal of `opaque` option for `ol.source.VectorTile`

View File

@@ -1,148 +0,0 @@
# v3.16.0
## Summary
The v3.16.0 release includes features and fixes from 95 pull requests since the v3.15.1 release. New features and improvements include:
* Add `ol.source.ImageArcGISRest` for ArcGIS REST image layer support (#3880)
* New `finishCondition` option for `ol.interaction.Draw` to control which action should finish a geometry when drawing (#5261)
* New filter API for `ol.format.WFS#writeGetFeature` for WFS queries with OGC filters (#5252)
* New `renderMode` option for `ol.layer.VectorTile` to balance between rendering performance and rendering quality (#5177)
* More flexibility for configuring attribution logos by allowing HTML elements (#5274)
* UTFGrid updates, now supporting Mapbox API v4 (#5329)
* New `condition` option for `ol.interaction.Modify` for better reliability when combining with other interactions (#5320)
In addition to these new features, the code base has been simplified and refactored in the process of removing the dependency on Closure Library and Compiler.
## Upgrade notes
#### Rendering change for tile sources
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
#### Move of typedefs out of code and into separate file
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
#### Removal of `opaque` option for `ol.source.VectorTile`
This option is no longer needed, so it was removed from the API.
#### XHR loading for `ol.source.TileUTFGrid`
The `ol.source.TileUTFGrid` now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new `jsonp` option on the source. See the examples below for detail.
```js
// To work with the v4 API
var v4source = new ol.source.TileUTFGrid({
url: 'https://api.tiles.mapbox.com/v4/example.json?access_token=' + YOUR_KEY_HERE
});
// To work with the v3 API
var v3source = new ol.source.TileUTFGrid({
jsonp: true, // <--- this is required for v3
url: 'http://api.tiles.mapbox.com/v3/example.json'
});
```
## Full list of changes
* [#5377](https://github.com/openlayers/ol3/pull/5377) - Fix link to jspdf.min.js in export-pdf example ([@fredj](https://github.com/fredj))
* [#5372](https://github.com/openlayers/ol3/pull/5372) - Update jquery to version 2.2.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5364](https://github.com/openlayers/ol3/pull/5364) - Make it so things don't flash so much when you change the tile source URL. ([@tschaub](https://github.com/tschaub))
* [#5368](https://github.com/openlayers/ol3/pull/5368) - Move WFS typedefs to typedefs.js ([@probins](https://github.com/probins))
* [#5369](https://github.com/openlayers/ol3/pull/5369) - format/igc: Remove duplicate regex exec() call ([@Turbo87](https://github.com/Turbo87))
* [#5363](https://github.com/openlayers/ol3/pull/5363) - Convert all typedefs to CamelCase ([@probins](https://github.com/probins))
* [#5362](https://github.com/openlayers/ol3/pull/5362) - Update vector-tile to version 1.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5352](https://github.com/openlayers/ol3/pull/5352) - Add getResolutions() to ol.View ([@marlowp](https://github.com/marlowp))
* [#5359](https://github.com/openlayers/ol3/pull/5359) - Move upgrade notes to correct place ([@probins](https://github.com/probins))
* [#5343](https://github.com/openlayers/ol3/pull/5343) - Rename non-api sub-namespace typedefs ([@probins](https://github.com/probins))
* [#5361](https://github.com/openlayers/ol3/pull/5361) - Fix url to maki icons ([@fredj](https://github.com/fredj))
* [#5358](https://github.com/openlayers/ol3/pull/5358) - Handle multiple featureMember elements for different types (WFS format) ([@tsauerwein](https://github.com/tsauerwein))
* [#5355](https://github.com/openlayers/ol3/pull/5355) - Fix navigation-controls example description ([@fredj](https://github.com/fredj))
* [#5353](https://github.com/openlayers/ol3/pull/5353) - Add API definition to docs landing page ([@probins](https://github.com/probins))
* [#5356](https://github.com/openlayers/ol3/pull/5356) - Update rbush to version 1.4.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5354](https://github.com/openlayers/ol3/pull/5354) - Update eslint to version 2.10.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5347](https://github.com/openlayers/ol3/pull/5347) - Update eslint to version 2.10.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5344](https://github.com/openlayers/ol3/pull/5344) - Remove raster enum from test ([@probins](https://github.com/probins))
* [#5329](https://github.com/openlayers/ol3/pull/5329) - UTFGrid updates. ([@tschaub](https://github.com/tschaub))
* [#5335](https://github.com/openlayers/ol3/pull/5335) - Move typedefs to separate file ([@probins](https://github.com/probins))
* [#5332](https://github.com/openlayers/ol3/pull/5332) - Warn when viewing an outdated example, and offer a redirect to latest ([@ahocevar](https://github.com/ahocevar))
* [#5342](https://github.com/openlayers/ol3/pull/5342) - Fix incorrect source links ([@ahocevar](https://github.com/ahocevar))
* [#5339](https://github.com/openlayers/ol3/pull/5339) - Use a div instead of alert for version warning ([@ahocevar](https://github.com/ahocevar))
* [#5320](https://github.com/openlayers/ol3/pull/5320) - Add a 'condition' option to ol.interaction.Modify ([@fredj](https://github.com/fredj))
* [#5333](https://github.com/openlayers/ol3/pull/5333) - Improve code readability with better comments ([@openlayers](https://github.com/openlayers))
* [#5330](https://github.com/openlayers/ol3/pull/5330) - Fix source links, display version and warn about outdated docs ([@ahocevar](https://github.com/ahocevar))
* [#5324](https://github.com/openlayers/ol3/pull/5324) - Remove unneeded goog.provides/requires for typedefs ([@probins](https://github.com/probins))
* [#5328](https://github.com/openlayers/ol3/pull/5328) - Use Node 6 on Travis. ([@tschaub](https://github.com/tschaub))
* [#5313](https://github.com/openlayers/ol3/pull/5313) - Rastersource framestate extent ([@ahocevar](https://github.com/ahocevar))
* [#5326](https://github.com/openlayers/ol3/pull/5326) - Fix wording in tile-load-event example ([@tsauerwein](https://github.com/tsauerwein))
* [#5327](https://github.com/openlayers/ol3/pull/5327) - Update closure-util to version 1.13.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5289](https://github.com/openlayers/ol3/pull/5289) - Update fs-extra to version 0.30.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5319](https://github.com/openlayers/ol3/pull/5319) - Remove outdated fixme from framestate.js. ([@probins](https://github.com/probins))
* [#5274](https://github.com/openlayers/ol3/pull/5274) - Allow using elements in logo attribution options ([@samuellapointe](https://github.com/samuellapointe))
* [#5162](https://github.com/openlayers/ol3/pull/5162) - Improve docs/examples for loadingstrategy ([@probins](https://github.com/probins))
* [#5314](https://github.com/openlayers/ol3/pull/5314) - Update browserify to version 13.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5315](https://github.com/openlayers/ol3/pull/5315) - Remove unused ol.TileCoordTransformType ([@probins](https://github.com/probins))
* [#5310](https://github.com/openlayers/ol3/pull/5310) - Get raster sources working again. ([@tschaub](https://github.com/tschaub))
* [#5291](https://github.com/openlayers/ol3/pull/5291) - Allow once listeners to dispatch events of same type ([@ahocevar](https://github.com/ahocevar))
* [#5309](https://github.com/openlayers/ol3/pull/5309) - Update metalsmith-layouts to version 1.6.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5052](https://github.com/openlayers/ol3/pull/5052) - Update fs-extra to version 0.26.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#5306](https://github.com/openlayers/ol3/pull/5306) - Make olx.view.FitOptions.padding optional ([@gberaudo](https://github.com/gberaudo))
* [#5302](https://github.com/openlayers/ol3/pull/5302) - Remove use of goog.partial ([@fredj](https://github.com/fredj))
* [#5304](https://github.com/openlayers/ol3/pull/5304) - Update sinon to version 1.17.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4644](https://github.com/openlayers/ol3/pull/4644) - Remove check-requires script ([@fredj](https://github.com/fredj))
* [#5298](https://github.com/openlayers/ol3/pull/5298) - Update eslint to version 2.9.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5296](https://github.com/openlayers/ol3/pull/5296) - Document handling of KML MultiGeometries ([@probins](https://github.com/probins))
* [#5293](https://github.com/openlayers/ol3/pull/5293) - Block removePoint while dragging ([@giohappy](https://github.com/giohappy))
* [#5285](https://github.com/openlayers/ol3/pull/5285) - Add more tests for the scaleline control ([@marcjansen](https://github.com/marcjansen))
* [#5287](https://github.com/openlayers/ol3/pull/5287) - Add and fix vectortile tests ([@ahocevar](https://github.com/ahocevar))
* [#5288](https://github.com/openlayers/ol3/pull/5288) - Expose removeVertex_ as removePoint ([@giohappy](https://github.com/giohappy))
* [#5286](https://github.com/openlayers/ol3/pull/5286) - Skip unnecessary render functions ([@ahocevar](https://github.com/ahocevar))
* [#5177](https://github.com/openlayers/ol3/pull/5177) - Add render options for vector tile layers ([@ahocevar](https://github.com/ahocevar))
* [#5278](https://github.com/openlayers/ol3/pull/5278) - Fix invalid generics type instantiation ([@fredj](https://github.com/fredj))
* [#5044](https://github.com/openlayers/ol3/pull/5044) - Snap interaction now handle feature without geometry properly ([@fblackburn](https://github.com/fblackburn))
* [#5277](https://github.com/openlayers/ol3/pull/5277) - Type cleanup ([@fredj](https://github.com/fredj))
* [#5275](https://github.com/openlayers/ol3/pull/5275) - Fix feature-layer association on replaced selections ([@ahocevar](https://github.com/ahocevar))
* [#5252](https://github.com/openlayers/ol3/pull/5252) - Add filter option to ol.format.WFS#writeGetFeature ([@tsauerwein](https://github.com/tsauerwein))
* [#5264](https://github.com/openlayers/ol3/pull/5264) - Fix for close draw polygon error ([@matjos](https://github.com/matjos))
* [#5267](https://github.com/openlayers/ol3/pull/5267) - Use ol.functions instead of goog.functions ([@ahocevar](https://github.com/ahocevar))
* [#5266](https://github.com/openlayers/ol3/pull/5266) - Document ol.colorlike ([@ahocevar](https://github.com/ahocevar))
* [#5261](https://github.com/openlayers/ol3/pull/5261) - add finishCondition to ol.interaction.Draw ([@giohappy](https://github.com/giohappy))
* [#5259](https://github.com/openlayers/ol3/pull/5259) - Include squash commit merges in changelog ([@ahocevar](https://github.com/ahocevar))
* [#5257](https://github.com/openlayers/ol3/pull/5257) - Add readFeatures and readProjection as MVT experimental API ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3880](https://github.com/openlayers/ol3/pull/3880) - Add ol.source.ImageArcGISRest ([Anna Lambrechtsen](https://github.com/search?q=Anna Lambrechtsen&type=Users))
* [#5239](https://github.com/openlayers/ol3/pull/5239) - Update eslint to version 2.8.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5230](https://github.com/openlayers/ol3/pull/5230) - Reuse frame state arrays ([@fredj](https://github.com/fredj))
* [#5213](https://github.com/openlayers/ol3/pull/5213) - Remove unused ol.source.Source#setProjection function ([@fredj](https://github.com/fredj))
* [#5223](https://github.com/openlayers/ol3/pull/5223) - Create tmpSize_ before calling calculateTileRanges_ ([@fredj](https://github.com/fredj))
* [#5225](https://github.com/openlayers/ol3/pull/5225) - Remove unused ol.extent.transform2D function ([@fredj](https://github.com/fredj))
* [#5212](https://github.com/openlayers/ol3/pull/5212) - KML: fix GeometryCollection write ([@probins](https://github.com/probins))
* [#5228](https://github.com/openlayers/ol3/pull/5228) - Add 'layers' option to Translate interaction ([@adube](https://github.com/adube))
* [#5221](https://github.com/openlayers/ol3/pull/5221) - Update jquery, bootstrap and proj4js in examples ([@fredj](https://github.com/fredj))
* [#5227](https://github.com/openlayers/ol3/pull/5227) - Add a temporary ol.TileCoord in ol.renderer.canvas.TileLayer ([@fredj](https://github.com/fredj))
* [#5222](https://github.com/openlayers/ol3/pull/5222) - Remove unused private variables in ol.renderer.canvas.Map ([@fredj](https://github.com/fredj))
* [#5220](https://github.com/openlayers/ol3/pull/5220) - Externs cleanup ([@fredj](https://github.com/fredj))
* [#5224](https://github.com/openlayers/ol3/pull/5224) - Fix jsdoc tags indentation ([@fredj](https://github.com/fredj))
* [#5218](https://github.com/openlayers/ol3/pull/5218) - Add @api annotation to setConfig. ([@aisaacs](https://github.com/aisaacs))
* [#5215](https://github.com/openlayers/ol3/pull/5215) - Add an optional feature filter to getClosestFeatureToCoordinate ([@fredj](https://github.com/fredj))
* [#5132](https://github.com/openlayers/ol3/pull/5132) - Remove goog.string ([@nicholas-l](https://github.com/nicholas-l))
* [#5206](https://github.com/openlayers/ol3/pull/5206) - Minor correction of StyleFunction docs ([@probins](https://github.com/probins))
* [#4932](https://github.com/openlayers/ol3/pull/4932) - Remove undefined parameters to ol.format.WMSGetFeatureInfo#readFeatures_ ([@fredj](https://github.com/fredj))
* [#5207](https://github.com/openlayers/ol3/pull/5207) - Update clean-css to version 3.4.12 🚀 ([@openlayers](https://github.com/openlayers))
* [#5201](https://github.com/openlayers/ol3/pull/5201) - Small clarification for vector source loader docs ([@probins](https://github.com/probins))
* [#5200](https://github.com/openlayers/ol3/pull/5200) - Fix typo in rotate control for css classList ([@bartvde](https://github.com/bartvde))
* [#5178](https://github.com/openlayers/ol3/pull/5178) - Remove goog.global ([Nicholas Latham](https://github.com/search?q=Nicholas Latham&type=Users))
* [#5189](https://github.com/openlayers/ol3/pull/5189) - Add rendering tests to ensure correct circle and polygon rendering ([Andreas Hocevar](https://github.com/search?q=Andreas Hocevar&type=Users))
* [#5183](https://github.com/openlayers/ol3/pull/5183) - Update istanbul to version 0.4.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5187](https://github.com/openlayers/ol3/pull/5187) - Remove goog.functions.and from ol.interaction.Modify ([@fredj](https://github.com/fredj))
* [#5176](https://github.com/openlayers/ol3/pull/5176) - Update jquery to version 2.2.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5173](https://github.com/openlayers/ol3/pull/5173) - Use ol.dom.createCanvasContext2D ([@fredj](https://github.com/fredj))
* [#5171](https://github.com/openlayers/ol3/pull/5171) - Move olx.source.AttributionOption out of externs/olx.js ([@fredj](https://github.com/fredj))
* [#5170](https://github.com/openlayers/ol3/pull/5170) - Update eslint to version 2.7.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5167](https://github.com/openlayers/ol3/pull/5167) - Remove FastClick from mobile-full-screen example ([@fredj](https://github.com/fredj))
* [#5166](https://github.com/openlayers/ol3/pull/5166) - Remove jquery dependency from measure example ([@fredj](https://github.com/fredj))
* [#5164](https://github.com/openlayers/ol3/pull/5164) - Cartodb cleanup ([@fredj](https://github.com/fredj))

View File

@@ -1,107 +0,0 @@
# v3.17.0
## Summary
The v3.17.0 release includes features and fixes from 60 pull requests since the v3.16.0 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library.
## Upgrade notes
#### `ol.source.MapQuest` removal
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
#### `ol.interaction.ModifyEvent` changes
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
#### Removal of ol.raster namespace
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
* `ol.raster.Operation` to `ol.RasterOperation`
* `ol.raster.OperationType` to `ol.RasterOperationType`
#### All typedefs now in ol namespace
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
* ol.events.ConditionType to ol.EventsConditionType
* ol.events.EventTargetLike to ol.EventTargetLike
* ol.events.Key to ol.EventsKey
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
* ol.interaction.SnapResultType to ol.SnapResultType
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
* ol.proj.ProjectionLike to ol.ProjectionLike
* ol.style.AtlasBlock to ol.AtlasBlock
* ol.style.AtlasInfo to ol.AtlasInfo
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
* ol.style.ImageOptions to ol.StyleImageOptions
* ol.style.GeometryFunction to ol.StyleGeometryFunction
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
* ol.style.StyleFunction to ol.StyleFunction
## Full list of changes
* [#5539](https://github.com/openlayers/ol3/pull/5539) - Remove outdated comments re goog.dom ([@probins](https://github.com/probins))
* [#5543](https://github.com/openlayers/ol3/pull/5543) - Update rbush to 2.0.1 ([@tsauerwein](https://github.com/tsauerwein))
* [#5540](https://github.com/openlayers/ol3/pull/5540) - Remove MapQuest source ([@bartvde](https://github.com/bartvde))
* [#5538](https://github.com/openlayers/ol3/pull/5538) - Replace remaining goog.inherits ([@probins](https://github.com/probins))
* [#5536](https://github.com/openlayers/ol3/pull/5536) - Update to layer-extent example ([@tschaub](https://github.com/tschaub))
* [#5482](https://github.com/openlayers/ol3/pull/5482) - Fix for regression in tile layer extent ([@ischneider](https://github.com/ischneider))
* [#5475](https://github.com/openlayers/ol3/pull/5475) - Remove goog.provide from enums only used internally or in olx.js ([@probins](https://github.com/probins))
* [#5424](https://github.com/openlayers/ol3/pull/5424) - Don't dispatch select event if no feature is selected or deselected ([@fredj](https://github.com/fredj))
* [#5522](https://github.com/openlayers/ol3/pull/5522) - Add 'condition' option to ol.interaction.DragPanOptions in olx.js ([@SamuelBerger](https://github.com/SamuelBerger))
* [#5443](https://github.com/openlayers/ol3/pull/5443) - Remove olx.source.WMTSOptions#maxZoom option ([@fredj](https://github.com/fredj))
* [#5497](https://github.com/openlayers/ol3/pull/5497) - Update istanbul to version 0.4.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5523](https://github.com/openlayers/ol3/pull/5523) - Update closure-util to version 1.15.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5508](https://github.com/openlayers/ol3/pull/5508) - Fix problems with ol.format.WFS in compiled mode ([@tsauerwein](https://github.com/tsauerwein))
* [#5512](https://github.com/openlayers/ol3/pull/5512) - Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ ([@ahocevar](https://github.com/ahocevar))
* [#5513](https://github.com/openlayers/ol3/pull/5513) - Add getters for min and max resolution of the view ([@bartvde](https://github.com/bartvde))
* [#5471](https://github.com/openlayers/ol3/pull/5471) - Fix GPX write of xsi ns ([@probins](https://github.com/probins))
* [#5134](https://github.com/openlayers/ol3/pull/5134) - Remove goog.dom ([@nicholas-l](https://github.com/nicholas-l))
* [#5511](https://github.com/openlayers/ol3/pull/5511) - Do not optimize lines away entirely ([@ahocevar](https://github.com/ahocevar))
* [#5509](https://github.com/openlayers/ol3/pull/5509) - Make it easier to work with tile ranges in custom source implementations ([@ahocevar](https://github.com/ahocevar))
* [#5498](https://github.com/openlayers/ol3/pull/5498) - Update eslint to version 2.13.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5495](https://github.com/openlayers/ol3/pull/5495) - Get rid of goog.isFunction ([@fredj](https://github.com/fredj))
* [#5499](https://github.com/openlayers/ol3/pull/5499) - Update glob to version 7.0.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5125](https://github.com/openlayers/ol3/pull/5125) - Remove goog style ([@nicholas-l](https://github.com/nicholas-l))
* [#5494](https://github.com/openlayers/ol3/pull/5494) - Remove goog.global ([@probins](https://github.com/probins))
* [#5492](https://github.com/openlayers/ol3/pull/5492) - Update eslint to version 2.13.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5490](https://github.com/openlayers/ol3/pull/5490) - Update glob to version 7.0.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5460](https://github.com/openlayers/ol3/pull/5460) - Update eslint to version 2.12.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5479](https://github.com/openlayers/ol3/pull/5479) - Update slimerjs to version 0.906.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5474](https://github.com/openlayers/ol3/pull/5474) - Update clean-css to version 3.4.18 🚀 ([@openlayers](https://github.com/openlayers))
* [#5450](https://github.com/openlayers/ol3/pull/5450) - Remove sub-namespaces from all remaining typedefs ([@probins](https://github.com/probins))
* [#5465](https://github.com/openlayers/ol3/pull/5465) - Fix custom icon positions and rotation ([@ahocevar](https://github.com/ahocevar))
* [#5469](https://github.com/openlayers/ol3/pull/5469) - Fix typo ([@gberaudo](https://github.com/gberaudo))
* [#5453](https://github.com/openlayers/ol3/pull/5453) - Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent ([@ahocevar](https://github.com/ahocevar))
* [#5208](https://github.com/openlayers/ol3/pull/5208) - Stop GPX writing rtept properties ([@probins](https://github.com/probins))
* [#5452](https://github.com/openlayers/ol3/pull/5452) - Update eslint-config-openlayers to version 5.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5432](https://github.com/openlayers/ol3/pull/5432) - Remove use of goog.uri ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5449](https://github.com/openlayers/ol3/pull/5449) - Make example data/ paths absolute for source view and JSFiddle ([@ahocevar](https://github.com/ahocevar))
* [#5399](https://github.com/openlayers/ol3/pull/5399) - Remove ol.raster namespace ([@probins](https://github.com/probins))
* [#5270](https://github.com/openlayers/ol3/pull/5270) - Load erroneous image in ol.Image#load and ol.ImageTile#load ([@fredj](https://github.com/fredj))
* [#5194](https://github.com/openlayers/ol3/pull/5194) - Get rid of goog.inherits and goog.base ([@fredj](https://github.com/fredj))
* [#5427](https://github.com/openlayers/ol3/pull/5427) - Document typedefs and enums used by API symbols ([@ahocevar](https://github.com/ahocevar))
* [#5438](https://github.com/openlayers/ol3/pull/5438) - Don't make ol.format.ogc.filter.Filter inherit from ol.Object ([@fredj](https://github.com/fredj))
* [#5433](https://github.com/openlayers/ol3/pull/5433) - Update clean-css to version 3.4.17 🚀 ([@openlayers](https://github.com/openlayers))
* [#5434](https://github.com/openlayers/ol3/pull/5434) - Fix externs in closure compiler tutorial ([@tsauerwein](https://github.com/tsauerwein))
* [#5426](https://github.com/openlayers/ol3/pull/5426) - Fix icon example to anchor popup to feature location ([@frankrowe](https://github.com/frankrowe))
* [#5421](https://github.com/openlayers/ol3/pull/5421) - Correct typo in config/jsdoc/api/readme.md ([@probins](https://github.com/probins))
* [#5417](https://github.com/openlayers/ol3/pull/5417) - Update clean-css to version 3.4.16 🚀 ([@openlayers](https://github.com/openlayers))
* [#5413](https://github.com/openlayers/ol3/pull/5413) - Update clean-css to version 3.4.15 🚀 ([@openlayers](https://github.com/openlayers))
* [#5410](https://github.com/openlayers/ol3/pull/5410) - Update eslint to version 2.11.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5408](https://github.com/openlayers/ol3/pull/5408) - Update pbf to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5404](https://github.com/openlayers/ol3/pull/5404) - Update eslint to version 2.11.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5402](https://github.com/openlayers/ol3/pull/5402) - Pass in srsName option to writeTransaction ([@anzhihun](https://github.com/anzhihun))
* [#5393](https://github.com/openlayers/ol3/pull/5393) - Update mocha to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5394](https://github.com/openlayers/ol3/pull/5394) - Update resemblejs to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5390](https://github.com/openlayers/ol3/pull/5390) - Fix the requestEncoding automatic selection ([@fredj](https://github.com/fredj))
* [#5392](https://github.com/openlayers/ol3/pull/5392) - Update closure-util to version 1.14.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5388](https://github.com/openlayers/ol3/pull/5388) - Update mocha to version 2.5.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5382](https://github.com/openlayers/ol3/pull/5382) - Handle UTC midnight wrap around, fixes #5371 ([@twpayne](https://github.com/twpayne))
* [#5381](https://github.com/openlayers/ol3/pull/5381) - Update mocha to version 2.5.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5383](https://github.com/openlayers/ol3/pull/5383) - Update clean-css to version 3.4.13 🚀 ([@openlayers](https://github.com/openlayers))

View File

@@ -1,9 +0,0 @@
# v3.17.1
## Summary
The v3.17.1 release is a patch release that addresses a regression in the v3.17.0 release. See the [v3.17.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.17.0) for details on upgrading from v3.16.
## Fixes
* [#5548](https://github.com/openlayers/ol3/pull/5548) - Fix CHANGETYPE in ol.control.FullScreen ([@GaborFarkas](https://github.com/GaborFarkas))

View File

@@ -24,12 +24,15 @@
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks",
"missingProvide",

View File

@@ -24,12 +24,15 @@
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],

View File

@@ -11,7 +11,6 @@ exports.defineTags = function(dictionary) {
canHaveType: false,
canHaveName: false,
onTagged: function(doclet, tag) {
includeTypes(doclet);
var level = tag.text || "experimental";
if (levels.indexOf(level) >= 0) {
doclet.stability = level;
@@ -26,15 +25,11 @@ exports.defineTags = function(dictionary) {
/*
* Based on @api annotations, and assuming that items with no @api annotation
* should not be documented, this plugin removes undocumented symbols
* Based on @stability annotations, and assuming that items with no @stability
* annotation should not be documented, this plugin removes undocumented symbols
* from the documentation.
*/
var api = [];
var classes = {};
var types = {};
function hasApiMembers(doclet) {
return doclet.longname.split('#')[0] == this.longname;
}
@@ -76,30 +71,8 @@ function includeAugments(doclet) {
}
}
function extractTypes(item) {
item.type.names.forEach(function(type) {
var match = type.match(/^(.*<)?([^>]*)>?$/);
if (match) {
types[match[2]] = true;
}
});
}
function includeTypes(doclet) {
if (doclet.params && doclet.kind != 'class') {
doclet.params.forEach(extractTypes);
}
if (doclet.returns) {
doclet.returns.forEach(extractTypes);
}
if (doclet.isEnum) {
types[doclet.meta.code.name] = true;
}
if (doclet.type && doclet.meta.code.type == 'MemberExpression') {
// types in olx.js
extractTypes(doclet);
}
}
var api = [];
var classes = {};
exports.handlers = {
@@ -107,9 +80,6 @@ exports.handlers = {
var doclet = e.doclet;
// Keep track of api items - needed in parseComplete to determine classes
// with api members.
if (doclet.meta.filename == 'olx.js' && doclet.kind == 'typedef') {
doclet.undocumented = false;
}
if (doclet.stability) {
api.push(doclet);
}
@@ -150,7 +120,7 @@ exports.handlers = {
// constructor from the docs.
doclet._hideConstructor = true;
includeAugments(doclet);
} else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
} else if (!doclet._hideConstructor) {
// Remove all other undocumented symbols
doclet.undocumented = true;
}

View File

@@ -89,6 +89,10 @@ exports.handlers = {
newDoclet: function(e) {
var doclet = e.doclet;
if (doclet.meta.filename == 'olx.js') {
// do nothing if not marked @api
if (!doclet.stability) {
return;
}
if (doclet.kind == 'typedef') {
lastOlxTypedef = doclet;
olxTypeNames.push(doclet.longname);

View File

@@ -24,7 +24,7 @@ The second line tells the Closure compiler the type of the argument.
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
The `@api` annotation can be used in conjunction with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
The `@api` annotation can be used in conjunciton with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
### Events

View File

@@ -39,7 +39,7 @@ var self = this;
<?js
item.typedefs.forEach(function (v) {
?>
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
<?js= self.linkto(v.longname, v.name) ?>
</li>
<?js
@@ -56,7 +56,7 @@ var self = this;
item.methods.forEach(function (v) {
?>
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
<?js= self.linkto(v.longname, v.name) ?>
</li>
<?js
@@ -73,7 +73,7 @@ var self = this;
item.fires.forEach(function (v) {
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
?>
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability != 'stable') ? 'unstable' : '' ?>">
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability != 'stable' ? 'unstable' : '') ?>">
<?js= self.linkto(v.longname, v.name) ?>
</li>
<?js

View File

@@ -21,7 +21,7 @@
var setter = prop.readonly ? 'no' : 'yes';
?>
<tr class="<?js= (prop.stability && prop.stability !== 'stable') ? 'unstable' : '' ?>">
<tr class="<?js= prop.stability !== 'stable' ? 'unstable' : '' ?>">
<td class="name"><code><?js= prop.name ?></code></td>
<td class="type">
<?js if (prop.type && prop.type.names) {?>

View File

@@ -2,6 +2,6 @@
var data = obj;
var self = this;
if (data.stability && data.stability != 'stable') { ?>
if (data.stability != 'stable') { ?>
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
<?js } ?>

View File

@@ -1,5 +1,5 @@
<section>
<header>
<?js if (children.length > 0) { ?>
<ul><?js
@@ -10,10 +10,10 @@
<?js } ?>
<h2><?js= header ?></h2>
</header>
</header>
<article>
<?js= content ?>
</article>
</section>
</section>

View File

@@ -15,12 +15,15 @@
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],

View File

@@ -31,7 +31,7 @@ Below you'll find a complete working example. Create a new file, copy in the co
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
})
],
view: new ol.View({
@@ -85,7 +85,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
})
],
view: new ol.View({
@@ -95,7 +95,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
});
```
With this JavaScript code, a map object is created with an OSM layer zoomed on the African East coast. Let's break this down:
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
@@ -114,7 +114,7 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
```js
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
})
]
```

View File

@@ -160,9 +160,7 @@ The minimum config file looks like this:
"closure_entry_point": "app",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/cartodb.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/esrijson.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
@@ -212,15 +210,14 @@ Here is a version of `config.json` with more compilation checks enabled:
"closure_entry_point": "app",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/cartodb.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/esrijson.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
"node_modules/openlayers/externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
@@ -233,7 +230,8 @@ Here is a version of `config.json` with more compilation checks enabled:
"*"
],
"jscomp_off": [
"unknownDefines",
"unknownDefines"
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],

View File

@@ -2,7 +2,7 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Image');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.ImageArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
@@ -10,11 +10,10 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Image({
source: new ol.source.ImageArcGISRest({
ratio: 1,
params: {},
url: url
})

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
@@ -9,7 +9,7 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -5,7 +5,7 @@ goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Cluster');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -62,7 +62,7 @@ var clusters = new ol.layer.Vector({
});
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var map = new ol.Map({

View File

@@ -22,8 +22,8 @@ var twoPi = 2 * Math.PI;
/**
* Convert an RGB pixel into an HCL pixel.
* @param {Array.<number>} pixel A pixel in RGB space.
* @return {Array.<number>} A pixel in HCL space.
* @param {ol.raster.Pixel} pixel A pixel in RGB space.
* @return {ol.raster.Pixel} A pixel in HCL space.
*/
function rgb2hcl(pixel) {
var red = rgb2xyz(pixel[0]);
@@ -57,8 +57,8 @@ function rgb2hcl(pixel) {
/**
* Convert an HCL pixel into an RGB pixel.
* @param {Array.<number>} pixel A pixel in HCL space.
* @return {Array.<number>} A pixel in RGB space.
* @param {ol.raster.Pixel} pixel A pixel in HCL space.
* @return {ol.raster.Pixel} A pixel in RGB space.
*/
function hcl2rgb(pixel) {
var h = pixel[0];

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.DragRotateAndZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
var map = new ol.Map({
@@ -12,7 +12,7 @@ var map = new ol.Map({
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: common.getRendererFromQueryString(),

View File

@@ -6,7 +6,7 @@ goog.require('ol.interaction.Draw');
goog.require('ol.interaction.Modify');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -14,7 +14,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var map = new ol.Map({

View File

@@ -4,7 +4,7 @@ goog.require('ol.geom.Polygon');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -12,7 +12,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var source = new ol.source.Vector({wrapX: false});

View File

@@ -4,7 +4,7 @@ goog.require('ol.View');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
@@ -14,7 +14,7 @@ goog.require('ol.style.Style');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: common.getRendererFromQueryString(),

View File

@@ -13,12 +13,6 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
var scale;
var scaleFunction = function(coordinate) {
return [coordinate[0] * scale, coordinate[1] * scale];
};
var styleCache = {};
var styleFunction = function(feature) {
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
@@ -27,23 +21,23 @@ var styleFunction = function(feature) {
var name = feature.get('name');
var magnitude = parseFloat(name.substr(2));
var size = parseInt(10 + 40 * (magnitude - 5), 10);
scale = size / 10;
var style = styleCache[size];
if (!style) {
var canvas =
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
var vectorContext = ol.render.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size, size], pixelRatio: 1});
{size: [size + 2, size + 2], pixelRatio: size / 10});
vectorContext.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1})
}));
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)]));
vectorContext.drawGeometry(new ol.geom.Polygon(
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
style = new ol.style.Style({
image: new ol.style.Icon({
img: canvas,
imgSize: [size, size],
imgSize: [canvas.width, canvas.height],
rotation: 1.2
})
});

View File

@@ -6,7 +6,7 @@ docs: >
Example of exporting a map as a PDF using the <a href="https://github.com/MrRio/jsPDF" target="_blank">jsPDF</a> library.
tags: "export, pdf, openstreetmap"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.min.js
- http://mrrio.github.io/jsPDF/dist/jspdf.min.js
---
<div class="row-fluid">
<div class="span12">

View File

@@ -59,8 +59,7 @@ var element = document.getElementById('popup');
var popup = new ol.Overlay({
element: element,
positioning: 'bottom-center',
stopEvent: false,
offset: [0, -50]
stopEvent: false
});
map.addOverlay(popup);
@@ -71,8 +70,7 @@ map.on('click', function(evt) {
return feature;
});
if (feature) {
var coordinates = feature.getGeometry().getCoordinates();
popup.setPosition(coordinates);
popup.setPosition(evt.coordinate);
$(element).popover({
'placement': 'top',
'html': true,

View File

@@ -155,7 +155,7 @@ map.on('click', function(evt) {
var stroke = new ol.style.Stroke({
color: 'rgba(255,0,0,0.9)',
width: 1
});
})
var style = new ol.style.Style({
stroke: stroke,
image: new ol.style.Circle({

View File

@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.ImageVector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
@@ -15,7 +15,7 @@ goog.require('ol.style.Style');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Image({
source: new ol.source.ImageVector({

View File

@@ -7,7 +7,7 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
@@ -39,7 +39,9 @@ var vectorLayer = new ol.layer.Vector({
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({
layer: 'osm'
})
});
var map = new ol.Map({

View File

@@ -4,12 +4,13 @@ title: Limited Layer Extent
shortdesc: Restricting layer rendering to a limited extent.
docs: >
This example uses the <code>layer.setExtent()</code> method to
modify the extent of the overlay layer. Use the controls above
to limit rendering based on an extent (approximate country bounds).
modify the extent of the overlay layer. Use the controls below
to limit rendering based on an extent.
tags: "extent, tilejson"
---
<div id="map" class="map"></div>
<button type="button" class="btn btn-default" id="India">India</button>
<button type="button" class="btn btn-default" id="Argentina">Argentina</button>
<button type="button" class="btn btn-default" id="Nigeria">Nigeria</button>
<button type="button" class="btn btn-default" id="Sweden">Sweden</button>
<button type="button" class="btn btn-default" id="northwest">northwest</button>
<button type="button" class="btn btn-default" id="northeast">northeast</button>
<button type="button" class="btn btn-default" id="southeast">southeast</button>
<button type="button" class="btn btn-default" id="southwest">southwest</button>
<button type="button" class="btn btn-default" id="world">world</button>

View File

@@ -9,25 +9,26 @@ function transform(extent) {
}
var extents = {
India: transform([68.17665, 7.96553, 97.40256, 35.49401]),
Argentina: transform([-73.41544, -55.25, -53.62835, -21.83231]),
Nigeria: transform([2.6917, 4.24059, 14.57718, 13.86592]),
Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625])
northwest: transform([-180, 0, 0, 85]),
northeast: transform([0, 0, 180, 85]),
southeast: transform([0, -85, 180, 0]),
southwest: transform([-180, -85, 0, 0]),
world: transform([-180, -85, 180, 85])
};
var base = new ol.layer.Tile({
source: new ol.source.TileJSON({
url: 'http://api.tiles.mapbox.com/v3/' +
'mapbox.world-light.json',
'mapbox.world-black.json',
crossOrigin: 'anonymous'
})
});
var overlay = new ol.layer.Tile({
extent: extents.India,
extent: extents.northwest,
source: new ol.source.TileJSON({
url: 'http://api.tiles.mapbox.com/v3/' +
'mapbox.world-black.json',
'mapbox.world-glass.json',
crossOrigin: 'anonymous'
})
});

View File

@@ -12,7 +12,7 @@ resources:
<div id="layertree">
<h5>Click on layer nodes below to change their properties.</h5>
<ul>
<li><span>OSM layer</span>
<li><span>OpenAerial layer</span>
<fieldset id="layer0">
<label class="checkbox" for="visible0">
<input id="visible0" class="visible" type="checkbox"/>visibility

View File

@@ -3,13 +3,13 @@ goog.require('ol.View');
goog.require('ol.layer.Group');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileJSON');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}), new ol.layer.Group({
layers: [
new ol.layer.Tile({

View File

@@ -1,9 +1,9 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
var source = new ol.source.OSM();
var source = new ol.source.MapQuest({layer: 'sat'});
var layer = new ol.layer.Tile();

View File

@@ -4,14 +4,14 @@ goog.require('ol.geom.Point');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
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.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var source = new ol.source.Vector();

14
examples/mapquest.html Normal file
View File

@@ -0,0 +1,14 @@
---
layout: example.html
title: MapQuest
shortdesc: Example of a MapQuest map.Shows how to create custom controls.
docs: >
Example of a MapQuest map.
tags: "mapquest"
---
<div id="map" class="map"></div>
<select id="layer-select">
<option value="Aerial">Aerial</option>
<option value="AerialWithLabels">Aerial with labels</option>
<option value="Road" selected>Road</option>
</select>

56
examples/mapquest.js Normal file
View File

@@ -0,0 +1,56 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Group');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
var layers = [
new ol.layer.Tile({
style: 'Road',
source: new ol.source.MapQuest({layer: 'osm'})
}),
new ol.layer.Tile({
style: 'Aerial',
visible: false,
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Group({
style: 'AerialWithLabels',
visible: false,
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'hyb'})
})
]
})
];
var map = new ol.Map({
layers: layers,
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: ol.proj.transform(
[-73.979378, 40.702222], 'EPSG:4326', 'EPSG:3857'),
zoom: 9
})
});
var select = document.getElementById('layer-select');
function onChange() {
var style = select.value;
var i, ii;
for (i = 0, ii = layers.length; i < ii; ++i) {
layers[i].set('visible', (layers[i].get('style') == style));
}
}
select.addEventListener('change', onChange);
onChange();

View File

@@ -9,7 +9,7 @@ goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -20,7 +20,7 @@ goog.require('ol.style.Style');
var wgs84Sphere = new ol.Sphere(6378137);
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var source = new ol.source.Vector();

View File

@@ -6,12 +6,14 @@ goog.require('ol.interaction.Modify');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({
layer: 'sat'
})
});
var vector = new ol.layer.Vector({

View File

@@ -4,7 +4,7 @@ title: Overlay
shortdesc: Demonstrates overlays.
docs: >
<p>The popups are created using <a href="http://getbootstrap.com/javascript/#popovers">Popovers</a> from Bootstrap.</p>
tags: "overlay, popup, bootstrap, popover"
tags: "overlay, popup, bootstrap, popover, mapquest, openaerial"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css

View File

@@ -4,11 +4,11 @@ goog.require('ol.View');
goog.require('ol.coordinate');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
var layer = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var map = new ol.Map({

View File

@@ -6,7 +6,7 @@ docs: >
<p>
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol.Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
</p>
tags: "overlay, popup"
tags: "overlay, popup, mapquest, openaerial"
---
<div id="map" class="map"></div>
<div id="popup" class="ol-popup">

View File

@@ -15,7 +15,7 @@ var bins = 10;
/**
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
* is a rough estimate assuming that pixel values correspond to reflectance.
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
* @param {ol.raster.Pixel} pixel An array of [R, G, B, A] values.
* @return {number} The VGI value for the given pixel.
*/
function vgi(pixel) {

View File

@@ -21,7 +21,7 @@ var style = new ol.style.Style({
fill: fill,
stroke: stroke
})
});
})
vectorContext.setStyle(style);
vectorContext.drawGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));

View File

@@ -1,12 +1,12 @@
---
layout: example.html
title: Reprojection with EPSG.io Search
shortdesc: Demonstrates client-side raster reprojection of OSM to arbitrary projection
shortdesc: Demonstrates client-side raster reprojection of MapQuest OSM to arbitrary projection
docs: >
This example shows client-side raster reprojection capabilities from
OSM (EPSG:3857) to arbitrary projection by searching
MapQuest OSM (EPSG:3857) to arbitrary projection by searching
in <a href="http://epsg.io/">EPSG.io</a> database.
tags: "reprojection, projection, proj4js, epsg.io"
tags: "reprojection, projection, proj4js, mapquest, epsg.io"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
---

View File

@@ -3,14 +3,14 @@ goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileImage');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'osm'})
})
],
renderer: common.getRendererFromQueryString(),

View File

@@ -4,7 +4,7 @@ title: Image Reprojection
shortdesc: Demonstrates client-side reprojection of single image source.
docs: >
This example shows client-side reprojection of single image source.
tags: "reprojection, projection, proj4js, image, imagestatic"
tags: "reprojection, projection, proj4js, mapquest, image, imagestatic"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
---

View File

@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.ImageStatic');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
@@ -17,7 +17,7 @@ var imageExtent = [0, 0, 700000, 1300000];
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'osm'})
}),
new ol.layer.Image({
source: new ol.source.ImageStatic({

View File

@@ -4,7 +4,7 @@ title: Raster Reprojection
shortdesc: Demonstrates client-side raster reprojection between various projections.
docs: >
This example shows client-side raster reprojection between various projections.
tags: "reprojection, projection, proj4js, osm, wms, wmts, hidpi"
tags: "reprojection, projection, proj4js, mapquest, wms, wmts, hidpi"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
---
@@ -13,7 +13,7 @@ resources:
<div class="col-md-3">
<label>Base map:</label>
<select id="base-layer">
<option value="osm">OSM (EPSG:3857)</option>
<option value="mapquest">MapQuest (EPSG:3857)</option>
<option value="wms4326">WMS (EPSG:4326)</option>
</select>
</div>

View File

@@ -5,7 +5,7 @@ goog.require('ol.extent');
goog.require('ol.format.WMTSCapabilities');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileImage');
goog.require('ol.source.TileWMS');
goog.require('ol.source.WMTS');
@@ -64,8 +64,8 @@ layers['bng'] = new ol.layer.Tile({
})
});
layers['osm'] = new ol.layer.Tile({
source: new ol.source.OSM()
layers['mapquest'] = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
});
layers['wms4326'] = new ol.layer.Tile({
@@ -146,7 +146,7 @@ layers['states'] = new ol.layer.Tile({
var map = new ol.Map({
layers: [
layers['osm'],
layers['mapquest'],
layers['bng']
],
renderer: common.getRendererFromQueryString(),

View File

@@ -5,11 +5,11 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var vector = new ol.layer.Vector({

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Semi-Transparent Layer
shortdesc: Example of a map with a semi-transparent layer.
docs: >
This example will display a tiled MaxBox layer semi-transparently over an OSM background.
tags: "transparent, osm, tilejson"
This example will display a tiled MaxBox layer semi-transparently over a MapQuest background.
tags: "transparent, mapquest, tilejson"
---
<div id="map" class="map"></div>

View File

@@ -2,14 +2,14 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileJSON');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
source: new ol.source.TileJSON({

View File

@@ -2,13 +2,13 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.has');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
var map1 = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: 'dom',

View File

@@ -7,7 +7,7 @@ goog.require('ol.interaction.Select');
goog.require('ol.interaction.Snap');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -15,7 +15,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var vector = new ol.layer.Vector({

View File

@@ -7,12 +7,12 @@ goog.require('ol.interaction.Select');
goog.require('ol.interaction.Translate');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
});
var vector = new ol.layer.Vector({

View File

@@ -7,7 +7,7 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
@@ -44,7 +44,9 @@ var vectorLayer = new ol.layer.Vector({
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({
layer: 'osm'
})
});
var map = new ol.Map({

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -172,7 +172,7 @@ var vectorPoints = new ol.layer.Vector({
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'osm'})
}),
vectorPolygons,
vectorLines,

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
@@ -45,7 +45,7 @@ var vectorLayer = new ol.layer.Vector({
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
vectorLayer
],

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileWMS');
goog.require('ol.tilegrid.TileGrid');
@@ -22,7 +22,7 @@ var tileGrid = new ol.tilegrid.TileGrid({
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
source: new ol.source.TileWMS({

View File

@@ -3,12 +3,12 @@ goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.source.ImageWMS');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Image({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileWMS');
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
source: new ol.source.TileWMS({

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileWMS');
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileWMS');
var startDate = new Date(Date.parse('2012-01-01T19:00:00Z'));
@@ -10,7 +10,7 @@ var animationId = null;
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -30,6 +30,7 @@ fetch(capabilitiesUrl).then(function(response) {
var options = ol.source.WMTS.optionsFromCapabilities(result, {
layer: layer,
matrixSet: 'google3857',
requestEncoding: 'REST',
style: 'normal'
});
options.tilePixelRatio = tilePixelRatio;

View File

@@ -2,7 +2,7 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control.ZoomSlider');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
goog.require('ol.source.MapQuest');
/**
@@ -14,7 +14,7 @@ goog.require('ol.source.OSM');
var createMap = function(divId) {
var source, layer, map, zoomslider;
source = new ol.source.OSM();
source = new ol.source.MapQuest({layer: 'sat'});
layer = new ol.layer.Tile({
source: source
});

View File

@@ -92,9 +92,9 @@ oli.ModifyEvent.prototype.features;
/**
* @type {ol.MapBrowserEvent}
* @type {ol.MapBrowserPointerEvent}
*/
oli.ModifyEvent.prototype.mapBrowserEvent;
oli.ModifyEvent.prototype.mapBrowserPointerEvent;
/**

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "3.17.1",
"version": "3.16.0-alpha.2",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -32,41 +32,41 @@
"dependencies": {
"async": "1.5.2",
"browserify": "13.0.1",
"closure-util": "1.15.0",
"closure-util": "1.13.1",
"derequire": "2.0.3",
"fs-extra": "0.30.0",
"glob": "7.0.5",
"glob": "6.0.4",
"handlebars": "4.0.5",
"jsdoc": "3.4.0",
"marked": "0.3.5",
"metalsmith": "2.1.0",
"metalsmith-layouts": "1.6.5",
"nomnom": "1.8.1",
"pbf": "2.0.1",
"pbf": "1.3.5",
"pixelworks": "1.1.0",
"rbush": "2.0.1",
"rbush": "1.4.3",
"temp": "0.8.3",
"vector-tile": "1.2.1",
"vector-tile": "1.2.0",
"walk": "2.3.9"
},
"devDependencies": {
"clean-css": "3.4.18",
"clean-css": "3.4.12",
"coveralls": "2.11.9",
"debounce": "^1.0.0",
"eslint": "2.13.1",
"eslint-config-openlayers": "5.0.0",
"eslint": "2.10.2",
"eslint-config-openlayers": "4.1.0",
"expect.js": "0.3.1",
"gaze": "^1.0.0",
"istanbul": "0.4.4",
"jquery": "2.2.4",
"mocha": "2.5.3",
"istanbul": "0.4.3",
"jquery": "2.2.3",
"mocha": "2.4.5",
"mocha-phantomjs-core": "^1.3.0",
"mustache": "2.2.1",
"phantomjs-prebuilt": "2.1.7",
"proj4": "2.3.14",
"resemblejs": "2.2.1",
"resemblejs": "2.2.0",
"sinon": "1.17.4",
"slimerjs": "0.906.2"
"slimerjs": "0.906.1"
},
"eslintConfig": {
"extends": "openlayers",
@@ -86,10 +86,7 @@
}
},
"ext": [
{
"module": "rbush",
"browserify": true
},
"rbush",
{
"module": "pbf",
"browserify": true

View File

@@ -36,7 +36,7 @@ ol.array.binarySearch = function(haystack, needle, opt_comparator) {
/* Key not found. */
return found ? low : ~low;
};
}
/**
* @param {Array.<number>} arr Array.
@@ -188,11 +188,11 @@ ol.array.flatten = function(arr) {
ol.array.extend = function(arr, data) {
var i;
var extension = goog.isArrayLike(data) ? data : [data];
var length = extension.length;
var length = extension.length
for (i = 0; i < length; i++) {
arr[arr.length] = extension[i];
}
};
}
/**
@@ -208,7 +208,7 @@ ol.array.remove = function(arr, obj) {
arr.splice(i, 1);
}
return found;
};
}
/**
@@ -228,7 +228,7 @@ ol.array.find = function(arr, func) {
}
}
return null;
};
}
/**
@@ -247,7 +247,7 @@ ol.array.equals = function(arr1, arr2) {
}
}
return true;
};
}
/**
@@ -267,7 +267,7 @@ ol.array.stableSort = function(arr, compareFnc) {
for (i = 0; i < arr.length; i++) {
arr[i] = tmp[i].value;
}
};
}
/**
@@ -282,7 +282,7 @@ ol.array.findIndex = function(arr, func) {
return !func(el, idx, arr);
});
return found ? index : -1;
};
}
/**
@@ -300,4 +300,4 @@ ol.array.isSorted = function(arr, opt_func, opt_strict) {
var res = compare(arr[index - 1], currentVal);
return !(res > 0 || opt_strict && res === 0);
});
};
}

View File

@@ -44,7 +44,7 @@ ol.CollectionEventType = {
*/
ol.CollectionEvent = function(type, opt_element, opt_target) {
ol.events.Event.call(this, type, opt_target);
goog.base(this, type, opt_target);
/**
* The element that is added to or removed from the collection.
@@ -54,7 +54,7 @@ ol.CollectionEvent = function(type, opt_element, opt_target) {
this.element = opt_element;
};
ol.inherits(ol.CollectionEvent, ol.events.Event);
goog.inherits(ol.CollectionEvent, ol.events.Event);
/**
@@ -82,7 +82,7 @@ ol.CollectionProperty = {
*/
ol.Collection = function(opt_array) {
ol.Object.call(this);
goog.base(this);
/**
* @private
@@ -93,7 +93,7 @@ ol.Collection = function(opt_array) {
this.updateLength_();
};
ol.inherits(ol.Collection, ol.Object);
goog.inherits(ol.Collection, ol.Object);
/**

View File

@@ -3,8 +3,9 @@
goog.provide('ol.control.Attribution');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.style');
goog.require('ol');
goog.require('ol.dom');
goog.require('ol.Attribution');
goog.require('ol.control.Control');
goog.require('ol.css');
@@ -43,7 +44,7 @@ ol.control.Attribution = function(opt_options) {
this.logoLi_ = document.createElement('LI');
this.ulElement_.appendChild(this.logoLi_);
this.logoLi_.style.display = 'none';
goog.style.setElementShown(this.logoLi_, false);
/**
* @private
@@ -68,37 +69,30 @@ ol.control.Attribution = function(opt_options) {
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00BB';
if (typeof collapseLabel === 'string') {
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = document.createElement('span');
this.collapseLabel_.textContent = collapseLabel;
} else {
this.collapseLabel_ = collapseLabel;
}
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = typeof collapseLabel === 'string' ?
goog.dom.createDom('SPAN', {}, collapseLabel) :
collapseLabel;
var label = options.label !== undefined ? options.label : 'i';
if (typeof label === 'string') {
/**
* @private
* @type {Node}
*/
this.label_ = document.createElement('span');
this.label_.textContent = label;
} else {
this.label_ = label;
}
/**
* @private
* @type {Node}
*/
this.label_ = typeof label === 'string' ?
goog.dom.createDom('SPAN', {}, label) :
label;
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(activeLabel);
var button = goog.dom.createDom('BUTTON', {
'type': 'button',
'title': tipLabel
}, activeLabel);
ol.events.listen(button, ol.events.EventType.CLICK, this.handleClick_, this);
@@ -106,14 +100,12 @@ ol.control.Attribution = function(opt_options) {
ol.css.CLASS_CONTROL +
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
(this.collapsible_ ? '' : ' ol-uncollapsible');
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(this.ulElement_);
element.appendChild(button);
var element = goog.dom.createDom('DIV',
cssClasses, this.ulElement_, button);
var render = options.render ? options.render : ol.control.Attribution.render;
ol.control.Control.call(this, {
goog.base(this, {
element: element,
render: render,
target: options.target
@@ -144,7 +136,7 @@ ol.control.Attribution = function(opt_options) {
this.logoElements_ = {};
};
ol.inherits(ol.control.Attribution, ol.control.Control);
goog.inherits(ol.control.Attribution, ol.control.Control);
/**
@@ -222,7 +214,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
if (!frameState) {
if (this.renderedVisible_) {
this.element.style.display = 'none';
goog.style.setElementShown(this.element, false);
this.renderedVisible_ = false;
}
return;
@@ -238,18 +230,20 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
for (attributionKey in this.attributionElements_) {
if (attributionKey in visibleAttributions) {
if (!this.attributionElementRenderedVisible_[attributionKey]) {
this.attributionElements_[attributionKey].style.display = '';
goog.style.setElementShown(
this.attributionElements_[attributionKey], true);
this.attributionElementRenderedVisible_[attributionKey] = true;
}
delete visibleAttributions[attributionKey];
} else if (attributionKey in hiddenAttributions) {
if (this.attributionElementRenderedVisible_[attributionKey]) {
this.attributionElements_[attributionKey].style.display = 'none';
goog.style.setElementShown(
this.attributionElements_[attributionKey], false);
delete this.attributionElementRenderedVisible_[attributionKey];
}
delete hiddenAttributions[attributionKey];
} else {
ol.dom.removeNode(this.attributionElements_[attributionKey]);
goog.dom.removeNode(this.attributionElements_[attributionKey]);
delete this.attributionElements_[attributionKey];
delete this.attributionElementRenderedVisible_[attributionKey];
}
@@ -266,7 +260,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
attributionElement = document.createElement('LI');
attributionElement.innerHTML =
hiddenAttributions[attributionKey].getHTML();
attributionElement.style.display = 'none';
goog.style.setElementShown(attributionElement, false);
this.ulElement_.appendChild(attributionElement);
this.attributionElements_[attributionKey] = attributionElement;
}
@@ -275,7 +269,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
!ol.object.isEmpty(this.attributionElementRenderedVisible_) ||
!ol.object.isEmpty(frameState.logos);
if (this.renderedVisible_ != renderVisible) {
this.element.style.display = renderVisible ? '' : 'none';
goog.style.setElementShown(this.element, renderVisible);
this.renderedVisible_ = renderVisible;
}
if (renderVisible &&
@@ -302,7 +296,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
for (logo in logoElements) {
if (!(logo in logos)) {
ol.dom.removeNode(logoElements[logo]);
goog.dom.removeNode(logoElements[logo]);
delete logoElements[logo];
}
}
@@ -320,8 +314,9 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
if (logoValue === '') {
logoElement = image;
} else {
logoElement = document.createElement('a');
logoElement.href = logoValue;
logoElement = goog.dom.createDom('A', {
'href': logoValue
});
logoElement.appendChild(image);
}
this.logoLi_.appendChild(logoElement);
@@ -329,7 +324,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
}
}
this.logoLi_.style.display = !ol.object.isEmpty(logos) ? '' : 'none';
goog.style.setElementShown(this.logoLi_, !ol.object.isEmpty(logos));
};
@@ -350,9 +345,9 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
ol.control.Attribution.prototype.handleToggle_ = function() {
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
ol.dom.replaceNode(this.collapseLabel_, this.label_);
goog.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
ol.dom.replaceNode(this.label_, this.collapseLabel_);
goog.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_;
};

View File

@@ -1,10 +1,10 @@
goog.provide('ol.control.Control');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol');
goog.require('ol.MapEventType');
goog.require('ol.Object');
goog.require('ol.dom');
/**
@@ -38,7 +38,7 @@ goog.require('ol.dom');
*/
ol.control.Control = function(options) {
ol.Object.call(this);
goog.base(this);
/**
* @protected
@@ -60,7 +60,7 @@ ol.control.Control = function(options) {
/**
* @protected
* @type {!Array.<ol.EventsKey>}
* @type {!Array.<ol.events.Key>}
*/
this.listenerKeys = [];
@@ -74,15 +74,15 @@ ol.control.Control = function(options) {
}
};
ol.inherits(ol.control.Control, ol.Object);
goog.inherits(ol.control.Control, ol.Object);
/**
* @inheritDoc
*/
ol.control.Control.prototype.disposeInternal = function() {
ol.dom.removeNode(this.element);
ol.Object.prototype.disposeInternal.call(this);
goog.dom.removeNode(this.element);
goog.base(this, 'disposeInternal');
};
@@ -105,7 +105,7 @@ ol.control.Control.prototype.getMap = function() {
*/
ol.control.Control.prototype.setMap = function(map) {
if (this.map_) {
ol.dom.removeNode(this.element);
goog.dom.removeNode(this.element);
}
for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
ol.events.unlistenByKey(this.listenerKeys[i]);
@@ -135,7 +135,5 @@ ol.control.Control.prototype.setMap = function(map) {
* @api
*/
ol.control.Control.prototype.setTarget = function(target) {
this.target_ = typeof target === 'string' ?
document.getElementById(target) :
target;
this.target_ = goog.dom.getElement(target);
};

View File

@@ -1,11 +1,13 @@
goog.provide('ol.control.FullScreen');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.fullscreen');
goog.require('goog.dom.fullscreen.EventType');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
goog.require('ol.control.Control');
goog.require('ol.dom');
goog.require('ol.css');
@@ -56,23 +58,21 @@ ol.control.FullScreen = function(opt_options) {
document.createTextNode(labelActive) : labelActive;
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
var button = document.createElement('button');
button.className = this.cssClassName_ + '-' + ol.control.FullScreen.isFullScreen();
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(this.labelNode_);
var button = goog.dom.createDom('BUTTON', {
'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(),
'type': 'button',
'title': tipLabel
}, this.labelNode_);
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
' ' + ol.css.CLASS_CONTROL + ' ' +
(!ol.control.FullScreen.isFullScreenSupported() ? ol.css.CLASS_UNSUPPORTED : '');
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(button);
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
var element = goog.dom.createDom('DIV', cssClasses, button);
ol.control.Control.call(this, {
goog.base(this, {
element: element,
target: options.target
});
@@ -90,7 +90,7 @@ ol.control.FullScreen = function(opt_options) {
this.source_ = options.source;
};
ol.inherits(ol.control.FullScreen, ol.control.Control);
goog.inherits(ol.control.FullScreen, ol.control.Control);
/**
@@ -107,30 +107,23 @@ ol.control.FullScreen.prototype.handleClick_ = function(event) {
* @private
*/
ol.control.FullScreen.prototype.handleFullScreen_ = function() {
if (!ol.control.FullScreen.isFullScreenSupported()) {
if (!goog.dom.fullscreen.isSupported()) {
return;
}
var map = this.getMap();
if (!map) {
return;
}
if (ol.control.FullScreen.isFullScreen()) {
ol.control.FullScreen.exitFullScreen();
if (goog.dom.fullscreen.isFullScreen()) {
goog.dom.fullscreen.exitFullScreen();
} else {
var element;
if (this.source_) {
element = typeof this.source_ === 'string' ?
document.getElementById(this.source_) :
this.source_;
} else {
element = map.getTargetElement();
}
var element = this.source_ ?
goog.dom.getElement(this.source_) : map.getTargetElement();
goog.asserts.assert(element, 'element should be defined');
if (this.keys_) {
ol.control.FullScreen.requestFullScreenWithKeys(element);
goog.dom.fullscreen.requestFullScreenWithKeys(element);
} else {
ol.control.FullScreen.requestFullScreen(element);
goog.dom.fullscreen.requestFullScreen(element);
}
}
};
@@ -142,12 +135,12 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
var button = this.element.firstElementChild;
var map = this.getMap();
if (ol.control.FullScreen.isFullScreen()) {
if (goog.dom.fullscreen.isFullScreen()) {
button.className = this.cssClassName_ + '-true';
ol.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
} else {
button.className = this.cssClassName_ + '-false';
ol.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
}
if (map) {
map.updateSize();
@@ -160,102 +153,11 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
* @api stable
*/
ol.control.FullScreen.prototype.setMap = function(map) {
ol.control.Control.prototype.setMap.call(this, map);
goog.base(this, 'setMap', map);
if (map) {
this.listenerKeys.push(ol.events.listen(ol.global.document,
ol.control.FullScreen.getChangeType_(),
this.handleFullScreenChange_, this)
this.listenerKeys.push(
ol.events.listen(ol.global.document, goog.dom.fullscreen.EventType.CHANGE,
this.handleFullScreenChange_, this)
);
}
};
/**
* @return {boolean} Fullscreen is supported by the current platform.
*/
ol.control.FullScreen.isFullScreenSupported = function() {
var body = document.body;
return !!(
body.webkitRequestFullscreen ||
(body.mozRequestFullScreen && document.mozFullScreenEnabled) ||
(body.msRequestFullscreen && document.msFullscreenEnabled) ||
(body.requestFullscreen && document.fullscreenEnabled)
);
};
/**
* @return {boolean} Element is currently in fullscreen.
*/
ol.control.FullScreen.isFullScreen = function() {
return !!(
document.webkitIsFullScreen || document.mozFullScreen ||
document.msFullscreenElement || document.fullscreenElement
);
};
/**
* Request to fullscreen an element.
* @param {Node} element Element to request fullscreen
*/
ol.control.FullScreen.requestFullScreen = function(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
};
/**
* Request to fullscreen an element with keyboard input.
* @param {Node} element Element to request fullscreen
*/
ol.control.FullScreen.requestFullScreenWithKeys = function(element) {
if (element.mozRequestFullScreenWithKeys) {
element.mozRequestFullScreenWithKeys();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
} else {
ol.control.FullScreen.requestFullScreen(element);
}
};
/**
* Exit fullscreen.
*/
ol.control.FullScreen.exitFullScreen = function() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
};
/**
* @return {string} Change type.
* @private
*/
ol.control.FullScreen.getChangeType_ = (function() {
var changeType;
return function() {
if (!changeType) {
var body = document.body;
if (body.webkitRequestFullscreen) {
changeType = 'webkitfullscreenchange';
} else if (body.mozRequestFullScreen) {
changeType = 'mozfullscreenchange';
} else if (body.msRequestFullscreen) {
changeType = 'MSFullscreenChange';
} else if (body.requestFullscreen) {
changeType = 'fullscreenchange';
}
}
return changeType;
};
})();

View File

@@ -37,12 +37,12 @@ ol.control.MousePosition = function(opt_options) {
var options = opt_options ? opt_options : {};
var element = document.createElement('DIV');
element.className = options.className !== undefined ? options.className : 'ol-mouse-position';
element.className = options.className !== undefined ? options.className : 'ol-mouse-position'
var render = options.render ?
options.render : ol.control.MousePosition.render;
ol.control.Control.call(this, {
goog.base(this, {
element: element,
render: render,
target: options.target
@@ -90,7 +90,7 @@ ol.control.MousePosition = function(opt_options) {
this.lastMouseMovePixel_ = null;
};
ol.inherits(ol.control.MousePosition, ol.control.Control);
goog.inherits(ol.control.MousePosition, ol.control.Control);
/**
@@ -174,7 +174,7 @@ ol.control.MousePosition.prototype.handleMouseOut = function(event) {
* @api stable
*/
ol.control.MousePosition.prototype.setMap = function(map) {
ol.control.Control.prototype.setMap.call(this, map);
goog.base(this, 'setMap', map);
if (map) {
var viewport = map.getViewport();
this.listenerKeys.push(

View File

@@ -1,6 +1,7 @@
goog.provide('ol.control.OverviewMap');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
@@ -16,7 +17,6 @@ goog.require('ol.ViewProperty');
goog.require('ol.control.Control');
goog.require('ol.coordinate');
goog.require('ol.css');
goog.require('ol.dom');
goog.require('ol.extent');
@@ -55,37 +55,30 @@ ol.control.OverviewMap = function(opt_options) {
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00AB';
if (typeof collapseLabel === 'string') {
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = document.createElement('span');
this.collapseLabel_.textContent = collapseLabel;
} else {
this.collapseLabel_ = collapseLabel;
}
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = typeof collapseLabel === 'string' ?
goog.dom.createDom('SPAN', {}, collapseLabel) :
collapseLabel;
var label = options.label !== undefined ? options.label : '\u00BB';
if (typeof label === 'string') {
/**
* @private
* @type {Node}
*/
this.label_ = document.createElement('span');
this.label_.textContent = label;
} else {
this.label_ = label;
}
/**
* @private
* @type {Node}
*/
this.label_ = typeof label === 'string' ?
goog.dom.createDom('SPAN', {}, label) :
label;
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(activeLabel);
var button = goog.dom.createDom('BUTTON', {
'type': 'button',
'title': tipLabel
}, activeLabel);
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
@@ -134,20 +127,18 @@ ol.control.OverviewMap = function(opt_options) {
ol.css.CLASS_CONTROL +
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
(this.collapsible_ ? '' : ' ol-uncollapsible');
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(ovmapDiv);
element.appendChild(button);
var element = goog.dom.createDom('DIV',
cssClasses, ovmapDiv, button);
var render = options.render ? options.render : ol.control.OverviewMap.render;
ol.control.Control.call(this, {
goog.base(this, {
element: element,
render: render,
target: options.target
});
};
ol.inherits(ol.control.OverviewMap, ol.control.Control);
goog.inherits(ol.control.OverviewMap, ol.control.Control);
/**
@@ -165,7 +156,7 @@ ol.control.OverviewMap.prototype.setMap = function(map) {
this.unbindView_(oldView);
}
}
ol.control.Control.prototype.setMap.call(this, map);
goog.base(this, 'setMap', map);
if (map) {
this.listenerKeys.push(ol.events.listen(
@@ -454,9 +445,9 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
ol.control.OverviewMap.prototype.handleToggle_ = function() {
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
ol.dom.replaceNode(this.collapseLabel_, this.label_);
goog.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
ol.dom.replaceNode(this.label_, this.collapseLabel_);
goog.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_;

View File

@@ -1,5 +1,6 @@
goog.provide('ol.control.Rotate');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
@@ -35,9 +36,8 @@ ol.control.Rotate = function(opt_options) {
this.label_ = null;
if (typeof label === 'string') {
this.label_ = document.createElement('span');
this.label_.className = 'ol-compass';
this.label_.textContent = label;
this.label_ = goog.dom.createDom('SPAN',
'ol-compass', label);
} else {
this.label_ = label;
this.label_.classList.add('ol-compass');
@@ -45,26 +45,24 @@ ol.control.Rotate = function(opt_options) {
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
var button = document.createElement('button');
button.className = className + '-reset';
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(this.label_);
var button = goog.dom.createDom('BUTTON', {
'class': className + '-reset',
'type' : 'button',
'title': tipLabel
}, this.label_);
ol.events.listen(button, ol.events.EventType.CLICK,
ol.control.Rotate.prototype.handleClick_, this);
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL;
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(button);
var element = goog.dom.createDom('DIV', cssClasses, button);
var render = options.render ? options.render : ol.control.Rotate.render;
this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;
ol.control.Control.call(this, {
goog.base(this, {
element: element,
render: render,
target: options.target
@@ -93,7 +91,7 @@ ol.control.Rotate = function(opt_options) {
}
};
ol.inherits(ol.control.Rotate, ol.control.Control);
goog.inherits(ol.control.Rotate, ol.control.Control);
/**

View File

@@ -1,7 +1,10 @@
goog.provide('ol.control.ScaleLine');
goog.provide('ol.control.ScaleLineProperty');
goog.provide('ol.control.ScaleLineUnits');
goog.require('goog.asserts');
goog.require('ol.events');
goog.require('goog.style');
goog.require('ol');
goog.require('ol.Object');
goog.require('ol.control.Control');
@@ -22,6 +25,7 @@ ol.control.ScaleLineProperty = {
* Units for the scale line. Supported values are `'degrees'`, `'imperial'`,
* `'nautical'`, `'metric'`, `'us'`.
* @enum {string}
* @api stable
*/
ol.control.ScaleLineUnits = {
DEGREES: 'degrees',
@@ -99,7 +103,7 @@ ol.control.ScaleLine = function(opt_options) {
var render = options.render ? options.render : ol.control.ScaleLine.render;
ol.control.Control.call(this, {
goog.base(this, {
element: this.element_,
render: render,
target: options.target
@@ -113,7 +117,7 @@ ol.control.ScaleLine = function(opt_options) {
ol.control.ScaleLineUnits.METRIC);
};
ol.inherits(ol.control.ScaleLine, ol.control.Control);
goog.inherits(ol.control.ScaleLine, ol.control.Control);
/**
@@ -180,7 +184,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
if (!viewState) {
if (this.renderedVisible_) {
this.element_.style.display = 'none';
goog.style.setElementShown(this.element_, false);
this.renderedVisible_ = false;
}
return;
@@ -255,7 +259,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
Math.pow(10, Math.floor(i / 3));
width = Math.round(count / pointResolution);
if (isNaN(width)) {
this.element_.style.display = 'none';
goog.style.setElementShown(this.element_, false);
this.renderedVisible_ = false;
return;
} else if (width >= this.minWidth_) {
@@ -276,7 +280,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
}
if (!this.renderedVisible_) {
this.element_.style.display = '';
goog.style.setElementShown(this.element_, true);
this.renderedVisible_ = true;
}

View File

@@ -1,5 +1,6 @@
goog.provide('ol.control.Zoom');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol.animation');
@@ -35,36 +36,29 @@ ol.control.Zoom = function(opt_options) {
var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?
options.zoomOutTipLabel : 'Zoom out';
var inElement = document.createElement('button');
inElement.className = className + '-in';
inElement.setAttribute('type', 'button');
inElement.title = zoomInTipLabel;
inElement.appendChild(
typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel
);
var inElement = goog.dom.createDom('BUTTON', {
'class': className + '-in',
'type' : 'button',
'title': zoomInTipLabel
}, zoomInLabel);
ol.events.listen(inElement, ol.events.EventType.CLICK,
ol.control.Zoom.prototype.handleClick_.bind(this, delta));
var outElement = document.createElement('button');
outElement.className = className + '-out';
outElement.setAttribute('type', 'button');
outElement.title = zoomOutTipLabel;
outElement.appendChild(
typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel
);
var outElement = goog.dom.createDom('BUTTON', {
'class': className + '-out',
'type' : 'button',
'title': zoomOutTipLabel
}, zoomOutLabel);
ol.events.listen(outElement, ol.events.EventType.CLICK,
ol.control.Zoom.prototype.handleClick_.bind(this, -delta));
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL;
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(inElement);
element.appendChild(outElement);
var element = goog.dom.createDom('DIV', cssClasses, inElement, outElement);
ol.control.Control.call(this, {
goog.base(this, {
element: element,
target: options.target
});
@@ -76,7 +70,7 @@ ol.control.Zoom = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 250;
};
ol.inherits(ol.control.Zoom, ol.control.Control);
goog.inherits(ol.control.Zoom, ol.control.Control);
/**

View File

@@ -3,6 +3,8 @@
goog.provide('ol.control.ZoomSlider');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.style');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.EventType');
@@ -56,7 +58,7 @@ ol.control.ZoomSlider = function(opt_options) {
this.dragging_;
/**
* @type {!Array.<ol.EventsKey>}
* @type {!Array.<ol.events.Key>}
* @private
*/
this.dragListenerKeys_ = [];
@@ -107,12 +109,14 @@ ol.control.ZoomSlider = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 200;
var className = options.className !== undefined ? options.className : 'ol-zoomslider';
var thumbElement = document.createElement('button');
thumbElement.setAttribute('type', 'button');
thumbElement.className = className + '-thumb ' + ol.css.CLASS_UNSELECTABLE;
var containerElement = document.createElement('div');
containerElement.className = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL;
containerElement.appendChild(thumbElement);
var thumbElement = goog.dom.createDom('BUTTON', {
'type': 'button',
'class': className + '-thumb ' + ol.css.CLASS_UNSELECTABLE
});
var containerElement = goog.dom.createDom('DIV',
[className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL],
thumbElement);
/**
* @type {ol.pointer.PointerEventHandler}
* @private
@@ -133,12 +137,12 @@ ol.control.ZoomSlider = function(opt_options) {
var render = options.render ? options.render : ol.control.ZoomSlider.render;
ol.control.Control.call(this, {
goog.base(this, {
element: containerElement,
render: render
});
};
ol.inherits(ol.control.ZoomSlider, ol.control.Control);
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
/**
@@ -146,7 +150,7 @@ ol.inherits(ol.control.ZoomSlider, ol.control.Control);
*/
ol.control.ZoomSlider.prototype.disposeInternal = function() {
this.dragger_.dispose();
ol.control.Control.prototype.disposeInternal.call(this);
goog.base(this, 'disposeInternal');
};
@@ -165,7 +169,7 @@ ol.control.ZoomSlider.direction = {
* @inheritDoc
*/
ol.control.ZoomSlider.prototype.setMap = function(map) {
ol.control.Control.prototype.setMap.call(this, map);
goog.base(this, 'setMap', map);
if (map) {
map.render();
}
@@ -181,18 +185,15 @@ ol.control.ZoomSlider.prototype.setMap = function(map) {
*/
ol.control.ZoomSlider.prototype.initSlider_ = function() {
var container = this.element;
var containerSize = {
width: container.offsetWidth, height: container.offsetHeight
};
var containerSize = goog.style.getSize(container);
var thumb = container.firstElementChild;
var computedStyle = ol.global.getComputedStyle(thumb);
var thumbWidth = thumb.offsetWidth +
parseFloat(computedStyle['marginRight']) +
parseFloat(computedStyle['marginLeft']);
var thumbHeight = thumb.offsetHeight +
parseFloat(computedStyle['marginTop']) +
parseFloat(computedStyle['marginBottom']);
var thumbMargins = goog.style.getMarginBox(thumb);
var thumbBorderBoxSize = goog.style.getBorderBoxSize(thumb);
var thumbWidth = thumbBorderBoxSize.width +
thumbMargins.right + thumbMargins.left;
var thumbHeight = thumbBorderBoxSize.height +
thumbMargins.top + thumbMargins.bottom;
this.thumbSize_ = [thumbWidth, thumbHeight];
if (containerSize.width > containerSize.height) {

View File

@@ -1,6 +1,7 @@
goog.provide('ol.control.ZoomToExtent');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol.control.Control');
@@ -32,28 +33,24 @@ ol.control.ZoomToExtent = function(opt_options) {
var label = options.label !== undefined ? options.label : 'E';
var tipLabel = options.tipLabel !== undefined ?
options.tipLabel : 'Fit to extent';
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(
typeof label === 'string' ? document.createTextNode(label) : label
);
var button = goog.dom.createDom('BUTTON', {
'type': 'button',
'title': tipLabel
}, label);
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL;
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(button);
var element = goog.dom.createDom('DIV', cssClasses, button);
ol.control.Control.call(this, {
goog.base(this, {
element: element,
target: options.target
});
};
ol.inherits(ol.control.ZoomToExtent, ol.control.Control);
goog.inherits(ol.control.ZoomToExtent, ol.control.Control);
/**

View File

@@ -1,4 +1,5 @@
goog.provide('ol.DeviceOrientation');
goog.provide('ol.DeviceOrientationProperty');
goog.require('ol.events');
goog.require('ol');
@@ -76,13 +77,13 @@ ol.DeviceOrientationProperty = {
*/
ol.DeviceOrientation = function(opt_options) {
ol.Object.call(this);
goog.base(this);
var options = opt_options ? opt_options : {};
/**
* @private
* @type {?ol.EventsKey}
* @type {?ol.events.Key}
*/
this.listenerKey_ = null;
@@ -93,7 +94,7 @@ ol.DeviceOrientation = function(opt_options) {
this.setTracking(options.tracking !== undefined ? options.tracking : false);
};
ol.inherits(ol.DeviceOrientation, ol.Object);
goog.inherits(ol.DeviceOrientation, ol.Object);
/**
@@ -101,7 +102,7 @@ ol.inherits(ol.DeviceOrientation, ol.Object);
*/
ol.DeviceOrientation.prototype.disposeInternal = function() {
this.setTracking(false);
ol.Object.prototype.disposeInternal.call(this);
goog.base(this, 'disposeInternal');
};

View File

@@ -213,31 +213,3 @@ ol.dom.outerHeight = function(element) {
return height;
};
/**
* @param {Node} newNode Node to replace old node
* @param {Node} oldNode The node to be replaced
*/
ol.dom.replaceNode = function(newNode, oldNode) {
var parent = oldNode.parentNode;
if (parent) {
parent.replaceChild(newNode, oldNode);
}
};
/**
* @param {Node} node The node to remove.
* @returns {Node} The node that was removed or null.
*/
ol.dom.removeNode = function(node) {
return node && node.parentNode ? node.parentNode.removeChild(node) : null;
};
/**
* @param {Node} node The node to remove the children from.
*/
ol.dom.removeChildren = function(node) {
while (node.lastChild) {
node.removeChild(node.lastChild);
}
};

View File

@@ -3,6 +3,7 @@ goog.provide('ol.events.EventType');
goog.provide('ol.events.KeyCode');
goog.require('ol.object');
goog.require('ol.events.EventTargetLike');
/**
@@ -62,8 +63,8 @@ ol.events.LISTENER_MAP_PROP_ = 'olm_' + ((Math.random() * 1e4) | 0);
/**
* @param {ol.EventsKey} listenerObj Listener object.
* @return {ol.EventsListenerFunctionType} Bound listener.
* @param {ol.events.Key} listenerObj Listener object.
* @return {ol.events.ListenerFunctionType} Bound listener.
*/
ol.events.bindListener_ = function(listenerObj) {
var boundListener = function(evt) {
@@ -73,22 +74,22 @@ ol.events.bindListener_ = function(listenerObj) {
ol.events.unlistenByKey(listenerObj);
}
return listener.call(bindTo, evt);
};
}
listenerObj.boundListener = boundListener;
return boundListener;
};
/**
* Finds the matching {@link ol.EventsKey} in the given listener
* Finds the matching {@link ol.events.Key} in the given listener
* array.
*
* @param {!Array<!ol.EventsKey>} listeners Array of listeners.
* @param {!Array<!ol.events.Key>} listeners Array of listeners.
* @param {!Function} listener The listener function.
* @param {Object=} opt_this The `this` value inside the listener.
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
* listener, for {@link ol.events.unlistenByKey}.
* @return {ol.EventsKey|undefined} The matching listener object.
* @return {ol.events.Key|undefined} The matching listener object.
* @private
*/
ol.events.findListener_ = function(listeners, listener, opt_this,
@@ -109,9 +110,9 @@ ol.events.findListener_ = function(listeners, listener, opt_this,
/**
* @param {ol.EventTargetLike} target Target.
* @param {ol.events.EventTargetLike} target Target.
* @param {string} type Type.
* @return {Array.<ol.EventsKey>|undefined} Listeners.
* @return {Array.<ol.events.Key>|undefined} Listeners.
*/
ol.events.getListeners = function(target, type) {
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
@@ -122,8 +123,8 @@ ol.events.getListeners = function(target, type) {
/**
* Get the lookup of listeners. If one does not exist on the target, it is
* created.
* @param {ol.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.EventsKey>>} Map of
* @param {ol.events.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.events.Key>>} Map of
* listeners by event type.
* @private
*/
@@ -140,7 +141,7 @@ ol.events.getListenerMap_ = function(target) {
* Clean up all listener objects of the given type. All properties on the
* listener objects will be removed, and if no listeners remain in the listener
* map, it will be removed from the target.
* @param {ol.EventTargetLike} target Target.
* @param {ol.events.EventTargetLike} target Target.
* @param {string} type Type.
* @private
*/
@@ -149,7 +150,7 @@ ol.events.removeListeners_ = function(target, type) {
if (listeners) {
for (var i = 0, ii = listeners.length; i < ii; ++i) {
target.removeEventListener(type, listeners[i].boundListener);
ol.object.clear(listeners[i]);
ol.object.clear(listeners[i])
}
listeners.length = 0;
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
@@ -170,13 +171,13 @@ ol.events.removeListeners_ = function(target, type) {
* This function efficiently binds a `listener` to a `this` object, and returns
* a key for use with {@link ol.events.unlistenByKey}.
*
* @param {ol.EventTargetLike} target Event target.
* @param {ol.events.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @param {boolean=} opt_once If true, add the listener as one-off listener.
* @return {ol.EventsKey} Unique key for the listener.
* @return {ol.events.Key} Unique key for the listener.
*/
ol.events.listen = function(target, type, listener, opt_this, opt_once) {
var listenerMap = ol.events.getListenerMap_(target);
@@ -192,7 +193,7 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
listenerObj.callOnce = false;
}
} else {
listenerObj = /** @type {ol.EventsKey} */ ({
listenerObj = /** @type {ol.events.Key} */ ({
bindTo: opt_this,
callOnce: !!opt_once,
listener: listener,
@@ -220,12 +221,12 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
* function, the self-unregistering listener will be turned into a permanent
* listener.
*
* @param {ol.EventTargetLike} target Event target.
* @param {ol.events.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @return {ol.EventsKey} Key for unlistenByKey.
* @return {ol.events.Key} Key for unlistenByKey.
*/
ol.events.listenOnce = function(target, type, listener, opt_this) {
return ol.events.listen(target, type, listener, opt_this, true);
@@ -239,9 +240,9 @@ ol.events.listenOnce = function(target, type, listener, opt_this) {
* To return a listener, this function needs to be called with the exact same
* arguments that were used for a previous {@link ol.events.listen} call.
*
* @param {ol.EventTargetLike} target Event target.
* @param {ol.events.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
*/
@@ -264,7 +265,7 @@ ol.events.unlisten = function(target, type, listener, opt_this) {
* The argument passed to this function is the key returned from
* {@link ol.events.listen} or {@link ol.events.listenOnce}.
*
* @param {ol.EventsKey} key The key.
* @param {ol.events.Key} key The key.
*/
ol.events.unlistenByKey = function(key) {
if (key && key.target) {
@@ -288,7 +289,7 @@ ol.events.unlistenByKey = function(key) {
* Unregisters all event listeners on an event target. Inspired by
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* @param {ol.EventTargetLike} target Target.
* @param {ol.events.EventTargetLike} target Target.
*/
ol.events.unlistenAll = function(target) {
var listenerMap = ol.events.getListenerMap_(target);

View File

@@ -202,14 +202,12 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
/**
* Return `true` if the event originates from a mouse device.
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event originates from a mouse device.
* @api stable
*/
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
goog.asserts.assertInstanceof(mapBrowserEvent, ol.MapBrowserPointerEvent,
'Requires an ol.MapBrowserPointerEvent to work.');
return mapBrowserEvent.pointerEvent.pointerType == 'mouse';
};

View File

@@ -5,7 +5,6 @@ goog.require('ol.Disposable');
goog.require('ol.events');
goog.require('ol.events.Event');
/**
* @classdesc
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
@@ -26,7 +25,7 @@ goog.require('ol.events.Event');
*/
ol.events.EventTarget = function() {
ol.Disposable.call(this);
goog.base(this);
/**
* @private
@@ -42,17 +41,17 @@ ol.events.EventTarget = function() {
/**
* @private
* @type {!Object.<string, Array.<ol.EventsListenerFunctionType>>}
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
*/
this.listeners_ = {};
};
ol.inherits(ol.events.EventTarget, ol.Disposable);
goog.inherits(ol.events.EventTarget, ol.Disposable);
/**
* @param {string} type Type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {ol.events.ListenerFunctionType} listener Listener.
*/
ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
var listeners = this.listeners_[type];
@@ -117,7 +116,7 @@ ol.events.EventTarget.prototype.disposeInternal = function() {
* order that they will be called in.
*
* @param {string} type Type.
* @return {Array.<ol.EventsListenerFunctionType>} Listeners.
* @return {Array.<ol.events.ListenerFunctionType>} Listeners.
*/
ol.events.EventTarget.prototype.getListeners = function(type) {
return this.listeners_[type];
@@ -138,7 +137,7 @@ ol.events.EventTarget.prototype.hasListener = function(opt_type) {
/**
* @param {string} type Type.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {ol.events.ListenerFunctionType} listener Listener.
*/
ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
var listeners = this.listeners_[type];

View File

@@ -56,7 +56,7 @@ goog.require('ol.style.Style');
*/
ol.Feature = function(opt_geometryOrProperties) {
ol.Object.call(this);
goog.base(this);
/**
* @private
@@ -86,7 +86,7 @@ ol.Feature = function(opt_geometryOrProperties) {
/**
* @private
* @type {?ol.EventsKey}
* @type {?ol.events.Key}
*/
this.geometryChangeKey_ = null;
@@ -108,7 +108,7 @@ ol.Feature = function(opt_geometryOrProperties) {
}
}
};
ol.inherits(ol.Feature, ol.Object);
goog.inherits(ol.Feature, ol.Object);
/**
@@ -294,7 +294,7 @@ ol.Feature.prototype.setGeometryName = function(name) {
ol.Feature.createStyleFunction = function(obj) {
var styleFunction;
if (typeof obj === 'function') {
if (goog.isFunction(obj)) {
styleFunction = obj;
} else {
/**

View File

@@ -31,7 +31,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) {
function(extent, resolution, projection) {
var xhr = new XMLHttpRequest();
xhr.open('GET',
typeof url === 'function' ? url(extent, resolution, projection) : url,
goog.isFunction(url) ? url(extent, resolution, projection) : url,
true);
if (format.getType() == ol.format.FormatType.ARRAY_BUFFER) {
xhr.responseType = 'arraybuffer';

View File

@@ -33,7 +33,7 @@ ol.format.EsriJSON = function(opt_options) {
var options = opt_options ? opt_options : {};
ol.format.JSONFeature.call(this);
goog.base(this);
/**
* Name of the geometry attribute for features.
@@ -43,7 +43,7 @@ ol.format.EsriJSON = function(opt_options) {
this.geometryName_ = options.geometryName;
};
ol.inherits(ol.format.EsriJSON, ol.format.JSONFeature);
goog.inherits(ol.format.EsriJSON, ol.format.JSONFeature);
/**

View File

@@ -31,7 +31,7 @@ ol.format.GeoJSON = function(opt_options) {
var options = opt_options ? opt_options : {};
ol.format.JSONFeature.call(this);
goog.base(this);
/**
* @inheritDoc
@@ -49,7 +49,7 @@ ol.format.GeoJSON = function(opt_options) {
this.geometryName_ = options.geometryName;
};
ol.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
goog.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
/**

View File

@@ -1,6 +1,7 @@
goog.provide('ol.format.GML2');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol.extent');
goog.require('ol.format.GMLBase');
goog.require('ol.format.XSD');
@@ -22,7 +23,7 @@ ol.format.GML2 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
ol.format.GMLBase.call(this, options);
goog.base(this, options);
this.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS][
'featureMember'] =
@@ -35,7 +36,7 @@ ol.format.GML2 = function(opt_options) {
options.schemaLocation : ol.format.GML2.schemaLocation_;
};
ol.inherits(ol.format.GML2, ol.format.GMLBase);
goog.inherits(ol.format.GML2, ol.format.GMLBase);
/**
@@ -55,7 +56,7 @@ ol.format.GML2.schemaLocation_ = ol.format.GMLBase.GMLNS +
*/
ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
var context = objectStack[0];
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
var containerSrs = context['srsName'];
var containerDimension = node.parentNode.getAttribute('srsDimension');
@@ -101,7 +102,7 @@ ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Envelope.
*/
ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Box', 'localName should be Box');
/** @type {Array.<number>} */
@@ -119,7 +120,7 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
* @private
*/
ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs');
@@ -144,7 +145,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs');
@@ -165,7 +166,7 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -178,7 +179,7 @@ ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -191,7 +192,7 @@ ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML2.prototype.BOX_PARSERS_ = {
@@ -204,7 +205,7 @@ ol.format.GML2.prototype.BOX_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = {

View File

@@ -2,6 +2,7 @@ goog.provide('ol.format.GML');
goog.provide('ol.format.GML3');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol');
goog.require('ol.array');
goog.require('ol.Feature');
@@ -38,7 +39,7 @@ ol.format.GML3 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
ol.format.GMLBase.call(this, options);
goog.base(this, options);
/**
* @private
@@ -73,7 +74,7 @@ ol.format.GML3 = function(opt_options) {
options.schemaLocation : ol.format.GML3.schemaLocation_;
};
ol.inherits(ol.format.GML3, ol.format.GMLBase);
goog.inherits(ol.format.GML3, ol.format.GMLBase);
/**
@@ -93,7 +94,7 @@ ol.format.GML3.schemaLocation_ = ol.format.GMLBase.GMLNS +
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiCurve',
'localName should be MultiCurve');
@@ -117,7 +118,7 @@ ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiSurface',
'localName should be MultiSurface');
@@ -140,7 +141,7 @@ ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'curveMember' ||
node.localName == 'curveMembers',
@@ -155,7 +156,7 @@ ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'surfaceMember' ||
node.localName == 'surfaceMembers',
@@ -172,7 +173,7 @@ ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'patches',
'localName should be patches');
@@ -188,7 +189,7 @@ ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
* @return {Array.<number>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'segments',
'localName should be segments');
@@ -204,7 +205,7 @@ ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'npde.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'PolygonPatch',
'localName should be PolygonPatch');
@@ -220,7 +221,7 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
* @return {Array.<number>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineStringSegment',
'localName should be LineStringSegment');
@@ -236,7 +237,7 @@ ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'interior',
'localName should be interior');
@@ -261,7 +262,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'exterior',
'localName should be exterior');
@@ -287,7 +288,7 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Surface',
'localName should be Surface');
@@ -319,7 +320,7 @@ ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Curve', 'localName should be Curve');
/** @type {Array.<number>} */
@@ -342,7 +343,7 @@ ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Envelope.
*/
ol.format.GML3.prototype.readEnvelope_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Envelope',
'localName should be Envelope');
@@ -449,7 +450,7 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -462,7 +463,7 @@ ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -475,7 +476,7 @@ ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
@@ -505,7 +506,7 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
@@ -520,7 +521,7 @@ ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
@@ -535,7 +536,7 @@ ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
@@ -549,7 +550,7 @@ ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
@@ -562,7 +563,7 @@ ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.SURFACE_PARSERS_ = {
@@ -574,7 +575,7 @@ ol.format.GML3.prototype.SURFACE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.CURVE_PARSERS_ = {
@@ -586,7 +587,7 @@ ol.format.GML3.prototype.CURVE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
@@ -601,7 +602,7 @@ ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.PATCHES_PARSERS_ = {
@@ -614,7 +615,7 @@ ol.format.GML3.prototype.PATCHES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = {
@@ -711,7 +712,7 @@ ol.format.GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GML3.ENVELOPE_SERIALIZERS_ = {
@@ -737,7 +738,7 @@ ol.format.GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
}
var keys = ['lowerCorner', 'upperCorner'];
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
({node: node}), ol.format.GML3.ENVELOPE_SERIALIZERS_,
ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
values,
@@ -1018,7 +1019,7 @@ ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectS
value =
ol.format.Feature.transformWithOptions(geometry, true, context);
}
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
(item), ol.format.GML3.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
@@ -1065,7 +1066,7 @@ ol.format.GML3.prototype.writeFeatureElement = function(node, feature, objectSta
}
var item = ol.object.assign({}, context);
item.node = node;
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
(item), context.serializers,
ol.xml.makeSimpleNodeFactory(undefined, featureNS),
values,
@@ -1090,7 +1091,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
this.writeFeatureElement, this);
var item = ol.object.assign({}, context);
item.node = node;
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
(item),
serializers,
ol.xml.makeSimpleNodeFactory(featureType, featureNS), features,
@@ -1099,7 +1100,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
@@ -1113,7 +1114,7 @@ ol.format.GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GML3.POINTMEMBER_SERIALIZERS_ = {
@@ -1125,7 +1126,7 @@ ol.format.GML3.POINTMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
@@ -1139,7 +1140,7 @@ ol.format.GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GML3.RING_SERIALIZERS_ = {
@@ -1151,7 +1152,7 @@ ol.format.GML3.RING_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GML3.GEOMETRY_SERIALIZERS_ = {

View File

@@ -4,6 +4,7 @@
goog.provide('ol.format.GMLBase');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol.array');
goog.require('ol.Feature');
goog.require('ol.format.Feature');
@@ -75,9 +76,9 @@ ol.format.GMLBase = function(opt_options) {
ol.format.GMLBase.prototype.readFeaturesInternal)
};
ol.format.XMLFeature.call(this);
goog.base(this);
};
ol.inherits(ol.format.GMLBase, ol.format.XMLFeature);
goog.inherits(ol.format.GMLBase, ol.format.XMLFeature);
/**
@@ -108,7 +109,7 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
* @return {Array.<ol.Feature> | undefined} Features.
*/
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
var localName = node.localName;
var features = null;
@@ -262,7 +263,7 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point.
*/
ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
var flatCoordinates =
@@ -283,7 +284,7 @@ ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
*/
ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiPoint',
'localName should be MultiPoint');
@@ -304,7 +305,7 @@ ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiLineString',
'localName should be MultiLineString');
@@ -327,7 +328,7 @@ ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiPolygon',
'localName should be MultiPolygon');
@@ -350,7 +351,7 @@ ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
* @private
*/
ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'pointMember' ||
node.localName == 'pointMembers',
@@ -366,7 +367,7 @@ ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
* @private
*/
ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'lineStringMember' ||
node.localName == 'lineStringMembers',
@@ -382,7 +383,7 @@ ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack
* @private
*/
ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'polygonMember' ||
node.localName == 'polygonMembers',
@@ -398,7 +399,7 @@ ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineString',
'localName should be LineString');
@@ -421,7 +422,7 @@ ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
* @return {Array.<number>|undefined} LinearRing flat coordinates.
*/
ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -442,7 +443,7 @@ ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
* @return {ol.geom.LinearRing|undefined} LinearRing.
*/
ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -464,7 +465,7 @@ ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Polygon',
'localName should be Polygon');
@@ -496,7 +497,7 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates.
*/
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null,
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
@@ -506,7 +507,7 @@ ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, object
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
@@ -521,7 +522,7 @@ ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
@@ -536,7 +537,7 @@ ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
@@ -551,7 +552,7 @@ ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
@@ -564,7 +565,7 @@ ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
@@ -577,7 +578,7 @@ ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
@@ -590,7 +591,7 @@ ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @protected
*/
ol.format.GMLBase.prototype.RING_PARSERS = {

View File

@@ -1,6 +1,7 @@
goog.provide('ol.format.GPX');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol.Feature');
goog.require('ol.array');
goog.require('ol.format.Feature');
@@ -27,7 +28,7 @@ ol.format.GPX = function(opt_options) {
var options = opt_options ? opt_options : {};
ol.format.XMLFeature.call(this);
goog.base(this);
/**
* @inheritDoc
@@ -40,7 +41,7 @@ ol.format.GPX = function(opt_options) {
*/
this.readExtensions_ = options.readExtensions;
};
ol.inherits(ol.format.GPX, ol.format.XMLFeature);
goog.inherits(ol.format.GPX, ol.format.XMLFeature);
/**
@@ -55,15 +56,6 @@ ol.format.GPX.NAMESPACE_URIS_ = [
];
/**
* @const
* @type {string}
* @private
*/
ol.format.GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
'http://www.topografix.com/GPX/1/1/gpx.xsd';
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Node} node Node.
@@ -72,7 +64,7 @@ ol.format.GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
* @return {Array.<number>} Flat coordinates.
*/
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
flatCoordinates.push(
parseFloat(node.getAttribute('lon')),
@@ -99,7 +91,7 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
* @private
*/
ol.format.GPX.parseLink_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'link', 'localName should be link');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
@@ -117,7 +109,7 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'extensions',
'localName should be extensions');
@@ -132,7 +124,7 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'rtept', 'localName should be rtept');
var values = ol.xml.pushParseAndPop(
@@ -152,7 +144,7 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'trkpt', 'localName should be trkpt');
var values = ol.xml.pushParseAndPop(
@@ -172,7 +164,7 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'trkseg',
'localName should be trkseg');
@@ -192,7 +184,7 @@ ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track.
*/
ol.format.GPX.readRte_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'rte', 'localName should be rte');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
@@ -221,7 +213,7 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track.
*/
ol.format.GPX.readTrk_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'trk', 'localName should be trk');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
@@ -254,7 +246,7 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Waypoint.
*/
ol.format.GPX.readWpt_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'wpt', 'localName should be wpt');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
@@ -287,7 +279,7 @@ ol.format.GPX.FEATURE_READER_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.GPX_PARSERS_ = ol.xml.makeStructureNS(
@@ -300,7 +292,7 @@ ol.format.GPX.GPX_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.LINK_PARSERS_ = ol.xml.makeStructureNS(
@@ -314,7 +306,7 @@ ol.format.GPX.LINK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.RTE_PARSERS_ = ol.xml.makeStructureNS(
@@ -334,7 +326,7 @@ ol.format.GPX.RTE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.RTEPT_PARSERS_ = ol.xml.makeStructureNS(
@@ -346,7 +338,7 @@ ol.format.GPX.RTEPT_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.TRK_PARSERS_ = ol.xml.makeStructureNS(
@@ -366,7 +358,7 @@ ol.format.GPX.TRK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.TRKSEG_PARSERS_ = ol.xml.makeStructureNS(
@@ -377,7 +369,7 @@ ol.format.GPX.TRKSEG_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.TRKPT_PARSERS_ = ol.xml.makeStructureNS(
@@ -389,7 +381,7 @@ ol.format.GPX.TRKPT_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.GPX.WPT_PARSERS_ = ol.xml.makeStructureNS(
@@ -440,8 +432,6 @@ ol.format.GPX.prototype.handleReadExtensions_ = function(features) {
/**
* Read the first feature from a GPX source.
* Routes (`<rte>`) are converted into LineString geometries, and tracks (`<trk>`)
* into MultiLineString. Any properties on route and track waypoints are ignored.
*
* @function
* @param {Document|Node|Object|string} source Source.
@@ -456,7 +446,7 @@ ol.format.GPX.prototype.readFeature;
* @inheritDoc
*/
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
@@ -476,8 +466,6 @@ ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
/**
* Read all features from a GPX source.
* Routes (`<rte>`) are converted into LineString geometries, and tracks (`<trk>`)
* into MultiLineString. Any properties on route and track waypoints are ignored.
*
* @function
* @param {Document|Node|Object|string} source Source.
@@ -492,7 +480,7 @@ ol.format.GPX.prototype.readFeatures;
* @inheritDoc
*/
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
@@ -538,7 +526,7 @@ ol.format.GPX.writeLink_ = function(node, value, objectStack) {
properties['linkText'],
properties['linkType']
];
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ({node: node}),
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */ ({node: node}),
ol.format.GPX.LINK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
link, objectStack, ol.format.GPX.LINK_SEQUENCE_);
};
@@ -581,11 +569,9 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
default:
// pass
}
var orderedKeys = (node.nodeName == 'rtept') ?
ol.format.GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
var values = ol.xml.makeSequence(properties, orderedKeys);
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
({node: node, 'properties': properties}),
ol.format.GPX.WPT_TYPE_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
@@ -629,7 +615,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var properties = feature.getProperties();
/** @type {ol.XmlNodeStackItem} */
/** @type {ol.xmlNodeStackItem} */
var context = {node: node, 'properties': properties};
var geometry = feature.getGeometry();
if (geometry) {
@@ -655,7 +641,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
* @private
*/
ol.format.GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
/** @type {ol.XmlNodeStackItem} */
/** @type {ol.xmlNodeStackItem} */
var context = {node: node, 'geometryLayout': lineString.getLayout(),
'properties': {}};
ol.xml.pushSerializeAndPop(context,
@@ -696,7 +682,7 @@ ol.format.GPX.LINK_SEQUENCE_ = ['text', 'type'];
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GPX.LINK_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -719,7 +705,7 @@ ol.format.GPX.RTE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GPX.RTE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -737,17 +723,6 @@ ol.format.GPX.RTE_SERIALIZERS_ = ol.xml.makeStructureNS(
});
/**
* @const
* @type {Object.<string, Array.<string>>}
* @private
*/
ol.format.GPX.RTEPT_TYPE_SEQUENCE_ = ol.xml.makeStructureNS(
ol.format.GPX.NAMESPACE_URIS_, [
'ele', 'time'
]);
/**
* @const
* @type {Object.<string, Array.<string>>}
@@ -761,7 +736,7 @@ ol.format.GPX.TRK_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GPX.TRK_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -789,7 +764,7 @@ ol.format.GPX.TRKSEG_NODE_FACTORY_ = ol.xml.makeSimpleNodeFactory('trkpt');
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GPX.TRKSEG_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -812,7 +787,7 @@ ol.format.GPX.WPT_TYPE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GPX.WPT_TYPE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -880,7 +855,7 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -919,15 +894,8 @@ ol.format.GPX.prototype.writeFeaturesNode = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
//FIXME Serialize metadata
var gpx = ol.xml.createElementNS('http://www.topografix.com/GPX/1/1', 'gpx');
var xmlnsUri = 'http://www.w3.org/2000/xmlns/';
var xmlSchemaInstanceUri = 'http://www.w3.org/2001/XMLSchema-instance';
ol.xml.setAttributeNS(gpx, xmlnsUri, 'xmlns:xsi', xmlSchemaInstanceUri);
ol.xml.setAttributeNS(gpx, xmlSchemaInstanceUri, 'xsi:schemaLocation',
ol.format.GPX.SCHEMA_LOCATION_);
gpx.setAttribute('version', '1.1');
gpx.setAttribute('creator', 'OpenLayers 3');
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
({node: gpx}), ol.format.GPX.GPX_SERIALIZERS_,
ol.format.GPX.GPX_NODE_FACTORY_, features, [opt_options]);
return gpx;

View File

@@ -1,4 +1,5 @@
goog.provide('ol.format.IGC');
goog.provide('ol.format.IGCZ');
goog.require('goog.asserts');
goog.require('ol.Feature');
@@ -12,6 +13,7 @@ goog.require('ol.proj');
/**
* IGC altitude/z. One of 'barometric', 'gps', 'none'.
* @enum {string}
* @api
*/
ol.format.IGCZ = {
BAROMETRIC: 'barometric',
@@ -33,7 +35,7 @@ ol.format.IGC = function(opt_options) {
var options = opt_options ? opt_options : {};
ol.format.TextFeature.call(this);
goog.base(this);
/**
* @inheritDoc
@@ -48,7 +50,7 @@ ol.format.IGC = function(opt_options) {
options.altitudeMode : ol.format.IGCZ.NONE;
};
ol.inherits(ol.format.IGC, ol.format.TextFeature);
goog.inherits(ol.format.IGC, ol.format.TextFeature);
/**
@@ -126,7 +128,6 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
var year = 2000;
var month = 0;
var day = 1;
var lastDateTime = -1;
var i, ii;
for (i = 0, ii = lines.length; i < ii; ++i) {
var line = lines[i];
@@ -159,12 +160,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
flatCoordinates.push(z);
}
var dateTime = Date.UTC(year, month, day, hour, minute, second);
// Detect UTC midnight wrap around.
if (dateTime < lastDateTime) {
dateTime = Date.UTC(year, month, day + 1, hour, minute, second);
}
flatCoordinates.push(dateTime / 1000);
lastDateTime = dateTime;
}
} else if (line.charAt(0) == 'H') {
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
@@ -176,6 +172,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
m = ol.format.IGC.H_RECORD_RE_.exec(line);
if (m) {
properties[m[1]] = m[2].trim();
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
}
}
}

View File

@@ -15,9 +15,9 @@ goog.require('ol.format.FormatType');
* @extends {ol.format.Feature}
*/
ol.format.JSONFeature = function() {
ol.format.Feature.call(this);
goog.base(this);
};
ol.inherits(ol.format.JSONFeature, ol.format.Feature);
goog.inherits(ol.format.JSONFeature, ol.format.Feature);
/**

View File

@@ -7,6 +7,7 @@ goog.provide('ol.format.KML');
goog.require('goog.Uri');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('goog.object');
goog.require('ol');
goog.require('ol.Feature');
@@ -53,7 +54,7 @@ ol.format.KML = function(opt_options) {
var options = opt_options ? opt_options : {};
ol.format.XMLFeature.call(this);
goog.base(this);
/**
* @inheritDoc
@@ -95,7 +96,7 @@ ol.format.KML = function(opt_options) {
options.showPointNames : true;
};
ol.inherits(ol.format.KML, ol.format.XMLFeature);
goog.inherits(ol.format.KML, ol.format.XMLFeature);
/**
@@ -560,7 +561,7 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
* @private
*/
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be an ELEMENT');
goog.asserts.assert(node.localName == 'IconStyle',
'localName should be IconStyle');
@@ -661,7 +662,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LabelStyle',
'localName should be LabelStyle');
@@ -692,7 +693,7 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineStyle',
'localName should be LineStyle');
@@ -724,7 +725,7 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'PolyStyle',
'localName should be PolyStyle');
@@ -761,7 +762,7 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
* @return {Array.<number>} LinearRing flat coordinates.
*/
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -776,7 +777,7 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
* @private
*/
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
@@ -809,7 +810,7 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
@@ -834,7 +835,7 @@ ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.KML.readGxTrack_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
@@ -871,7 +872,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
* @return {Object} Icon object.
*/
ol.format.KML.readIcon_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Icon', 'localName should be Icon');
var iconObject = ol.xml.pushParseAndPop(
@@ -891,7 +892,7 @@ ol.format.KML.readIcon_ = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates.
*/
ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null,
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
@@ -905,7 +906,7 @@ ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.KML.readLineString_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineString',
'localName should be LineString');
@@ -932,7 +933,7 @@ ol.format.KML.readLineString_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.KML.readLinearRing_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -960,7 +961,7 @@ ol.format.KML.readLinearRing_ = function(node, objectStack) {
* @return {ol.geom.Geometry} Geometry.
*/
ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiGeometry',
'localName should be MultiGeometry');
@@ -1032,7 +1033,7 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point.
*/
ol.format.KML.readPoint_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
var properties = ol.xml.pushParseAndPop({},
@@ -1060,7 +1061,7 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.KML.readPolygon_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Polygon',
'localName should be Polygon');
@@ -1095,7 +1096,7 @@ ol.format.KML.readPolygon_ = function(node, objectStack) {
* @return {Array.<ol.style.Style>} Style.
*/
ol.format.KML.readStyle_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
var styleObject = ol.xml.pushParseAndPop(
@@ -1171,7 +1172,7 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
* @private
*/
ol.format.KML.DataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Data', 'localName should be Data');
var name = node.getAttribute('name');
@@ -1195,7 +1196,7 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'ExtendedData',
'localName should be ExtendedData');
@@ -1209,7 +1210,7 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PairDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Pair', 'localName should be Pair');
var pairObject = ol.xml.pushParseAndPop(
@@ -1240,7 +1241,7 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'StyleMap',
'localName should be StyleMap');
@@ -1267,7 +1268,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'SchemaData',
'localName should be SchemaData');
@@ -1281,7 +1282,7 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'SimpleData',
'localName should be SimpleData');
@@ -1301,7 +1302,7 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs');
@@ -1326,7 +1327,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs');
@@ -1351,7 +1352,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LinkParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Link', 'localName should be Link');
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
@@ -1364,7 +1365,7 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.whenParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'when', 'localName should be when');
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
@@ -1400,7 +1401,7 @@ ol.format.KML.whenParser_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.DATA_PARSERS_ = ol.xml.makeStructureNS(
@@ -1411,7 +1412,7 @@ ol.format.KML.DATA_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.EXTENDED_DATA_PARSERS_ = ol.xml.makeStructureNS(
@@ -1423,7 +1424,7 @@ ol.format.KML.EXTENDED_DATA_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1435,7 +1436,7 @@ ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.FLAT_LINEAR_RING_PARSERS_ = ol.xml.makeStructureNS(
@@ -1446,7 +1447,7 @@ ol.format.KML.FLAT_LINEAR_RING_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_ = ol.xml.makeStructureNS(
@@ -1458,7 +1459,7 @@ ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.GX_TRACK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1472,7 +1473,7 @@ ol.format.KML.GX_TRACK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = ol.xml.makeStructureNS(
@@ -1483,7 +1484,7 @@ ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.ICON_PARSERS_ = ol.xml.makeStructureNS(
@@ -1500,7 +1501,7 @@ ol.format.KML.ICON_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.ICON_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1514,7 +1515,7 @@ ol.format.KML.ICON_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.INNER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
@@ -1525,7 +1526,7 @@ ol.format.KML.INNER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.LABEL_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1537,7 +1538,7 @@ ol.format.KML.LABEL_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.LINE_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1549,7 +1550,7 @@ ol.format.KML.LINE_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.MULTI_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
@@ -1564,7 +1565,7 @@ ol.format.KML.MULTI_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
@@ -1575,7 +1576,7 @@ ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1593,7 +1594,7 @@ ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.LINK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1604,7 +1605,7 @@ ol.format.KML.LINK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
@@ -1615,7 +1616,7 @@ ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
@@ -1628,7 +1629,7 @@ ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.PLACEMARK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1665,7 +1666,7 @@ ol.format.KML.PLACEMARK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.POLY_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1678,7 +1679,7 @@ ol.format.KML.POLY_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.SCHEMA_DATA_PARSERS_ = ol.xml.makeStructureNS(
@@ -1689,7 +1690,7 @@ ol.format.KML.SCHEMA_DATA_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1703,7 +1704,7 @@ ol.format.KML.STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @private
*/
ol.format.KML.STYLE_MAP_PARSERS_ = ol.xml.makeStructureNS(
@@ -1727,7 +1728,7 @@ ol.format.KML.prototype.getExtensions = function() {
* @return {Array.<ol.Feature>|undefined} Features.
*/
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
var localName = node.localName;
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
@@ -1758,7 +1759,7 @@ ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Feature.
*/
ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Placemark',
'localName should be Placemark');
@@ -1805,7 +1806,7 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
* @private
*/
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
var id = node.getAttribute('id');
@@ -1830,7 +1831,7 @@ ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
* @private
*/
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'StyleMap',
'localName should be StyleMap');
@@ -1870,7 +1871,7 @@ ol.format.KML.prototype.readFeature;
* @inheritDoc
*/
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
@@ -1905,7 +1906,7 @@ ol.format.KML.prototype.readFeatures;
* @inheritDoc
*/
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
@@ -1973,7 +1974,7 @@ ol.format.KML.prototype.readName = function(source) {
ol.format.KML.prototype.readNameFromDocument = function(doc) {
var n;
for (n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
var name = this.readNameFromNode(n);
if (name) {
return name;
@@ -2045,7 +2046,7 @@ ol.format.KML.prototype.readNetworkLinks = function(source) {
ol.format.KML.prototype.readNetworkLinksFromDocument = function(doc) {
var n, networkLinks = [];
for (n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
}
}
@@ -2160,7 +2161,7 @@ ol.format.KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStac
* @private
*/
ol.format.KML.writeDocument_ = function(node, features, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
ol.xml.pushSerializeAndPop(context, ol.format.KML.DOCUMENT_SERIALIZERS_,
ol.format.KML.DOCUMENT_NODE_FACTORY_, features, objectStack, undefined,
this);
@@ -2174,7 +2175,7 @@ ol.format.KML.writeDocument_ = function(node, features, objectStack) {
* @private
*/
ol.format.KML.writeIcon_ = function(node, icon, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.KML.ICON_SEQUENCE_[parentNode.namespaceURI];
var values = ol.xml.makeSequence(icon, orderedKeys);
@@ -2196,7 +2197,7 @@ ol.format.KML.writeIcon_ = function(node, icon, objectStack) {
* @private
*/
ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var properties = {};
var src = style.getSrc();
var size = style.getSize();
@@ -2254,7 +2255,7 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
* @private
*/
ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var properties = {};
var fill = style.getFill();
if (fill) {
@@ -2280,7 +2281,7 @@ ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
* @private
*/
ol.format.KML.writeLineStyle_ = function(node, style, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var properties = {
'color': style.getColor(),
'width': style.getWidth()
@@ -2307,7 +2308,7 @@ ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
(geometry instanceof ol.geom.MultiPolygon),
'geometry should be one of: ol.geom.GeometryCollection, ' +
'ol.geom.MultiPoint, ol.geom.MultiLineString or ol.geom.MultiPolygon');
/** @type {ol.XmlNodeStackItem} */
/** @type {ol.xmlNodeStackItem} */
var context = {node: node};
var type = geometry.getType();
/** @type {Array.<ol.geom.Geometry>} */
@@ -2345,7 +2346,7 @@ ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
* @private
*/
ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
ol.xml.pushSerializeAndPop(context,
ol.format.KML.BOUNDARY_IS_SERIALIZERS_,
ol.format.KML.LINEAR_RING_NODE_FACTORY_, [linearRing], objectStack);
@@ -2362,7 +2363,7 @@ ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
* @private
*/
ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
// set id
if (feature.getId()) {
@@ -2420,7 +2421,7 @@ ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
'geometry should be one of ol.geom.Point, ol.geom.LineString ' +
'or ol.geom.LinearRing');
var flatCoordinates = geometry.getFlatCoordinates();
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
context['layout'] = geometry.getLayout();
context['stride'] = geometry.getStride();
ol.xml.pushSerializeAndPop(context,
@@ -2443,7 +2444,7 @@ ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
goog.asserts.assert(linearRings.length > 0,
'linearRings should not be empty');
var outerRing = linearRings.shift();
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
// inner rings
ol.xml.pushSerializeAndPop(context,
ol.format.KML.POLYGON_SERIALIZERS_,
@@ -2464,7 +2465,7 @@ ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
* @private
*/
ol.format.KML.writePolyStyle_ = function(node, style, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
ol.xml.pushSerializeAndPop(context, ol.format.KML.POLY_STYLE_SERIALIZERS_,
ol.format.KML.COLOR_NODE_FACTORY_, [style.getColor()], objectStack);
};
@@ -2489,7 +2490,7 @@ ol.format.KML.writeScaleTextNode_ = function(node, scale) {
* @private
*/
ol.format.KML.writeStyle_ = function(node, style, objectStack) {
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var properties = {};
var fillStyle = style.getFill();
var strokeStyle = style.getStroke();
@@ -2541,7 +2542,7 @@ ol.format.KML.KML_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.KML_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2553,7 +2554,7 @@ ol.format.KML.KML_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.DOCUMENT_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2595,7 +2596,7 @@ ol.format.KML.ICON_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.ICON_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2623,7 +2624,7 @@ ol.format.KML.ICON_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.ICON_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2648,7 +2649,7 @@ ol.format.KML.LABEL_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.LABEL_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2671,7 +2672,7 @@ ol.format.KML.LINE_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.LINE_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2683,7 +2684,7 @@ ol.format.KML.LINE_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.BOUNDARY_IS_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2695,7 +2696,7 @@ ol.format.KML.BOUNDARY_IS_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.MULTI_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2724,7 +2725,7 @@ ol.format.KML.PLACEMARK_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2754,7 +2755,7 @@ ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2766,7 +2767,7 @@ ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.POLYGON_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2780,7 +2781,7 @@ ol.format.KML.POLYGON_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.POLY_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2802,7 +2803,7 @@ ol.format.KML.STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @private
*/
ol.format.KML.STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2981,7 +2982,7 @@ ol.format.KML.prototype.writeFeaturesNode = function(features, opt_options) {
ol.xml.setAttributeNS(kml, xmlSchemaInstanceUri, 'xsi:schemaLocation',
ol.format.KML.SCHEMA_LOCATION_);
var /** @type {ol.XmlNodeStackItem} */ context = {node: kml};
var /** @type {ol.xmlNodeStackItem} */ context = {node: kml};
var properties = {};
if (features.length > 1) {
properties['Document'] = features;

View File

@@ -33,7 +33,7 @@ goog.require('ol.render.Feature');
*/
ol.format.MVT = function(opt_options) {
ol.format.Feature.call(this);
goog.base(this);
var options = opt_options ? opt_options : {};
@@ -74,7 +74,7 @@ ol.format.MVT = function(opt_options) {
this.layers_ = options.layers ? options.layers : null;
};
ol.inherits(ol.format.MVT, ol.format.Feature);
goog.inherits(ol.format.MVT, ol.format.Feature);
/**

View File

@@ -18,6 +18,9 @@ goog.provide('ol.format.ogc.filter.IsNull');
goog.provide('ol.format.ogc.filter.IsBetween');
goog.provide('ol.format.ogc.filter.IsLike');
goog.require('ol.Extent');
goog.require('ol.Object');
/**
* Create a logical `<And>` operator between two filter conditions.
@@ -211,17 +214,20 @@ ol.format.ogc.filter.like = function(propertyName, pattern,
*
* @constructor
* @param {!string} tagName The XML tag name for this filter.
* @struct
* @extends {ol.Object}
* @api
*/
ol.format.ogc.filter.Filter = function(tagName) {
goog.base(this);
/**
* @private
* @type {!string}
*/
this.tagName_ = tagName;
};
goog.inherits(ol.format.ogc.filter.Filter, ol.Object);
/**
* The XML tag name for a filter.
@@ -245,9 +251,9 @@ ol.format.ogc.filter.Filter.prototype.getTagName = function() {
* @extends {ol.format.ogc.filter.Filter}
*/
ol.format.ogc.filter.Logical = function(tagName) {
ol.format.ogc.filter.Filter.call(this, tagName);
goog.base(this, tagName);
};
ol.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
goog.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
/**
@@ -263,7 +269,7 @@ ol.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
*/
ol.format.ogc.filter.LogicalBinary = function(tagName, conditionA, conditionB) {
ol.format.ogc.filter.Logical.call(this, tagName);
goog.base(this, tagName);
/**
* @public
@@ -278,7 +284,7 @@ ol.format.ogc.filter.LogicalBinary = function(tagName, conditionA, conditionB) {
this.conditionB = conditionB;
};
ol.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
goog.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
/**
@@ -292,9 +298,9 @@ ol.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
* @api
*/
ol.format.ogc.filter.And = function(conditionA, conditionB) {
ol.format.ogc.filter.LogicalBinary.call(this, 'And', conditionA, conditionB);
goog.base(this, 'And', conditionA, conditionB);
};
ol.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
goog.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
/**
@@ -308,9 +314,9 @@ ol.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
* @api
*/
ol.format.ogc.filter.Or = function(conditionA, conditionB) {
ol.format.ogc.filter.LogicalBinary.call(this, 'Or', conditionA, conditionB);
goog.base(this, 'Or', conditionA, conditionB);
};
ol.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
goog.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
/**
@@ -324,7 +330,7 @@ ol.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
*/
ol.format.ogc.filter.Not = function(condition) {
ol.format.ogc.filter.Logical.call(this, 'Not');
goog.base(this, 'Not');
/**
* @public
@@ -332,7 +338,7 @@ ol.format.ogc.filter.Not = function(condition) {
*/
this.condition = condition;
};
ol.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
goog.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
// Spatial filters
@@ -353,7 +359,7 @@ ol.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
*/
ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
ol.format.ogc.filter.Filter.call(this, 'BBOX');
goog.base(this, 'BBOX');
/**
* @public
@@ -363,7 +369,7 @@ ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
/**
* @public
* @type {ol.Extent}
* @type {!ol.Extent}
*/
this.extent = extent;
@@ -373,7 +379,7 @@ ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
*/
this.srsName = opt_srsName;
};
ol.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
goog.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
// Property comparison filters
@@ -392,7 +398,7 @@ ol.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
*/
ol.format.ogc.filter.Comparison = function(tagName, propertyName) {
ol.format.ogc.filter.Filter.call(this, tagName);
goog.base(this, tagName);
/**
* @public
@@ -400,7 +406,7 @@ ol.format.ogc.filter.Comparison = function(tagName, propertyName) {
*/
this.propertyName = propertyName;
};
ol.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
goog.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
/**
@@ -419,7 +425,7 @@ ol.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
ol.format.ogc.filter.ComparisonBinary = function(
tagName, propertyName, expression, opt_matchCase) {
ol.format.ogc.filter.Comparison.call(this, tagName, propertyName);
goog.base(this, tagName, propertyName);
/**
* @public
@@ -433,7 +439,7 @@ ol.format.ogc.filter.ComparisonBinary = function(
*/
this.matchCase = opt_matchCase;
};
ol.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparison);
goog.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparison);
/**
@@ -448,9 +454,9 @@ ol.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparis
* @api
*/
ol.format.ogc.filter.EqualTo = function(propertyName, expression, opt_matchCase) {
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
goog.base(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
};
ol.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary);
goog.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary);
/**
@@ -465,9 +471,9 @@ ol.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary)
* @api
*/
ol.format.ogc.filter.NotEqualTo = function(propertyName, expression, opt_matchCase) {
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
goog.base(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
};
ol.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBinary);
goog.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBinary);
/**
@@ -481,9 +487,9 @@ ol.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBina
* @api
*/
ol.format.ogc.filter.LessThan = function(propertyName, expression) {
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression);
goog.base(this, 'PropertyIsLessThan', propertyName, expression);
};
ol.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary);
goog.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary);
/**
@@ -497,9 +503,9 @@ ol.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary
* @api
*/
ol.format.ogc.filter.LessThanOrEqualTo = function(propertyName, expression) {
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
goog.base(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
};
ol.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
goog.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
/**
@@ -513,9 +519,9 @@ ol.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.Compari
* @api
*/
ol.format.ogc.filter.GreaterThan = function(propertyName, expression) {
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression);
goog.base(this, 'PropertyIsGreaterThan', propertyName, expression);
};
ol.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBinary);
goog.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBinary);
/**
@@ -529,9 +535,9 @@ ol.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBin
* @api
*/
ol.format.ogc.filter.GreaterThanOrEqualTo = function(propertyName, expression) {
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
goog.base(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
};
ol.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
goog.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
/**
@@ -544,9 +550,9 @@ ol.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.Comp
* @api
*/
ol.format.ogc.filter.IsNull = function(propertyName) {
ol.format.ogc.filter.Comparison.call(this, 'PropertyIsNull', propertyName);
goog.base(this, 'PropertyIsNull', propertyName);
};
ol.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
goog.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
/**
@@ -561,7 +567,7 @@ ol.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
* @api
*/
ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoundary) {
ol.format.ogc.filter.Comparison.call(this, 'PropertyIsBetween', propertyName);
goog.base(this, 'PropertyIsBetween', propertyName);
/**
* @public
@@ -575,7 +581,7 @@ ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoun
*/
this.upperBoundary = upperBoundary;
};
ol.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison);
goog.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison);
/**
@@ -597,7 +603,7 @@ ol.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison);
*/
ol.format.ogc.filter.IsLike = function(propertyName, pattern,
opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
ol.format.ogc.filter.Comparison.call(this, 'PropertyIsLike', propertyName);
goog.base(this, 'PropertyIsLike', propertyName);
/**
* @public
@@ -629,4 +635,4 @@ ol.format.ogc.filter.IsLike = function(propertyName, pattern,
*/
this.matchCase = opt_matchCase;
};
ol.inherits(ol.format.ogc.filter.IsLike, ol.format.ogc.filter.Comparison);
goog.inherits(ol.format.ogc.filter.IsLike, ol.format.ogc.filter.Comparison);

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