Compare commits
150 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3e15e4394 | ||
|
|
0dbca294b2 | ||
|
|
c74d7171aa | ||
|
|
6ebc67f1c5 | ||
|
|
72568305c0 | ||
|
|
749660dd22 | ||
|
|
ed80d243fb | ||
|
|
0d26c33484 | ||
|
|
1775a5aeea | ||
|
|
f196ed8102 | ||
|
|
c56432cf2e | ||
|
|
17e11fb84a | ||
|
|
4154df9aa8 | ||
|
|
728e1dd1f2 | ||
|
|
6d41e87ff5 | ||
|
|
77e66221c1 | ||
|
|
b562f4d68a | ||
|
|
e7c2d9ab32 | ||
|
|
39de933e64 | ||
|
|
c43740a4ad | ||
|
|
7a43a667ce | ||
|
|
1b662ff048 | ||
|
|
93a98337d8 | ||
|
|
65c8eba59b | ||
|
|
059ac56fef | ||
|
|
64afa2eab5 | ||
|
|
13546d27f2 | ||
|
|
a2326f7180 | ||
|
|
ffe0529df8 | ||
|
|
38f7aef6b0 | ||
|
|
f549f1946c | ||
|
|
449ea370c0 | ||
|
|
bc506389fc | ||
|
|
5d85867fbf | ||
|
|
55edf4003f | ||
|
|
6b465902cd | ||
|
|
9453984f9a | ||
|
|
35129af7f0 | ||
|
|
3726b25ba2 | ||
|
|
7048de8e83 | ||
|
|
4b7cdffaf4 | ||
|
|
14cecb7163 | ||
|
|
29c8af7559 | ||
|
|
b19ac3c26d | ||
|
|
f26bcf5c3e | ||
|
|
e4168e3582 | ||
|
|
dd8dc8ad0f | ||
|
|
b8ce70fbf0 | ||
|
|
e916345e8c | ||
|
|
925a272fb8 | ||
|
|
eaa0d70289 | ||
|
|
030c0dad3d | ||
|
|
0fef14137c | ||
|
|
04287e0fd5 | ||
|
|
ea1c7a6551 | ||
|
|
6da5a1e9f7 | ||
|
|
ec12c34edd | ||
|
|
837c48a2e2 | ||
|
|
04c4b4efc1 | ||
|
|
96a14e0515 | ||
|
|
cd4f1c109b | ||
|
|
609c891524 | ||
|
|
5442c1f587 | ||
|
|
810c655940 | ||
|
|
9d5232d9af | ||
|
|
265068e782 | ||
|
|
44a4fbdda2 | ||
|
|
6902791dc5 | ||
|
|
95a3f42315 | ||
|
|
6fe1a58b26 | ||
|
|
466b02836b | ||
|
|
e5cc971dc9 | ||
|
|
bda673f389 | ||
|
|
fa995cf7f3 | ||
|
|
1a159f3ac4 | ||
|
|
6718fc982e | ||
|
|
2809df86ca | ||
|
|
1d20215bfa | ||
|
|
7d210948e8 | ||
|
|
3c50d12ad9 | ||
|
|
bb32b6ac55 | ||
|
|
103ff01456 | ||
|
|
d26ac55ed0 | ||
|
|
31dcb80725 | ||
|
|
f3acac5259 | ||
|
|
06249be6bd | ||
|
|
400484e663 | ||
|
|
ab4da04312 | ||
|
|
4bf1f56405 | ||
|
|
08f8cd0f16 | ||
|
|
40ead5b329 | ||
|
|
2c29512c80 | ||
|
|
09202cf95d | ||
|
|
e39ea746a7 | ||
|
|
54f7bb6958 | ||
|
|
27853ea7dd | ||
|
|
395f3c0756 | ||
|
|
e63b4d1f48 | ||
|
|
3935b7db24 | ||
|
|
e289bfbb7d | ||
|
|
a598737ec5 | ||
|
|
1f48198e95 | ||
|
|
072728b083 | ||
|
|
abec4f4ba7 | ||
|
|
edb3987054 | ||
|
|
c51fc84b72 | ||
|
|
de9c338fb1 | ||
|
|
26789d91d2 | ||
|
|
aa9dbb984a | ||
|
|
b2120b2bab | ||
|
|
b4b61e737f | ||
|
|
0dca194525 | ||
|
|
9e980663ee | ||
|
|
2ec4969ac7 | ||
|
|
ca07de422c | ||
|
|
eddd006fcf | ||
|
|
9e209a3362 | ||
|
|
30482f023e | ||
|
|
3d8ca68bac | ||
|
|
3b1c76a1da | ||
|
|
578b653c40 | ||
|
|
da5f47999f | ||
|
|
d51fecd827 | ||
|
|
370f810f6b | ||
|
|
d270643ce1 | ||
|
|
1e2ea333cc | ||
|
|
a9df88004c | ||
|
|
f477a6ccb9 | ||
|
|
2305991ee9 | ||
|
|
3bdcdb5937 | ||
|
|
bb8b43abce | ||
|
|
4877a7864c | ||
|
|
1b70931433 | ||
|
|
0acbaa20f9 | ||
|
|
d2c8823359 | ||
|
|
2cac34e938 | ||
|
|
15ede94380 | ||
|
|
bd0140f42d | ||
|
|
f3248e9c19 | ||
|
|
420374294b | ||
|
|
271e7c5bb1 | ||
|
|
b434a30603 | ||
|
|
ec1d21e29a | ||
|
|
4e1decab52 | ||
|
|
92632f1d63 | ||
|
|
2063c1be71 | ||
|
|
77baa67e71 | ||
|
|
f3e6630db3 | ||
|
|
a6a621834f | ||
|
|
4653a01ba4 |
@@ -1,5 +1,44 @@
|
||||
## 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
|
||||
|
||||
107
changelog/v3.17.0.md
Normal file
107
changelog/v3.17.0.md
Normal file
@@ -0,0 +1,107 @@
|
||||
# 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))
|
||||
@@ -24,15 +24,12 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks",
|
||||
"missingProvide",
|
||||
|
||||
@@ -24,15 +24,12 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
|
||||
@@ -11,6 +11,7 @@ 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;
|
||||
@@ -25,11 +26,15 @@ exports.defineTags = function(dictionary) {
|
||||
|
||||
|
||||
/*
|
||||
* Based on @stability annotations, and assuming that items with no @stability
|
||||
* annotation should not be documented, this plugin removes undocumented symbols
|
||||
* Based on @api annotations, and assuming that items with no @api 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;
|
||||
}
|
||||
@@ -71,8 +76,30 @@ function includeAugments(doclet) {
|
||||
}
|
||||
}
|
||||
|
||||
var api = [];
|
||||
var classes = {};
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
@@ -80,6 +107,9 @@ 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);
|
||||
}
|
||||
@@ -120,7 +150,7 @@ exports.handlers = {
|
||||
// constructor from the docs.
|
||||
doclet._hideConstructor = true;
|
||||
includeAugments(doclet);
|
||||
} else if (!doclet._hideConstructor) {
|
||||
} else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
|
||||
// Remove all other undocumented symbols
|
||||
doclet.undocumented = true;
|
||||
}
|
||||
|
||||
@@ -89,10 +89,6 @@ 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);
|
||||
|
||||
@@ -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 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).
|
||||
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).
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ var self = this;
|
||||
<?js
|
||||
item.typedefs.forEach(function (v) {
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && 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 !== 'stable' ? 'unstable' : ''?>">
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && 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 != 'stable' ? 'unstable' : '') ?>">
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability != 'stable') ? 'unstable' : '' ?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
</li>
|
||||
<?js
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
var setter = prop.readonly ? 'no' : 'yes';
|
||||
?>
|
||||
|
||||
<tr class="<?js= prop.stability !== 'stable' ? 'unstable' : '' ?>">
|
||||
<tr class="<?js= (prop.stability && prop.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||
<td class="name"><code><?js= prop.name ?></code></td>
|
||||
<td class="type">
|
||||
<?js if (prop.type && prop.type.names) {?>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
var data = obj;
|
||||
var self = this;
|
||||
|
||||
if (data.stability != 'stable') { ?>
|
||||
if (data.stability && data.stability != 'stable') { ?>
|
||||
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
|
||||
<?js } ?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -15,15 +15,12 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
|
||||
@@ -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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
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 a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
|
||||
With this JavaScript code, a map object is created with an OSM 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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
]
|
||||
```
|
||||
|
||||
@@ -160,7 +160,9 @@ 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",
|
||||
@@ -210,14 +212,15 @@ 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"
|
||||
@@ -230,8 +233,7 @@ Here is a version of `config.json` with more compilation checks enabled:
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unknownDefines"
|
||||
"useOfGoogBase",
|
||||
"unknownDefines",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.ImageArcGISRest');
|
||||
|
||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
@@ -10,10 +10,11 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageArcGISRest({
|
||||
ratio: 1,
|
||||
params: {},
|
||||
url: url
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -22,8 +22,8 @@ var twoPi = 2 * Math.PI;
|
||||
|
||||
/**
|
||||
* Convert an RGB pixel into an HCL pixel.
|
||||
* @param {ol.raster.Pixel} pixel A pixel in RGB space.
|
||||
* @return {ol.raster.Pixel} A pixel in HCL space.
|
||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
||||
* @return {Array.<number>} 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 {ol.raster.Pixel} pixel A pixel in HCL space.
|
||||
* @return {ol.raster.Pixel} A pixel in RGB space.
|
||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
||||
* @return {Array.<number>} A pixel in RGB space.
|
||||
*/
|
||||
function hcl2rgb(pixel) {
|
||||
var h = pixel[0];
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
@@ -12,7 +12,7 @@ var map = new ol.Map({
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var source = new ol.source.Vector({wrapX: false});
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -13,6 +13,12 @@ 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
|
||||
@@ -21,23 +27,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 + 2, size + 2], pixelRatio: size / 10});
|
||||
{size: [size, size], pixelRatio: 1});
|
||||
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: 1})
|
||||
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
||||
}));
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon(
|
||||
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)]));
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Icon({
|
||||
img: canvas,
|
||||
imgSize: [canvas.width, canvas.height],
|
||||
imgSize: [size, size],
|
||||
rotation: 1.2
|
||||
})
|
||||
});
|
||||
|
||||
@@ -59,7 +59,8 @@ var element = document.getElementById('popup');
|
||||
var popup = new ol.Overlay({
|
||||
element: element,
|
||||
positioning: 'bottom-center',
|
||||
stopEvent: false
|
||||
stopEvent: false,
|
||||
offset: [0, -50]
|
||||
});
|
||||
map.addOverlay(popup);
|
||||
|
||||
@@ -70,7 +71,8 @@ map.on('click', function(evt) {
|
||||
return feature;
|
||||
});
|
||||
if (feature) {
|
||||
popup.setPosition(evt.coordinate);
|
||||
var coordinates = feature.getGeometry().getCoordinates();
|
||||
popup.setPosition(coordinates);
|
||||
$(element).popover({
|
||||
'placement': 'top',
|
||||
'html': true,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
@@ -39,9 +39,7 @@ var vectorLayer = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var rasterLayer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({
|
||||
layer: 'osm'
|
||||
})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -4,13 +4,12 @@ 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 below
|
||||
to limit rendering based on an extent.
|
||||
modify the extent of the overlay layer. Use the controls above
|
||||
to limit rendering based on an extent (approximate country bounds).
|
||||
tags: "extent, tilejson"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
@@ -9,26 +9,25 @@ function transform(extent) {
|
||||
}
|
||||
|
||||
var extents = {
|
||||
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])
|
||||
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])
|
||||
};
|
||||
|
||||
var base = new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||
'mapbox.world-black.json',
|
||||
'mapbox.world-light.json',
|
||||
crossOrigin: 'anonymous'
|
||||
})
|
||||
});
|
||||
|
||||
var overlay = new ol.layer.Tile({
|
||||
extent: extents.northwest,
|
||||
extent: extents.India,
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||
'mapbox.world-glass.json',
|
||||
'mapbox.world-black.json',
|
||||
crossOrigin: 'anonymous'
|
||||
})
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ resources:
|
||||
<div id="layertree">
|
||||
<h5>Click on layer nodes below to change their properties.</h5>
|
||||
<ul>
|
||||
<li><span>OpenAerial layer</span>
|
||||
<li><span>OSM layer</span>
|
||||
<fieldset id="layer0">
|
||||
<label class="checkbox" for="visible0">
|
||||
<input id="visible0" class="visible" type="checkbox"/>visibility
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileJSON');
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}), new ol.layer.Group({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
var source = new ol.source.MapQuest({layer: 'sat'});
|
||||
var source = new ol.source.OSM();
|
||||
|
||||
var layer = new ol.layer.Tile();
|
||||
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Icon');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var source = new ol.source.Vector();
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
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>
|
||||
@@ -1,56 +0,0 @@
|
||||
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();
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var source = new ol.source.Vector();
|
||||
|
||||
@@ -6,14 +6,12 @@ goog.require('ol.interaction.Modify');
|
||||
goog.require('ol.interaction.Select');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({
|
||||
layer: 'sat'
|
||||
})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -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, mapquest, openaerial"
|
||||
tags: "overlay, popup, bootstrap, popover"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var layer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -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, mapquest, openaerial"
|
||||
tags: "overlay, popup"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="popup" class="ol-popup">
|
||||
|
||||
@@ -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 {ol.raster.Pixel} pixel An array of [R, G, B, A] values.
|
||||
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
|
||||
* @return {number} The VGI value for the given pixel.
|
||||
*/
|
||||
function vgi(pixel) {
|
||||
|
||||
@@ -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]]));
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Reprojection with EPSG.io Search
|
||||
shortdesc: Demonstrates client-side raster reprojection of MapQuest OSM to arbitrary projection
|
||||
shortdesc: Demonstrates client-side raster reprojection of OSM to arbitrary projection
|
||||
docs: >
|
||||
This example shows client-side raster reprojection capabilities from
|
||||
MapQuest OSM (EPSG:3857) to arbitrary projection by searching
|
||||
OSM (EPSG:3857) to arbitrary projection by searching
|
||||
in <a href="http://epsg.io/">EPSG.io</a> database.
|
||||
tags: "reprojection, projection, proj4js, mapquest, epsg.io"
|
||||
tags: "reprojection, projection, proj4js, epsg.io"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileImage');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -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, mapquest, image, imagestatic"
|
||||
tags: "reprojection, projection, proj4js, image, imagestatic"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
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.MapQuest({layer: 'osm'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageStatic({
|
||||
|
||||
@@ -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, mapquest, wms, wmts, hidpi"
|
||||
tags: "reprojection, projection, proj4js, osm, 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="mapquest">MapQuest (EPSG:3857)</option>
|
||||
<option value="osm">OSM (EPSG:3857)</option>
|
||||
<option value="wms4326">WMS (EPSG:4326)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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['mapquest'] = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
layers['osm'] = new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
layers['wms4326'] = new ol.layer.Tile({
|
||||
@@ -146,7 +146,7 @@ layers['states'] = new ol.layer.Tile({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
layers['mapquest'],
|
||||
layers['osm'],
|
||||
layers['bng']
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -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 a MapQuest background.
|
||||
tags: "transparent, mapquest, tilejson"
|
||||
This example will display a tiled MaxBox layer semi-transparently over an OSM background.
|
||||
tags: "transparent, osm, tilejson"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileJSON');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map1 = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: 'dom',
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
@@ -44,9 +44,7 @@ var vectorLayer = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var rasterLayer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({
|
||||
layer: 'osm'
|
||||
})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'osm'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
vectorPolygons,
|
||||
vectorLines,
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
vectorLayer
|
||||
],
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileWMS');
|
||||
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileWMS');
|
||||
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
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.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||
|
||||
@@ -30,7 +30,6 @@ fetch(capabilitiesUrl).then(function(response) {
|
||||
var options = ol.source.WMTS.optionsFromCapabilities(result, {
|
||||
layer: layer,
|
||||
matrixSet: 'google3857',
|
||||
requestEncoding: 'REST',
|
||||
style: 'normal'
|
||||
});
|
||||
options.tilePixelRatio = tilePixelRatio;
|
||||
|
||||
@@ -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.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,7 +14,7 @@ goog.require('ol.source.MapQuest');
|
||||
var createMap = function(divId) {
|
||||
var source, layer, map, zoomslider;
|
||||
|
||||
source = new ol.source.MapQuest({layer: 'sat'});
|
||||
source = new ol.source.OSM();
|
||||
layer = new ol.layer.Tile({
|
||||
source: source
|
||||
});
|
||||
|
||||
@@ -92,9 +92,9 @@ oli.ModifyEvent.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.MapBrowserPointerEvent}
|
||||
* @type {ol.MapBrowserEvent}
|
||||
*/
|
||||
oli.ModifyEvent.prototype.mapBrowserPointerEvent;
|
||||
oli.ModifyEvent.prototype.mapBrowserEvent;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
345
externs/olx.js
345
externs/olx.js
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openlayers",
|
||||
"version": "3.16.0",
|
||||
"version": "3.17.0",
|
||||
"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.13.1",
|
||||
"closure-util": "1.15.0",
|
||||
"derequire": "2.0.3",
|
||||
"fs-extra": "0.30.0",
|
||||
"glob": "6.0.4",
|
||||
"glob": "7.0.5",
|
||||
"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": "1.3.5",
|
||||
"pbf": "2.0.1",
|
||||
"pixelworks": "1.1.0",
|
||||
"rbush": "1.4.3",
|
||||
"rbush": "2.0.1",
|
||||
"temp": "0.8.3",
|
||||
"vector-tile": "1.2.1",
|
||||
"walk": "2.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-css": "3.4.12",
|
||||
"clean-css": "3.4.18",
|
||||
"coveralls": "2.11.9",
|
||||
"debounce": "^1.0.0",
|
||||
"eslint": "2.10.2",
|
||||
"eslint-config-openlayers": "4.1.0",
|
||||
"eslint": "2.13.1",
|
||||
"eslint-config-openlayers": "5.0.0",
|
||||
"expect.js": "0.3.1",
|
||||
"gaze": "^1.0.0",
|
||||
"istanbul": "0.4.3",
|
||||
"istanbul": "0.4.4",
|
||||
"jquery": "2.2.4",
|
||||
"mocha": "2.4.5",
|
||||
"mocha": "2.5.3",
|
||||
"mocha-phantomjs-core": "^1.3.0",
|
||||
"mustache": "2.2.1",
|
||||
"phantomjs-prebuilt": "2.1.7",
|
||||
"proj4": "2.3.14",
|
||||
"resemblejs": "2.2.0",
|
||||
"resemblejs": "2.2.1",
|
||||
"sinon": "1.17.4",
|
||||
"slimerjs": "0.906.1"
|
||||
"slimerjs": "0.906.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "openlayers",
|
||||
@@ -86,7 +86,10 @@
|
||||
}
|
||||
},
|
||||
"ext": [
|
||||
"rbush",
|
||||
{
|
||||
"module": "rbush",
|
||||
"browserify": true
|
||||
},
|
||||
{
|
||||
"module": "pbf",
|
||||
"browserify": true
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ ol.CollectionEventType = {
|
||||
*/
|
||||
ol.CollectionEvent = function(type, opt_element, opt_target) {
|
||||
|
||||
goog.base(this, type, opt_target);
|
||||
ol.events.Event.call(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;
|
||||
|
||||
};
|
||||
goog.inherits(ol.CollectionEvent, ol.events.Event);
|
||||
ol.inherits(ol.CollectionEvent, ol.events.Event);
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ ol.CollectionProperty = {
|
||||
*/
|
||||
ol.Collection = function(opt_array) {
|
||||
|
||||
goog.base(this);
|
||||
ol.Object.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -93,7 +93,7 @@ ol.Collection = function(opt_array) {
|
||||
this.updateLength_();
|
||||
|
||||
};
|
||||
goog.inherits(ol.Collection, ol.Object);
|
||||
ol.inherits(ol.Collection, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
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');
|
||||
@@ -44,7 +43,7 @@ ol.control.Attribution = function(opt_options) {
|
||||
this.logoLi_ = document.createElement('LI');
|
||||
|
||||
this.ulElement_.appendChild(this.logoLi_);
|
||||
goog.style.setElementShown(this.logoLi_, false);
|
||||
this.logoLi_.style.display = 'none';
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -69,30 +68,37 @@ ol.control.Attribution = function(opt_options) {
|
||||
|
||||
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00BB';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.collapseLabel_ = typeof collapseLabel === 'string' ?
|
||||
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
||||
collapseLabel;
|
||||
if (typeof collapseLabel === 'string') {
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.collapseLabel_ = document.createElement('span');
|
||||
this.collapseLabel_.textContent = collapseLabel;
|
||||
} else {
|
||||
this.collapseLabel_ = collapseLabel;
|
||||
}
|
||||
|
||||
var label = options.label !== undefined ? options.label : 'i';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.label_ = typeof label === 'string' ?
|
||||
goog.dom.createDom('SPAN', {}, label) :
|
||||
label;
|
||||
if (typeof label === 'string') {
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.label_ = document.createElement('span');
|
||||
this.label_.textContent = label;
|
||||
} else {
|
||||
this.label_ = label;
|
||||
}
|
||||
|
||||
|
||||
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
|
||||
this.collapseLabel_ : this.label_;
|
||||
var button = goog.dom.createDom('BUTTON', {
|
||||
'type': 'button',
|
||||
'title': tipLabel
|
||||
}, activeLabel);
|
||||
var button = document.createElement('button');
|
||||
button.setAttribute('type', 'button');
|
||||
button.title = tipLabel;
|
||||
button.appendChild(activeLabel);
|
||||
|
||||
ol.events.listen(button, ol.events.EventType.CLICK, this.handleClick_, this);
|
||||
|
||||
@@ -100,12 +106,14 @@ ol.control.Attribution = function(opt_options) {
|
||||
ol.css.CLASS_CONTROL +
|
||||
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
|
||||
(this.collapsible_ ? '' : ' ol-uncollapsible');
|
||||
var element = goog.dom.createDom('DIV',
|
||||
cssClasses, this.ulElement_, button);
|
||||
var element = document.createElement('div');
|
||||
element.className = cssClasses;
|
||||
element.appendChild(this.ulElement_);
|
||||
element.appendChild(button);
|
||||
|
||||
var render = options.render ? options.render : ol.control.Attribution.render;
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
render: render,
|
||||
target: options.target
|
||||
@@ -136,7 +144,7 @@ ol.control.Attribution = function(opt_options) {
|
||||
this.logoElements_ = {};
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.Attribution, ol.control.Control);
|
||||
ol.inherits(ol.control.Attribution, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
@@ -214,7 +222,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
|
||||
if (!frameState) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.setElementShown(this.element, false);
|
||||
this.element.style.display = 'none';
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -230,20 +238,18 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
for (attributionKey in this.attributionElements_) {
|
||||
if (attributionKey in visibleAttributions) {
|
||||
if (!this.attributionElementRenderedVisible_[attributionKey]) {
|
||||
goog.style.setElementShown(
|
||||
this.attributionElements_[attributionKey], true);
|
||||
this.attributionElements_[attributionKey].style.display = '';
|
||||
this.attributionElementRenderedVisible_[attributionKey] = true;
|
||||
}
|
||||
delete visibleAttributions[attributionKey];
|
||||
} else if (attributionKey in hiddenAttributions) {
|
||||
if (this.attributionElementRenderedVisible_[attributionKey]) {
|
||||
goog.style.setElementShown(
|
||||
this.attributionElements_[attributionKey], false);
|
||||
this.attributionElements_[attributionKey].style.display = 'none';
|
||||
delete this.attributionElementRenderedVisible_[attributionKey];
|
||||
}
|
||||
delete hiddenAttributions[attributionKey];
|
||||
} else {
|
||||
goog.dom.removeNode(this.attributionElements_[attributionKey]);
|
||||
ol.dom.removeNode(this.attributionElements_[attributionKey]);
|
||||
delete this.attributionElements_[attributionKey];
|
||||
delete this.attributionElementRenderedVisible_[attributionKey];
|
||||
}
|
||||
@@ -260,7 +266,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
attributionElement = document.createElement('LI');
|
||||
attributionElement.innerHTML =
|
||||
hiddenAttributions[attributionKey].getHTML();
|
||||
goog.style.setElementShown(attributionElement, false);
|
||||
attributionElement.style.display = 'none';
|
||||
this.ulElement_.appendChild(attributionElement);
|
||||
this.attributionElements_[attributionKey] = attributionElement;
|
||||
}
|
||||
@@ -269,7 +275,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
!ol.object.isEmpty(this.attributionElementRenderedVisible_) ||
|
||||
!ol.object.isEmpty(frameState.logos);
|
||||
if (this.renderedVisible_ != renderVisible) {
|
||||
goog.style.setElementShown(this.element, renderVisible);
|
||||
this.element.style.display = renderVisible ? '' : 'none';
|
||||
this.renderedVisible_ = renderVisible;
|
||||
}
|
||||
if (renderVisible &&
|
||||
@@ -296,7 +302,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
||||
|
||||
for (logo in logoElements) {
|
||||
if (!(logo in logos)) {
|
||||
goog.dom.removeNode(logoElements[logo]);
|
||||
ol.dom.removeNode(logoElements[logo]);
|
||||
delete logoElements[logo];
|
||||
}
|
||||
}
|
||||
@@ -314,9 +320,8 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
||||
if (logoValue === '') {
|
||||
logoElement = image;
|
||||
} else {
|
||||
logoElement = goog.dom.createDom('A', {
|
||||
'href': logoValue
|
||||
});
|
||||
logoElement = document.createElement('a');
|
||||
logoElement.href = logoValue;
|
||||
logoElement.appendChild(image);
|
||||
}
|
||||
this.logoLi_.appendChild(logoElement);
|
||||
@@ -324,7 +329,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
||||
}
|
||||
}
|
||||
|
||||
goog.style.setElementShown(this.logoLi_, !ol.object.isEmpty(logos));
|
||||
this.logoLi_.style.display = !ol.object.isEmpty(logos) ? '' : 'none';
|
||||
|
||||
};
|
||||
|
||||
@@ -345,9 +350,9 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
|
||||
ol.control.Attribution.prototype.handleToggle_ = function() {
|
||||
this.element.classList.toggle('ol-collapsed');
|
||||
if (this.collapsed_) {
|
||||
goog.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||
ol.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||
} else {
|
||||
goog.dom.replaceNode(this.label_, this.collapseLabel_);
|
||||
ol.dom.replaceNode(this.label_, this.collapseLabel_);
|
||||
}
|
||||
this.collapsed_ = !this.collapsed_;
|
||||
};
|
||||
|
||||
@@ -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.Object');
|
||||
*/
|
||||
ol.control.Control = function(options) {
|
||||
|
||||
goog.base(this);
|
||||
ol.Object.call(this);
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -60,7 +60,7 @@ ol.control.Control = function(options) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Array.<ol.events.Key>}
|
||||
* @type {!Array.<ol.EventsKey>}
|
||||
*/
|
||||
this.listenerKeys = [];
|
||||
|
||||
@@ -74,15 +74,15 @@ ol.control.Control = function(options) {
|
||||
}
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.Control, ol.Object);
|
||||
ol.inherits(ol.control.Control, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.control.Control.prototype.disposeInternal = function() {
|
||||
goog.dom.removeNode(this.element);
|
||||
goog.base(this, 'disposeInternal');
|
||||
ol.dom.removeNode(this.element);
|
||||
ol.Object.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ ol.control.Control.prototype.getMap = function() {
|
||||
*/
|
||||
ol.control.Control.prototype.setMap = function(map) {
|
||||
if (this.map_) {
|
||||
goog.dom.removeNode(this.element);
|
||||
ol.dom.removeNode(this.element);
|
||||
}
|
||||
for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
|
||||
ol.events.unlistenByKey(this.listenerKeys[i]);
|
||||
@@ -135,5 +135,7 @@ ol.control.Control.prototype.setMap = function(map) {
|
||||
* @api
|
||||
*/
|
||||
ol.control.Control.prototype.setTarget = function(target) {
|
||||
this.target_ = goog.dom.getElement(target);
|
||||
this.target_ = typeof target === 'string' ?
|
||||
document.getElementById(target) :
|
||||
target;
|
||||
};
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
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');
|
||||
|
||||
|
||||
@@ -58,21 +56,23 @@ ol.control.FullScreen = function(opt_options) {
|
||||
document.createTextNode(labelActive) : labelActive;
|
||||
|
||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
||||
var button = goog.dom.createDom('BUTTON', {
|
||||
'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(),
|
||||
'type': 'button',
|
||||
'title': tipLabel
|
||||
}, this.labelNode_);
|
||||
var button = document.createElement('button');
|
||||
button.className = this.cssClassName_ + '-' + ol.control.FullScreen.isFullScreen();
|
||||
button.setAttribute('type', 'button');
|
||||
button.title = tipLabel;
|
||||
button.appendChild(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 + ' ' +
|
||||
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
|
||||
var element = goog.dom.createDom('DIV', cssClasses, button);
|
||||
(!ol.control.FullScreen.isFullScreenSupported() ? ol.css.CLASS_UNSUPPORTED : '');
|
||||
var element = document.createElement('div');
|
||||
element.className = cssClasses;
|
||||
element.appendChild(button);
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
target: options.target
|
||||
});
|
||||
@@ -90,7 +90,7 @@ ol.control.FullScreen = function(opt_options) {
|
||||
this.source_ = options.source;
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.FullScreen, ol.control.Control);
|
||||
ol.inherits(ol.control.FullScreen, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
@@ -107,23 +107,30 @@ ol.control.FullScreen.prototype.handleClick_ = function(event) {
|
||||
* @private
|
||||
*/
|
||||
ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
||||
if (!goog.dom.fullscreen.isSupported()) {
|
||||
if (!ol.control.FullScreen.isFullScreenSupported()) {
|
||||
return;
|
||||
}
|
||||
var map = this.getMap();
|
||||
if (!map) {
|
||||
return;
|
||||
}
|
||||
if (goog.dom.fullscreen.isFullScreen()) {
|
||||
goog.dom.fullscreen.exitFullScreen();
|
||||
if (ol.control.FullScreen.isFullScreen()) {
|
||||
ol.control.FullScreen.exitFullScreen();
|
||||
} else {
|
||||
var element = this.source_ ?
|
||||
goog.dom.getElement(this.source_) : map.getTargetElement();
|
||||
var element;
|
||||
if (this.source_) {
|
||||
element = typeof this.source_ === 'string' ?
|
||||
document.getElementById(this.source_) :
|
||||
this.source_;
|
||||
} else {
|
||||
element = map.getTargetElement();
|
||||
}
|
||||
goog.asserts.assert(element, 'element should be defined');
|
||||
if (this.keys_) {
|
||||
goog.dom.fullscreen.requestFullScreenWithKeys(element);
|
||||
ol.control.FullScreen.requestFullScreenWithKeys(element);
|
||||
|
||||
} else {
|
||||
goog.dom.fullscreen.requestFullScreen(element);
|
||||
ol.control.FullScreen.requestFullScreen(element);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -135,12 +142,12 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
||||
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
||||
var button = this.element.firstElementChild;
|
||||
var map = this.getMap();
|
||||
if (goog.dom.fullscreen.isFullScreen()) {
|
||||
if (ol.control.FullScreen.isFullScreen()) {
|
||||
button.className = this.cssClassName_ + '-true';
|
||||
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
||||
ol.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
||||
} else {
|
||||
button.className = this.cssClassName_ + '-false';
|
||||
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
||||
ol.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
||||
}
|
||||
if (map) {
|
||||
map.updateSize();
|
||||
@@ -153,11 +160,96 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
||||
* @api stable
|
||||
*/
|
||||
ol.control.FullScreen.prototype.setMap = function(map) {
|
||||
goog.base(this, 'setMap', map);
|
||||
ol.control.Control.prototype.setMap.call(this, map);
|
||||
if (map) {
|
||||
this.listenerKeys.push(
|
||||
ol.events.listen(ol.global.document, goog.dom.fullscreen.EventType.CHANGE,
|
||||
ol.events.listen(ol.global.document, ol.control.FullScreen.CHANGETYPE,
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
ol.control.FullScreen.CHANGETYPE = (function() {
|
||||
var body = document.body;
|
||||
if (body.webkitRequestFullscreen) {
|
||||
return 'webkitfullscreenchange';
|
||||
} else if (body.mozRequestFullScreen) {
|
||||
return 'mozfullscreenchange';
|
||||
} else if (body.msRequestFullscreen) {
|
||||
return 'MSFullscreenChange';
|
||||
} else if (body.requestFullscreen) {
|
||||
return 'fullscreenchange';
|
||||
}
|
||||
return undefined;
|
||||
})();
|
||||
|
||||
@@ -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;
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
render: render,
|
||||
target: options.target
|
||||
@@ -90,7 +90,7 @@ ol.control.MousePosition = function(opt_options) {
|
||||
this.lastMouseMovePixel_ = null;
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.MousePosition, ol.control.Control);
|
||||
ol.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) {
|
||||
goog.base(this, 'setMap', map);
|
||||
ol.control.Control.prototype.setMap.call(this, map);
|
||||
if (map) {
|
||||
var viewport = map.getViewport();
|
||||
this.listenerKeys.push(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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');
|
||||
@@ -17,6 +16,7 @@ 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,30 +55,37 @@ ol.control.OverviewMap = function(opt_options) {
|
||||
|
||||
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00AB';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.collapseLabel_ = typeof collapseLabel === 'string' ?
|
||||
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
||||
collapseLabel;
|
||||
if (typeof collapseLabel === 'string') {
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.collapseLabel_ = document.createElement('span');
|
||||
this.collapseLabel_.textContent = collapseLabel;
|
||||
} else {
|
||||
this.collapseLabel_ = collapseLabel;
|
||||
}
|
||||
|
||||
var label = options.label !== undefined ? options.label : '\u00BB';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.label_ = typeof label === 'string' ?
|
||||
goog.dom.createDom('SPAN', {}, label) :
|
||||
label;
|
||||
|
||||
if (typeof label === 'string') {
|
||||
/**
|
||||
* @private
|
||||
* @type {Node}
|
||||
*/
|
||||
this.label_ = document.createElement('span');
|
||||
this.label_.textContent = label;
|
||||
} else {
|
||||
this.label_ = label;
|
||||
}
|
||||
|
||||
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
|
||||
this.collapseLabel_ : this.label_;
|
||||
var button = goog.dom.createDom('BUTTON', {
|
||||
'type': 'button',
|
||||
'title': tipLabel
|
||||
}, activeLabel);
|
||||
var button = document.createElement('button');
|
||||
button.setAttribute('type', 'button');
|
||||
button.title = tipLabel;
|
||||
button.appendChild(activeLabel);
|
||||
|
||||
ol.events.listen(button, ol.events.EventType.CLICK,
|
||||
this.handleClick_, this);
|
||||
@@ -127,18 +134,20 @@ ol.control.OverviewMap = function(opt_options) {
|
||||
ol.css.CLASS_CONTROL +
|
||||
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
|
||||
(this.collapsible_ ? '' : ' ol-uncollapsible');
|
||||
var element = goog.dom.createDom('DIV',
|
||||
cssClasses, ovmapDiv, button);
|
||||
var element = document.createElement('div');
|
||||
element.className = cssClasses;
|
||||
element.appendChild(ovmapDiv);
|
||||
element.appendChild(button);
|
||||
|
||||
var render = options.render ? options.render : ol.control.OverviewMap.render;
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
render: render,
|
||||
target: options.target
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.control.OverviewMap, ol.control.Control);
|
||||
ol.inherits(ol.control.OverviewMap, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
@@ -156,7 +165,7 @@ ol.control.OverviewMap.prototype.setMap = function(map) {
|
||||
this.unbindView_(oldView);
|
||||
}
|
||||
}
|
||||
goog.base(this, 'setMap', map);
|
||||
ol.control.Control.prototype.setMap.call(this, map);
|
||||
|
||||
if (map) {
|
||||
this.listenerKeys.push(ol.events.listen(
|
||||
@@ -445,9 +454,9 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
|
||||
ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
||||
this.element.classList.toggle('ol-collapsed');
|
||||
if (this.collapsed_) {
|
||||
goog.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||
ol.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||
} else {
|
||||
goog.dom.replaceNode(this.label_, this.collapseLabel_);
|
||||
ol.dom.replaceNode(this.label_, this.collapseLabel_);
|
||||
}
|
||||
this.collapsed_ = !this.collapsed_;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
goog.provide('ol.control.Rotate');
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol');
|
||||
@@ -36,8 +35,9 @@ ol.control.Rotate = function(opt_options) {
|
||||
this.label_ = null;
|
||||
|
||||
if (typeof label === 'string') {
|
||||
this.label_ = goog.dom.createDom('SPAN',
|
||||
'ol-compass', label);
|
||||
this.label_ = document.createElement('span');
|
||||
this.label_.className = 'ol-compass';
|
||||
this.label_.textContent = label;
|
||||
} else {
|
||||
this.label_ = label;
|
||||
this.label_.classList.add('ol-compass');
|
||||
@@ -45,24 +45,26 @@ ol.control.Rotate = function(opt_options) {
|
||||
|
||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
|
||||
|
||||
var button = goog.dom.createDom('BUTTON', {
|
||||
'class': className + '-reset',
|
||||
'type' : 'button',
|
||||
'title': tipLabel
|
||||
}, this.label_);
|
||||
var button = document.createElement('button');
|
||||
button.className = className + '-reset';
|
||||
button.setAttribute('type', 'button');
|
||||
button.title = tipLabel;
|
||||
button.appendChild(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 = goog.dom.createDom('DIV', cssClasses, button);
|
||||
var element = document.createElement('div');
|
||||
element.className = cssClasses;
|
||||
element.appendChild(button);
|
||||
|
||||
var render = options.render ? options.render : ol.control.Rotate.render;
|
||||
|
||||
this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
render: render,
|
||||
target: options.target
|
||||
@@ -91,7 +93,7 @@ ol.control.Rotate = function(opt_options) {
|
||||
}
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.Rotate, ol.control.Control);
|
||||
ol.inherits(ol.control.Rotate, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
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');
|
||||
@@ -25,7 +22,6 @@ 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',
|
||||
@@ -103,7 +99,7 @@ ol.control.ScaleLine = function(opt_options) {
|
||||
|
||||
var render = options.render ? options.render : ol.control.ScaleLine.render;
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: this.element_,
|
||||
render: render,
|
||||
target: options.target
|
||||
@@ -117,7 +113,7 @@ ol.control.ScaleLine = function(opt_options) {
|
||||
ol.control.ScaleLineUnits.METRIC);
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.ScaleLine, ol.control.Control);
|
||||
ol.inherits(ol.control.ScaleLine, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
@@ -184,7 +180,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
|
||||
if (!viewState) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.setElementShown(this.element_, false);
|
||||
this.element_.style.display = 'none';
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -259,7 +255,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
Math.pow(10, Math.floor(i / 3));
|
||||
width = Math.round(count / pointResolution);
|
||||
if (isNaN(width)) {
|
||||
goog.style.setElementShown(this.element_, false);
|
||||
this.element_.style.display = 'none';
|
||||
this.renderedVisible_ = false;
|
||||
return;
|
||||
} else if (width >= this.minWidth_) {
|
||||
@@ -280,7 +276,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
}
|
||||
|
||||
if (!this.renderedVisible_) {
|
||||
goog.style.setElementShown(this.element_, true);
|
||||
this.element_.style.display = '';
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
goog.provide('ol.control.Zoom');
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.animation');
|
||||
@@ -36,29 +35,36 @@ ol.control.Zoom = function(opt_options) {
|
||||
var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?
|
||||
options.zoomOutTipLabel : 'Zoom out';
|
||||
|
||||
var inElement = goog.dom.createDom('BUTTON', {
|
||||
'class': className + '-in',
|
||||
'type' : 'button',
|
||||
'title': zoomInTipLabel
|
||||
}, zoomInLabel);
|
||||
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
|
||||
);
|
||||
|
||||
ol.events.listen(inElement, ol.events.EventType.CLICK,
|
||||
ol.control.Zoom.prototype.handleClick_.bind(this, delta));
|
||||
|
||||
var outElement = goog.dom.createDom('BUTTON', {
|
||||
'class': className + '-out',
|
||||
'type' : 'button',
|
||||
'title': zoomOutTipLabel
|
||||
}, zoomOutLabel);
|
||||
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
|
||||
);
|
||||
|
||||
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 = goog.dom.createDom('DIV', cssClasses, inElement, outElement);
|
||||
var element = document.createElement('div');
|
||||
element.className = cssClasses;
|
||||
element.appendChild(inElement);
|
||||
element.appendChild(outElement);
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
target: options.target
|
||||
});
|
||||
@@ -70,7 +76,7 @@ ol.control.Zoom = function(opt_options) {
|
||||
this.duration_ = options.duration !== undefined ? options.duration : 250;
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.Zoom, ol.control.Control);
|
||||
ol.inherits(ol.control.Zoom, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
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');
|
||||
@@ -58,7 +56,7 @@ ol.control.ZoomSlider = function(opt_options) {
|
||||
this.dragging_;
|
||||
|
||||
/**
|
||||
* @type {!Array.<ol.events.Key>}
|
||||
* @type {!Array.<ol.EventsKey>}
|
||||
* @private
|
||||
*/
|
||||
this.dragListenerKeys_ = [];
|
||||
@@ -109,14 +107,12 @@ 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 = 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);
|
||||
|
||||
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);
|
||||
/**
|
||||
* @type {ol.pointer.PointerEventHandler}
|
||||
* @private
|
||||
@@ -137,12 +133,12 @@ ol.control.ZoomSlider = function(opt_options) {
|
||||
|
||||
var render = options.render ? options.render : ol.control.ZoomSlider.render;
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: containerElement,
|
||||
render: render
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
|
||||
ol.inherits(ol.control.ZoomSlider, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
@@ -150,7 +146,7 @@ goog.inherits(ol.control.ZoomSlider, ol.control.Control);
|
||||
*/
|
||||
ol.control.ZoomSlider.prototype.disposeInternal = function() {
|
||||
this.dragger_.dispose();
|
||||
goog.base(this, 'disposeInternal');
|
||||
ol.control.Control.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
@@ -169,7 +165,7 @@ ol.control.ZoomSlider.direction = {
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.control.ZoomSlider.prototype.setMap = function(map) {
|
||||
goog.base(this, 'setMap', map);
|
||||
ol.control.Control.prototype.setMap.call(this, map);
|
||||
if (map) {
|
||||
map.render();
|
||||
}
|
||||
@@ -185,15 +181,18 @@ ol.control.ZoomSlider.prototype.setMap = function(map) {
|
||||
*/
|
||||
ol.control.ZoomSlider.prototype.initSlider_ = function() {
|
||||
var container = this.element;
|
||||
var containerSize = goog.style.getSize(container);
|
||||
var containerSize = {
|
||||
width: container.offsetWidth, height: container.offsetHeight
|
||||
};
|
||||
|
||||
var thumb = container.firstElementChild;
|
||||
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;
|
||||
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']);
|
||||
this.thumbSize_ = [thumbWidth, thumbHeight];
|
||||
|
||||
if (containerSize.width > containerSize.height) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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');
|
||||
@@ -33,24 +32,28 @@ 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 = goog.dom.createDom('BUTTON', {
|
||||
'type': 'button',
|
||||
'title': tipLabel
|
||||
}, label);
|
||||
var button = document.createElement('button');
|
||||
button.setAttribute('type', 'button');
|
||||
button.title = tipLabel;
|
||||
button.appendChild(
|
||||
typeof label === 'string' ? document.createTextNode(label) : 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 = goog.dom.createDom('DIV', cssClasses, button);
|
||||
var element = document.createElement('div');
|
||||
element.className = cssClasses;
|
||||
element.appendChild(button);
|
||||
|
||||
goog.base(this, {
|
||||
ol.control.Control.call(this, {
|
||||
element: element,
|
||||
target: options.target
|
||||
});
|
||||
};
|
||||
goog.inherits(ol.control.ZoomToExtent, ol.control.Control);
|
||||
ol.inherits(ol.control.ZoomToExtent, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
goog.provide('ol.DeviceOrientation');
|
||||
goog.provide('ol.DeviceOrientationProperty');
|
||||
|
||||
goog.require('ol.events');
|
||||
goog.require('ol');
|
||||
@@ -77,13 +76,13 @@ ol.DeviceOrientationProperty = {
|
||||
*/
|
||||
ol.DeviceOrientation = function(opt_options) {
|
||||
|
||||
goog.base(this);
|
||||
ol.Object.call(this);
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?ol.events.Key}
|
||||
* @type {?ol.EventsKey}
|
||||
*/
|
||||
this.listenerKey_ = null;
|
||||
|
||||
@@ -94,7 +93,7 @@ ol.DeviceOrientation = function(opt_options) {
|
||||
this.setTracking(options.tracking !== undefined ? options.tracking : false);
|
||||
|
||||
};
|
||||
goog.inherits(ol.DeviceOrientation, ol.Object);
|
||||
ol.inherits(ol.DeviceOrientation, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
@@ -102,7 +101,7 @@ goog.inherits(ol.DeviceOrientation, ol.Object);
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.disposeInternal = function() {
|
||||
this.setTracking(false);
|
||||
goog.base(this, 'disposeInternal');
|
||||
ol.Object.prototype.disposeInternal.call(this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -213,3 +213,31 @@ 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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,7 +3,6 @@ goog.provide('ol.events.EventType');
|
||||
goog.provide('ol.events.KeyCode');
|
||||
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.events.EventTargetLike');
|
||||
|
||||
|
||||
/**
|
||||
@@ -63,8 +62,8 @@ ol.events.LISTENER_MAP_PROP_ = 'olm_' + ((Math.random() * 1e4) | 0);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.events.Key} listenerObj Listener object.
|
||||
* @return {ol.events.ListenerFunctionType} Bound listener.
|
||||
* @param {ol.EventsKey} listenerObj Listener object.
|
||||
* @return {ol.EventsListenerFunctionType} Bound listener.
|
||||
*/
|
||||
ol.events.bindListener_ = function(listenerObj) {
|
||||
var boundListener = function(evt) {
|
||||
@@ -74,22 +73,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.events.Key} in the given listener
|
||||
* Finds the matching {@link ol.EventsKey} in the given listener
|
||||
* array.
|
||||
*
|
||||
* @param {!Array<!ol.events.Key>} listeners Array of listeners.
|
||||
* @param {!Array<!ol.EventsKey>} 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.events.Key|undefined} The matching listener object.
|
||||
* @return {ol.EventsKey|undefined} The matching listener object.
|
||||
* @private
|
||||
*/
|
||||
ol.events.findListener_ = function(listeners, listener, opt_this,
|
||||
@@ -110,9 +109,9 @@ ol.events.findListener_ = function(listeners, listener, opt_this,
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.events.EventTargetLike} target Target.
|
||||
* @param {ol.EventTargetLike} target Target.
|
||||
* @param {string} type Type.
|
||||
* @return {Array.<ol.events.Key>|undefined} Listeners.
|
||||
* @return {Array.<ol.EventsKey>|undefined} Listeners.
|
||||
*/
|
||||
ol.events.getListeners = function(target, type) {
|
||||
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
|
||||
@@ -123,8 +122,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.events.EventTargetLike} target Target.
|
||||
* @return {!Object.<string, Array.<ol.events.Key>>} Map of
|
||||
* @param {ol.EventTargetLike} target Target.
|
||||
* @return {!Object.<string, Array.<ol.EventsKey>>} Map of
|
||||
* listeners by event type.
|
||||
* @private
|
||||
*/
|
||||
@@ -141,7 +140,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.events.EventTargetLike} target Target.
|
||||
* @param {ol.EventTargetLike} target Target.
|
||||
* @param {string} type Type.
|
||||
* @private
|
||||
*/
|
||||
@@ -150,7 +149,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_];
|
||||
@@ -171,13 +170,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.events.EventTargetLike} target Event target.
|
||||
* @param {ol.EventTargetLike} target Event target.
|
||||
* @param {string} type Event type.
|
||||
* @param {ol.events.ListenerFunctionType} listener Listener.
|
||||
* @param {ol.EventsListenerFunctionType} 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.events.Key} Unique key for the listener.
|
||||
* @return {ol.EventsKey} Unique key for the listener.
|
||||
*/
|
||||
ol.events.listen = function(target, type, listener, opt_this, opt_once) {
|
||||
var listenerMap = ol.events.getListenerMap_(target);
|
||||
@@ -193,7 +192,7 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
|
||||
listenerObj.callOnce = false;
|
||||
}
|
||||
} else {
|
||||
listenerObj = /** @type {ol.events.Key} */ ({
|
||||
listenerObj = /** @type {ol.EventsKey} */ ({
|
||||
bindTo: opt_this,
|
||||
callOnce: !!opt_once,
|
||||
listener: listener,
|
||||
@@ -221,12 +220,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.events.EventTargetLike} target Event target.
|
||||
* @param {ol.EventTargetLike} target Event target.
|
||||
* @param {string} type Event type.
|
||||
* @param {ol.events.ListenerFunctionType} listener Listener.
|
||||
* @param {ol.EventsListenerFunctionType} listener Listener.
|
||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||
* listener. Default is the `target`.
|
||||
* @return {ol.events.Key} Key for unlistenByKey.
|
||||
* @return {ol.EventsKey} Key for unlistenByKey.
|
||||
*/
|
||||
ol.events.listenOnce = function(target, type, listener, opt_this) {
|
||||
return ol.events.listen(target, type, listener, opt_this, true);
|
||||
@@ -240,9 +239,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.events.EventTargetLike} target Event target.
|
||||
* @param {ol.EventTargetLike} target Event target.
|
||||
* @param {string} type Event type.
|
||||
* @param {ol.events.ListenerFunctionType} listener Listener.
|
||||
* @param {ol.EventsListenerFunctionType} listener Listener.
|
||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||
* listener. Default is the `target`.
|
||||
*/
|
||||
@@ -265,7 +264,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.events.Key} key The key.
|
||||
* @param {ol.EventsKey} key The key.
|
||||
*/
|
||||
ol.events.unlistenByKey = function(key) {
|
||||
if (key && key.target) {
|
||||
@@ -289,7 +288,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.events.EventTargetLike} target Target.
|
||||
* @param {ol.EventTargetLike} target Target.
|
||||
*/
|
||||
ol.events.unlistenAll = function(target) {
|
||||
var listenerMap = ol.events.getListenerMap_(target);
|
||||
|
||||
@@ -202,12 +202,14 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
|
||||
/**
|
||||
* Return `true` if the event originates from a mouse device.
|
||||
*
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Map browser event.
|
||||
* @param {ol.MapBrowserEvent} 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';
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.
|
||||
@@ -25,7 +26,7 @@ goog.require('ol.events.Event');
|
||||
*/
|
||||
ol.events.EventTarget = function() {
|
||||
|
||||
goog.base(this);
|
||||
ol.Disposable.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -41,17 +42,17 @@ ol.events.EventTarget = function() {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
|
||||
* @type {!Object.<string, Array.<ol.EventsListenerFunctionType>>}
|
||||
*/
|
||||
this.listeners_ = {};
|
||||
|
||||
};
|
||||
goog.inherits(ol.events.EventTarget, ol.Disposable);
|
||||
ol.inherits(ol.events.EventTarget, ol.Disposable);
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {ol.events.ListenerFunctionType} listener Listener.
|
||||
* @param {ol.EventsListenerFunctionType} listener Listener.
|
||||
*/
|
||||
ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
|
||||
var listeners = this.listeners_[type];
|
||||
@@ -116,7 +117,7 @@ ol.events.EventTarget.prototype.disposeInternal = function() {
|
||||
* order that they will be called in.
|
||||
*
|
||||
* @param {string} type Type.
|
||||
* @return {Array.<ol.events.ListenerFunctionType>} Listeners.
|
||||
* @return {Array.<ol.EventsListenerFunctionType>} Listeners.
|
||||
*/
|
||||
ol.events.EventTarget.prototype.getListeners = function(type) {
|
||||
return this.listeners_[type];
|
||||
@@ -137,7 +138,7 @@ ol.events.EventTarget.prototype.hasListener = function(opt_type) {
|
||||
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {ol.events.ListenerFunctionType} listener Listener.
|
||||
* @param {ol.EventsListenerFunctionType} listener Listener.
|
||||
*/
|
||||
ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
|
||||
var listeners = this.listeners_[type];
|
||||
|
||||
@@ -56,7 +56,7 @@ goog.require('ol.style.Style');
|
||||
*/
|
||||
ol.Feature = function(opt_geometryOrProperties) {
|
||||
|
||||
goog.base(this);
|
||||
ol.Object.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -86,7 +86,7 @@ ol.Feature = function(opt_geometryOrProperties) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?ol.events.Key}
|
||||
* @type {?ol.EventsKey}
|
||||
*/
|
||||
this.geometryChangeKey_ = null;
|
||||
|
||||
@@ -108,7 +108,7 @@ ol.Feature = function(opt_geometryOrProperties) {
|
||||
}
|
||||
}
|
||||
};
|
||||
goog.inherits(ol.Feature, ol.Object);
|
||||
ol.inherits(ol.Feature, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
@@ -294,7 +294,7 @@ ol.Feature.prototype.setGeometryName = function(name) {
|
||||
ol.Feature.createStyleFunction = function(obj) {
|
||||
var styleFunction;
|
||||
|
||||
if (goog.isFunction(obj)) {
|
||||
if (typeof obj === 'function') {
|
||||
styleFunction = obj;
|
||||
} else {
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) {
|
||||
function(extent, resolution, projection) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET',
|
||||
goog.isFunction(url) ? url(extent, resolution, projection) : url,
|
||||
typeof url === 'function' ? url(extent, resolution, projection) : url,
|
||||
true);
|
||||
if (format.getType() == ol.format.FormatType.ARRAY_BUFFER) {
|
||||
xhr.responseType = 'arraybuffer';
|
||||
|
||||
@@ -33,7 +33,7 @@ ol.format.EsriJSON = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.JSONFeature.call(this);
|
||||
|
||||
/**
|
||||
* Name of the geometry attribute for features.
|
||||
@@ -43,7 +43,7 @@ ol.format.EsriJSON = function(opt_options) {
|
||||
this.geometryName_ = options.geometryName;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.EsriJSON, ol.format.JSONFeature);
|
||||
ol.inherits(ol.format.EsriJSON, ol.format.JSONFeature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,7 @@ ol.format.GeoJSON = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.JSONFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -49,7 +49,7 @@ ol.format.GeoJSON = function(opt_options) {
|
||||
this.geometryName_ = options.geometryName;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
|
||||
ol.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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');
|
||||
@@ -23,7 +22,7 @@ ol.format.GML2 = function(opt_options) {
|
||||
var options = /** @type {olx.format.GMLOptions} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
goog.base(this, options);
|
||||
ol.format.GMLBase.call(this, options);
|
||||
|
||||
this.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS][
|
||||
'featureMember'] =
|
||||
@@ -36,7 +35,7 @@ ol.format.GML2 = function(opt_options) {
|
||||
options.schemaLocation : ol.format.GML2.schemaLocation_;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.GML2, ol.format.GMLBase);
|
||||
ol.inherits(ol.format.GML2, ol.format.GMLBase);
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,7 +55,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 = objectStack[0];
|
||||
var context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
|
||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||
var containerSrs = context['srsName'];
|
||||
var containerDimension = node.parentNode.getAttribute('srsDimension');
|
||||
@@ -102,7 +101,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Box', 'localName should be Box');
|
||||
/** @type {Array.<number>} */
|
||||
@@ -120,7 +119,7 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
||||
'localName should be innerBoundaryIs');
|
||||
@@ -145,7 +144,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
||||
'localName should be outerBoundaryIs');
|
||||
|
||||
@@ -2,7 +2,6 @@ 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');
|
||||
@@ -39,7 +38,7 @@ ol.format.GML3 = function(opt_options) {
|
||||
var options = /** @type {olx.format.GMLOptions} */
|
||||
(opt_options ? opt_options : {});
|
||||
|
||||
goog.base(this, options);
|
||||
ol.format.GMLBase.call(this, options);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -74,7 +73,7 @@ ol.format.GML3 = function(opt_options) {
|
||||
options.schemaLocation : ol.format.GML3.schemaLocation_;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.GML3, ol.format.GMLBase);
|
||||
ol.inherits(ol.format.GML3, ol.format.GMLBase);
|
||||
|
||||
|
||||
/**
|
||||
@@ -94,7 +93,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiCurve',
|
||||
'localName should be MultiCurve');
|
||||
@@ -118,7 +117,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiSurface',
|
||||
'localName should be MultiSurface');
|
||||
@@ -141,7 +140,7 @@ ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'curveMember' ||
|
||||
node.localName == 'curveMembers',
|
||||
@@ -156,7 +155,7 @@ ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'surfaceMember' ||
|
||||
node.localName == 'surfaceMembers',
|
||||
@@ -173,7 +172,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'patches',
|
||||
'localName should be patches');
|
||||
@@ -189,7 +188,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'segments',
|
||||
'localName should be segments');
|
||||
@@ -205,7 +204,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'npde.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'PolygonPatch',
|
||||
'localName should be PolygonPatch');
|
||||
@@ -221,7 +220,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LineStringSegment',
|
||||
'localName should be LineStringSegment');
|
||||
@@ -237,7 +236,7 @@ ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'interior',
|
||||
'localName should be interior');
|
||||
@@ -262,7 +261,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'exterior',
|
||||
'localName should be exterior');
|
||||
@@ -288,7 +287,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Surface',
|
||||
'localName should be Surface');
|
||||
@@ -320,7 +319,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Curve', 'localName should be Curve');
|
||||
/** @type {Array.<number>} */
|
||||
@@ -343,7 +342,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Envelope',
|
||||
'localName should be Envelope');
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
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');
|
||||
@@ -76,9 +75,9 @@ ol.format.GMLBase = function(opt_options) {
|
||||
ol.format.GMLBase.prototype.readFeaturesInternal)
|
||||
};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.XMLFeature.call(this);
|
||||
};
|
||||
goog.inherits(ol.format.GMLBase, ol.format.XMLFeature);
|
||||
ol.inherits(ol.format.GMLBase, ol.format.XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -109,7 +108,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = node.localName;
|
||||
var features = null;
|
||||
@@ -263,7 +262,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
||||
var flatCoordinates =
|
||||
@@ -284,7 +283,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiPoint',
|
||||
'localName should be MultiPoint');
|
||||
@@ -305,7 +304,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiLineString',
|
||||
'localName should be MultiLineString');
|
||||
@@ -328,7 +327,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiPolygon',
|
||||
'localName should be MultiPolygon');
|
||||
@@ -351,7 +350,7 @@ ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'pointMember' ||
|
||||
node.localName == 'pointMembers',
|
||||
@@ -367,7 +366,7 @@ ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'lineStringMember' ||
|
||||
node.localName == 'lineStringMembers',
|
||||
@@ -383,7 +382,7 @@ ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'polygonMember' ||
|
||||
node.localName == 'polygonMembers',
|
||||
@@ -399,7 +398,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LineString',
|
||||
'localName should be LineString');
|
||||
@@ -422,7 +421,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LinearRing',
|
||||
'localName should be LinearRing');
|
||||
@@ -443,7 +442,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LinearRing',
|
||||
'localName should be LinearRing');
|
||||
@@ -465,7 +464,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Polygon',
|
||||
'localName should be Polygon');
|
||||
@@ -497,7 +496,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
return ol.xml.pushParseAndPop(null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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');
|
||||
@@ -28,7 +27,7 @@ ol.format.GPX = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.XMLFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -41,7 +40,7 @@ ol.format.GPX = function(opt_options) {
|
||||
*/
|
||||
this.readExtensions_ = options.readExtensions;
|
||||
};
|
||||
goog.inherits(ol.format.GPX, ol.format.XMLFeature);
|
||||
ol.inherits(ol.format.GPX, ol.format.XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,6 +55,15 @@ 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.
|
||||
@@ -64,7 +72,7 @@ ol.format.GPX.NAMESPACE_URIS_ = [
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
flatCoordinates.push(
|
||||
parseFloat(node.getAttribute('lon')),
|
||||
@@ -91,7 +99,7 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.parseLink_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'link', 'localName should be link');
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -109,7 +117,7 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'extensions',
|
||||
'localName should be extensions');
|
||||
@@ -124,7 +132,7 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'rtept', 'localName should be rtept');
|
||||
var values = ol.xml.pushParseAndPop(
|
||||
@@ -144,7 +152,7 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'trkpt', 'localName should be trkpt');
|
||||
var values = ol.xml.pushParseAndPop(
|
||||
@@ -164,7 +172,7 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'trkseg',
|
||||
'localName should be trkseg');
|
||||
@@ -184,7 +192,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'rte', 'localName should be rte');
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
@@ -213,7 +221,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'trk', 'localName should be trk');
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
@@ -246,7 +254,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'wpt', 'localName should be wpt');
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
@@ -432,6 +440,8 @@ 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.
|
||||
@@ -446,7 +456,7 @@ ol.format.GPX.prototype.readFeature;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return null;
|
||||
@@ -466,6 +476,8 @@ 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.
|
||||
@@ -480,7 +492,7 @@ ol.format.GPX.prototype.readFeatures;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return [];
|
||||
@@ -569,7 +581,9 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
default:
|
||||
// pass
|
||||
}
|
||||
var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
|
||||
var orderedKeys = (node.nodeName == 'rtept') ?
|
||||
ol.format.GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
|
||||
ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
|
||||
var values = ol.xml.makeSequence(properties, orderedKeys);
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
({node: node, 'properties': properties}),
|
||||
@@ -723,6 +737,17 @@ 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>>}
|
||||
@@ -894,6 +919,13 @@ 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} */
|
||||
({node: gpx}), ol.format.GPX.GPX_SERIALIZERS_,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
goog.provide('ol.format.IGC');
|
||||
goog.provide('ol.format.IGCZ');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.Feature');
|
||||
@@ -13,7 +12,6 @@ goog.require('ol.proj');
|
||||
/**
|
||||
* IGC altitude/z. One of 'barometric', 'gps', 'none'.
|
||||
* @enum {string}
|
||||
* @api
|
||||
*/
|
||||
ol.format.IGCZ = {
|
||||
BAROMETRIC: 'barometric',
|
||||
@@ -35,7 +33,7 @@ ol.format.IGC = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -50,7 +48,7 @@ ol.format.IGC = function(opt_options) {
|
||||
options.altitudeMode : ol.format.IGCZ.NONE;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.IGC, ol.format.TextFeature);
|
||||
ol.inherits(ol.format.IGC, ol.format.TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -128,6 +126,7 @@ 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];
|
||||
@@ -160,7 +159,12 @@ 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);
|
||||
|
||||
@@ -15,9 +15,9 @@ goog.require('ol.format.FormatType');
|
||||
* @extends {ol.format.Feature}
|
||||
*/
|
||||
ol.format.JSONFeature = function() {
|
||||
goog.base(this);
|
||||
ol.format.Feature.call(this);
|
||||
};
|
||||
goog.inherits(ol.format.JSONFeature, ol.format.Feature);
|
||||
ol.inherits(ol.format.JSONFeature, ol.format.Feature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@ 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');
|
||||
@@ -54,7 +53,7 @@ ol.format.KML = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.XMLFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -96,7 +95,7 @@ ol.format.KML = function(opt_options) {
|
||||
options.showPointNames : true;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.KML, ol.format.XMLFeature);
|
||||
ol.inherits(ol.format.KML, ol.format.XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -561,7 +560,7 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be an ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'IconStyle',
|
||||
'localName should be IconStyle');
|
||||
@@ -662,7 +661,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LabelStyle',
|
||||
'localName should be LabelStyle');
|
||||
@@ -693,7 +692,7 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LineStyle',
|
||||
'localName should be LineStyle');
|
||||
@@ -725,7 +724,7 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'PolyStyle',
|
||||
'localName should be PolyStyle');
|
||||
@@ -762,7 +761,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LinearRing',
|
||||
'localName should be LinearRing');
|
||||
@@ -777,7 +776,7 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(ol.array.includes(
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
@@ -810,7 +809,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(ol.array.includes(
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
@@ -835,7 +834,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(ol.array.includes(
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
@@ -872,7 +871,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
||||
* @return {Object} Icon object.
|
||||
*/
|
||||
ol.format.KML.readIcon_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Icon', 'localName should be Icon');
|
||||
var iconObject = ol.xml.pushParseAndPop(
|
||||
@@ -892,7 +891,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
return ol.xml.pushParseAndPop(null,
|
||||
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
|
||||
@@ -906,7 +905,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LineString',
|
||||
'localName should be LineString');
|
||||
@@ -933,7 +932,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LinearRing',
|
||||
'localName should be LinearRing');
|
||||
@@ -961,7 +960,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiGeometry',
|
||||
'localName should be MultiGeometry');
|
||||
@@ -1033,7 +1032,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
||||
var properties = ol.xml.pushParseAndPop({},
|
||||
@@ -1061,7 +1060,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Polygon',
|
||||
'localName should be Polygon');
|
||||
@@ -1096,7 +1095,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
||||
var styleObject = ol.xml.pushParseAndPop(
|
||||
@@ -1172,7 +1171,7 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.DataParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Data', 'localName should be Data');
|
||||
var name = node.getAttribute('name');
|
||||
@@ -1196,7 +1195,7 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'ExtendedData',
|
||||
'localName should be ExtendedData');
|
||||
@@ -1210,7 +1209,7 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Pair', 'localName should be Pair');
|
||||
var pairObject = ol.xml.pushParseAndPop(
|
||||
@@ -1241,7 +1240,7 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'StyleMap',
|
||||
'localName should be StyleMap');
|
||||
@@ -1268,7 +1267,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'SchemaData',
|
||||
'localName should be SchemaData');
|
||||
@@ -1282,7 +1281,7 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'SimpleData',
|
||||
'localName should be SimpleData');
|
||||
@@ -1302,7 +1301,7 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
||||
'localName should be innerBoundaryIs');
|
||||
@@ -1327,7 +1326,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
||||
'localName should be outerBoundaryIs');
|
||||
@@ -1352,7 +1351,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LinkParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'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);
|
||||
@@ -1365,7 +1364,7 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.whenParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'when', 'localName should be when');
|
||||
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
||||
@@ -1728,7 +1727,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = node.localName;
|
||||
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
|
||||
@@ -1759,7 +1758,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 == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Placemark',
|
||||
'localName should be Placemark');
|
||||
@@ -1806,7 +1805,7 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
|
||||
var id = node.getAttribute('id');
|
||||
@@ -1831,7 +1830,7 @@ ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'StyleMap',
|
||||
'localName should be StyleMap');
|
||||
@@ -1871,7 +1870,7 @@ ol.format.KML.prototype.readFeature;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return null;
|
||||
@@ -1906,7 +1905,7 @@ ol.format.KML.prototype.readFeatures;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
|
||||
return [];
|
||||
@@ -1974,7 +1973,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 == goog.dom.NodeType.ELEMENT) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
var name = this.readNameFromNode(n);
|
||||
if (name) {
|
||||
return name;
|
||||
@@ -2046,7 +2045,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 == goog.dom.NodeType.ELEMENT) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ goog.require('ol.render.Feature');
|
||||
*/
|
||||
ol.format.MVT = function(opt_options) {
|
||||
|
||||
goog.base(this);
|
||||
ol.format.Feature.call(this);
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
@@ -74,7 +74,7 @@ ol.format.MVT = function(opt_options) {
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.MVT, ol.format.Feature);
|
||||
ol.inherits(ol.format.MVT, ol.format.Feature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,9 +18,6 @@ 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.
|
||||
@@ -214,20 +211,17 @@ ol.format.ogc.filter.like = function(propertyName, pattern,
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @extends {ol.Object}
|
||||
* @struct
|
||||
* @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.
|
||||
@@ -251,9 +245,9 @@ ol.format.ogc.filter.Filter.prototype.getTagName = function() {
|
||||
* @extends {ol.format.ogc.filter.Filter}
|
||||
*/
|
||||
ol.format.ogc.filter.Logical = function(tagName) {
|
||||
goog.base(this, tagName);
|
||||
ol.format.ogc.filter.Filter.call(this, tagName);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
|
||||
ol.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
|
||||
|
||||
|
||||
/**
|
||||
@@ -269,7 +263,7 @@ goog.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
|
||||
*/
|
||||
ol.format.ogc.filter.LogicalBinary = function(tagName, conditionA, conditionB) {
|
||||
|
||||
goog.base(this, tagName);
|
||||
ol.format.ogc.filter.Logical.call(this, tagName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -284,7 +278,7 @@ ol.format.ogc.filter.LogicalBinary = function(tagName, conditionA, conditionB) {
|
||||
this.conditionB = conditionB;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
|
||||
ol.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
|
||||
|
||||
|
||||
/**
|
||||
@@ -298,9 +292,9 @@ goog.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.And = function(conditionA, conditionB) {
|
||||
goog.base(this, 'And', conditionA, conditionB);
|
||||
ol.format.ogc.filter.LogicalBinary.call(this, 'And', conditionA, conditionB);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
|
||||
ol.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -314,9 +308,9 @@ goog.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.Or = function(conditionA, conditionB) {
|
||||
goog.base(this, 'Or', conditionA, conditionB);
|
||||
ol.format.ogc.filter.LogicalBinary.call(this, 'Or', conditionA, conditionB);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
|
||||
ol.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -330,7 +324,7 @@ goog.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
|
||||
*/
|
||||
ol.format.ogc.filter.Not = function(condition) {
|
||||
|
||||
goog.base(this, 'Not');
|
||||
ol.format.ogc.filter.Logical.call(this, 'Not');
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -338,7 +332,7 @@ ol.format.ogc.filter.Not = function(condition) {
|
||||
*/
|
||||
this.condition = condition;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
|
||||
ol.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
|
||||
|
||||
|
||||
// Spatial filters
|
||||
@@ -359,7 +353,7 @@ goog.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
|
||||
*/
|
||||
ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
|
||||
|
||||
goog.base(this, 'BBOX');
|
||||
ol.format.ogc.filter.Filter.call(this, 'BBOX');
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -369,7 +363,7 @@ ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!ol.Extent}
|
||||
* @type {ol.Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
|
||||
@@ -379,7 +373,7 @@ ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
|
||||
*/
|
||||
this.srsName = opt_srsName;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
|
||||
ol.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
|
||||
|
||||
|
||||
// Property comparison filters
|
||||
@@ -398,7 +392,7 @@ goog.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
|
||||
*/
|
||||
ol.format.ogc.filter.Comparison = function(tagName, propertyName) {
|
||||
|
||||
goog.base(this, tagName);
|
||||
ol.format.ogc.filter.Filter.call(this, tagName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -406,7 +400,7 @@ ol.format.ogc.filter.Comparison = function(tagName, propertyName) {
|
||||
*/
|
||||
this.propertyName = propertyName;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
|
||||
ol.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
|
||||
|
||||
|
||||
/**
|
||||
@@ -425,7 +419,7 @@ goog.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
|
||||
ol.format.ogc.filter.ComparisonBinary = function(
|
||||
tagName, propertyName, expression, opt_matchCase) {
|
||||
|
||||
goog.base(this, tagName, propertyName);
|
||||
ol.format.ogc.filter.Comparison.call(this, tagName, propertyName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -439,7 +433,7 @@ ol.format.ogc.filter.ComparisonBinary = function(
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparison);
|
||||
ol.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparison);
|
||||
|
||||
|
||||
/**
|
||||
@@ -454,9 +448,9 @@ goog.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Compar
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.EqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
goog.base(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
||||
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
ol.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -471,9 +465,9 @@ goog.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinar
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.NotEqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
goog.base(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
|
||||
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
ol.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -487,9 +481,9 @@ goog.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBi
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.LessThan = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsLessThan', propertyName, expression);
|
||||
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsLessThan', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary);
|
||||
ol.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -503,9 +497,9 @@ goog.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBina
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.LessThanOrEqualTo = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
|
||||
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
ol.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -519,9 +513,9 @@ goog.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.Compa
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.GreaterThan = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsGreaterThan', propertyName, expression);
|
||||
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThan', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBinary);
|
||||
ol.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -535,9 +529,9 @@ goog.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonB
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.GreaterThanOrEqualTo = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
|
||||
ol.format.ogc.filter.ComparisonBinary.call(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
ol.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
@@ -550,9 +544,9 @@ goog.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.Co
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.IsNull = function(propertyName) {
|
||||
goog.base(this, 'PropertyIsNull', propertyName);
|
||||
ol.format.ogc.filter.Comparison.call(this, 'PropertyIsNull', propertyName);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
|
||||
ol.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
|
||||
|
||||
|
||||
/**
|
||||
@@ -567,7 +561,7 @@ goog.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoundary) {
|
||||
goog.base(this, 'PropertyIsBetween', propertyName);
|
||||
ol.format.ogc.filter.Comparison.call(this, 'PropertyIsBetween', propertyName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -581,7 +575,7 @@ ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoun
|
||||
*/
|
||||
this.upperBoundary = upperBoundary;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison);
|
||||
ol.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison);
|
||||
|
||||
|
||||
/**
|
||||
@@ -603,7 +597,7 @@ goog.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) {
|
||||
goog.base(this, 'PropertyIsLike', propertyName);
|
||||
ol.format.ogc.filter.Comparison.call(this, 'PropertyIsLike', propertyName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -635,4 +629,4 @@ ol.format.ogc.filter.IsLike = function(propertyName, pattern,
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.IsLike, ol.format.ogc.filter.Comparison);
|
||||
ol.inherits(ol.format.ogc.filter.IsLike, ol.format.ogc.filter.Comparison);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
goog.provide('ol.format.OSMXML');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom.NodeType');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.format.Feature');
|
||||
@@ -26,14 +25,14 @@ goog.require('ol.xml');
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.OSMXML = function() {
|
||||
goog.base(this);
|
||||
ol.format.XMLFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
this.defaultDataProjection = ol.proj.get('EPSG:4326');
|
||||
};
|
||||
goog.inherits(ol.format.OSMXML, ol.format.XMLFeature);
|
||||
ol.inherits(ol.format.OSMXML, ol.format.XMLFeature);
|
||||
|
||||
|
||||
/**
|
||||
@@ -58,7 +57,7 @@ ol.format.OSMXML.prototype.getExtensions = function() {
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'node', 'localName should be node');
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
@@ -91,7 +90,7 @@ ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'way', 'localName should be way');
|
||||
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
|
||||
@@ -131,7 +130,7 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'nd', 'localName should be nd');
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -145,7 +144,7 @@ ol.format.OSMXML.readNd_ = function(node, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.readTag_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'tag', 'localName should be tag');
|
||||
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -214,7 +213,7 @@ ol.format.OSMXML.prototype.readFeatures;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var options = this.getReadOptions(node, opt_options);
|
||||
if (node.localName == 'osm') {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.format.OWS');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom.NodeType');
|
||||
goog.require('ol.format.XLink');
|
||||
goog.require('ol.format.XML');
|
||||
goog.require('ol.format.XSD');
|
||||
@@ -13,9 +12,9 @@ goog.require('ol.xml');
|
||||
* @extends {ol.format.XML}
|
||||
*/
|
||||
ol.format.OWS = function() {
|
||||
goog.base(this);
|
||||
ol.format.XML.call(this);
|
||||
};
|
||||
goog.inherits(ol.format.OWS, ol.format.XML);
|
||||
ol.inherits(ol.format.OWS, ol.format.XML);
|
||||
|
||||
|
||||
/**
|
||||
@@ -23,10 +22,10 @@ goog.inherits(ol.format.OWS, ol.format.XML);
|
||||
* @return {Object} OWS object.
|
||||
*/
|
||||
ol.format.OWS.prototype.readFromDocument = function(doc) {
|
||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
||||
goog.asserts.assert(doc.nodeType == Node.DOCUMENT_NODE,
|
||||
'doc.nodeType should be DOCUMENT');
|
||||
for (var n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
return this.readFromNode(n);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +38,7 @@ ol.format.OWS.prototype.readFromDocument = function(doc) {
|
||||
* @return {Object} OWS object.
|
||||
*/
|
||||
ol.format.OWS.prototype.readFromNode = function(node) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var owsObject = ol.xml.pushParseAndPop({},
|
||||
ol.format.OWS.PARSERS_, node, []);
|
||||
@@ -54,7 +53,7 @@ ol.format.OWS.prototype.readFromNode = function(node) {
|
||||
* @return {Object|undefined} The address.
|
||||
*/
|
||||
ol.format.OWS.readAddress_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Address',
|
||||
'localName should be Address');
|
||||
@@ -70,7 +69,7 @@ ol.format.OWS.readAddress_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The values.
|
||||
*/
|
||||
ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'AllowedValues',
|
||||
'localName should be AllowedValues');
|
||||
@@ -86,7 +85,7 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The constraint.
|
||||
*/
|
||||
ol.format.OWS.readConstraint_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Constraint',
|
||||
'localName should be Constraint');
|
||||
@@ -107,7 +106,7 @@ ol.format.OWS.readConstraint_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The contact info.
|
||||
*/
|
||||
ol.format.OWS.readContactInfo_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'ContactInfo',
|
||||
'localName should be ContactInfo');
|
||||
@@ -123,7 +122,7 @@ ol.format.OWS.readContactInfo_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The DCP.
|
||||
*/
|
||||
ol.format.OWS.readDcp_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'DCP', 'localName should be DCP');
|
||||
return ol.xml.pushParseAndPop({},
|
||||
@@ -138,7 +137,7 @@ ol.format.OWS.readDcp_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The GET object.
|
||||
*/
|
||||
ol.format.OWS.readGet_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Get', 'localName should be Get');
|
||||
var href = ol.format.XLink.readHref(node);
|
||||
@@ -157,7 +156,7 @@ ol.format.OWS.readGet_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The HTTP object.
|
||||
*/
|
||||
ol.format.OWS.readHttp_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'HTTP', 'localName should be HTTP');
|
||||
return ol.xml.pushParseAndPop({}, ol.format.OWS.HTTP_PARSERS_,
|
||||
@@ -172,7 +171,7 @@ ol.format.OWS.readHttp_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The operation.
|
||||
*/
|
||||
ol.format.OWS.readOperation_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Operation',
|
||||
'localName should be Operation');
|
||||
@@ -198,7 +197,7 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
|
||||
*/
|
||||
ol.format.OWS.readOperationsMetadata_ = function(node,
|
||||
objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'OperationsMetadata',
|
||||
'localName should be OperationsMetadata');
|
||||
@@ -215,7 +214,7 @@ ol.format.OWS.readOperationsMetadata_ = function(node,
|
||||
* @return {Object|undefined} The phone.
|
||||
*/
|
||||
ol.format.OWS.readPhone_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Phone', 'localName should be Phone');
|
||||
return ol.xml.pushParseAndPop({},
|
||||
@@ -231,7 +230,7 @@ ol.format.OWS.readPhone_ = function(node, objectStack) {
|
||||
*/
|
||||
ol.format.OWS.readServiceIdentification_ = function(node,
|
||||
objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'ServiceIdentification',
|
||||
'localName should be ServiceIdentification');
|
||||
@@ -248,7 +247,7 @@ ol.format.OWS.readServiceIdentification_ = function(node,
|
||||
* @return {Object|undefined} The service contact.
|
||||
*/
|
||||
ol.format.OWS.readServiceContact_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'ServiceContact',
|
||||
'localName should be ServiceContact');
|
||||
@@ -265,7 +264,7 @@ ol.format.OWS.readServiceContact_ = function(node, objectStack) {
|
||||
* @return {Object|undefined} The service provider.
|
||||
*/
|
||||
ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'ServiceProvider',
|
||||
'localName should be ServiceProvider');
|
||||
@@ -282,7 +281,7 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
|
||||
* @return {string|undefined} The value.
|
||||
*/
|
||||
ol.format.OWS.readValue_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Value', 'localName should be Value');
|
||||
return ol.format.XSD.readString(node);
|
||||
|
||||
@@ -27,7 +27,7 @@ ol.format.Polyline = function(opt_options) {
|
||||
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this);
|
||||
ol.format.TextFeature.call(this);
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -47,7 +47,7 @@ ol.format.Polyline = function(opt_options) {
|
||||
this.geometryLayout_ = options.geometryLayout ?
|
||||
options.geometryLayout : ol.geom.GeometryLayout.XY;
|
||||
};
|
||||
goog.inherits(ol.format.Polyline, ol.format.TextFeature);
|
||||
ol.inherits(ol.format.Polyline, ol.format.TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user