Compare commits

..

1 Commits

Author SHA1 Message Date
Tim Schaub
d12d2734c0 Test 2014-12-19 18:00:19 -07:00
225 changed files with 2210 additions and 7814 deletions

View File

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

58
AUTHORS.md Normal file
View File

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

View File

@@ -42,7 +42,7 @@ as described below.
The minimum requirements are: The minimum requirements are:
* Git * Git
* [Node.js](http://nodejs.org/) (0.10.x or higher) * [Node.js](http://nodejs.org/)
* Python 2.6 or 2.7 with a couple of extra modules (see below) * Python 2.6 or 2.7 with a couple of extra modules (see below)
* Java 7 (JRE and JDK) * Java 7 (JRE and JDK)
@@ -132,7 +132,7 @@ To run the tests on the console (headless testing with PhantomJS) use the `test`
$ ./build.py test $ ./build.py test
See also the test-specific [README](../master/test/README.md). See also the test-specific [README](../blob/master/test/README.md).
## Running the integration tests ## Running the integration tests
@@ -239,14 +239,6 @@ style of the existing OpenLayers 3 code, which includes:
* Do not use assignments inside expressions. * Do not use assignments inside expressions.
* Avoid the use of `goog.array.clone` with arrays (use slice instead).
* Use `array.length = 0` instead of `goog.array.clear`.
* Use bracket notation instead of `goog.object.set` and `goog.object.get` (with
two arguments).
* Use uppercase for `@const` variables.
### Pass the integration tests run automatically by the Travis CI system ### Pass the integration tests run automatically by the Travis CI system

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -21,6 +21,7 @@
font-size: 10px; font-size: 10px;
text-align: center; text-align: center;
margin: 1px; margin: 1px;
padding: 0px 2px;
} }
.ol-unsupported { .ol-unsupported {
display: none; display: none;
@@ -52,12 +53,11 @@
.ol-rotate { .ol-rotate {
top: .5em; top: .5em;
right: .5em; right: .5em;
transition: opacity .25s linear, visibility 0s linear; transition: opacity .25s;
} }
.ol-rotate.ol-hidden { .ol-rotate.ol-hidden {
opacity: 0; opacity: 0;
visibility: hidden; display: none;
transition: opacity .25s linear, visibility 0s linear .25s;
} }
.ol-zoom-extent { .ol-zoom-extent {
top: 4.643em; top: 4.643em;
@@ -114,12 +114,21 @@
background-color: #4c6079; background-color: #4c6079;
background-color: rgba(0,60,136,0.7); background-color: rgba(0,60,136,0.7);
} }
.ol-zoom-extent button:after {
content: "E";
}
.ol-zoom .ol-zoom-in { .ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0; border-radius: 2px 2px 0 0;
} }
.ol-zoom .ol-zoom-out { .ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;
} }
button.ol-full-screen-false:after {
content: "\2194";
}
button.ol-full-screen-true:after {
content: "\00d7";
}
.ol-attribution { .ol-attribution {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -92,12 +92,6 @@ oli.MapBrowserEvent.prototype.originalEvent;
oli.MapBrowserEvent.prototype.pixel; oli.MapBrowserEvent.prototype.pixel;
/**
* @type {boolean}
*/
oli.MapBrowserEvent.prototype.dragging;
/** /**
* @interface * @interface
@@ -210,17 +204,6 @@ oli.render.Event.prototype.vectorContext;
oli.source; oli.source;
/**
* @interface
*/
oli.source.TileEvent = function() {};
/**
* @type {ol.Tile}
*/
oli.source.TileEvent.prototype.tile;
/** /**
* @interface * @interface

View File

@@ -23,6 +23,32 @@ olx.AttributionOptions;
olx.AttributionOptions.prototype.html; olx.AttributionOptions.prototype.html;
/**
* @typedef {{loadTilesWhileAnimating: (boolean|undefined),
* loadTilesWhileInteracting: (boolean|undefined)}}
* @api
*/
olx.DeviceOptions;
/**
* When set to false, no tiles will be loaded while animating, which improves
* responsiveness on devices with slow memory. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.DeviceOptions.prototype.loadTilesWhileAnimating;
/**
* When set to false, no tiles will be loaded while interacting, which improves
* responsiveness on devices with slow memory. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.DeviceOptions.prototype.loadTilesWhileInteracting;
/** /**
* @typedef {{tracking: (boolean|undefined)}} * @typedef {{tracking: (boolean|undefined)}}
* @api * @api
@@ -168,12 +194,11 @@ olx.interaction.InteractionOptions.prototype.handleEvent;
/** /**
* Object literal with config options for the map. * Object literal with config options for the map.
* @typedef {{controls: (ol.Collection.<ol.control.Control>|Array.<ol.control.Control>|undefined), * @typedef {{controls: (ol.Collection.<ol.control.Control>|Array.<ol.control.Control>|undefined),
* deviceOptions: (olx.DeviceOptions|undefined),
* pixelRatio: (number|undefined), * pixelRatio: (number|undefined),
* interactions: (ol.Collection.<ol.interaction.Interaction>|Array.<ol.interaction.Interaction>|undefined), * interactions: (ol.Collection.<ol.interaction.Interaction>|Array.<ol.interaction.Interaction>|undefined),
* keyboardEventTarget: (Element|Document|string|undefined), * keyboardEventTarget: (Element|Document|string|undefined),
* layers: (Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined), * layers: (Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined),
* loadTilesWhileAnimating: (boolean|undefined),
* loadTilesWhileInteracting: (boolean|undefined),
* logo: (boolean|string|olx.LogoOptions|undefined), * logo: (boolean|string|olx.LogoOptions|undefined),
* overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined), * overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined),
* renderer: (ol.RendererType|Array.<ol.RendererType|string>|string|undefined), * renderer: (ol.RendererType|Array.<ol.RendererType|string>|string|undefined),
@@ -193,6 +218,14 @@ olx.MapOptions;
olx.MapOptions.prototype.controls; olx.MapOptions.prototype.controls;
/**
* Device options for the map.
* @type {olx.DeviceOptions|undefined}
* @api
*/
olx.MapOptions.prototype.deviceOptions;
/** /**
* The ratio between physical pixels and device-independent pixels (dips) on the * The ratio between physical pixels and device-independent pixels (dips) on the
* device. If `undefined` then it gets set by using `window.devicePixelRatio`. * device. If `undefined` then it gets set by using `window.devicePixelRatio`.
@@ -233,26 +266,6 @@ olx.MapOptions.prototype.keyboardEventTarget;
olx.MapOptions.prototype.layers; olx.MapOptions.prototype.layers;
/**
* When set to true, tiles will be loaded during animations. This may improve
* the user experience, but can also make animations stutter on devices with
* slow memory. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.MapOptions.prototype.loadTilesWhileAnimating;
/**
* When set to true, tiles will be loaded while interacting with the map. This
* may improve the user experience, but can also make map panning and zooming
* choppy on devices with slow memory. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.MapOptions.prototype.loadTilesWhileInteracting;
/** /**
* The map logo. A logo to be displayed on the map at all times. If a string is * The map logo. A logo to be displayed on the map at all times. If a string is
* provided, it will be set as the image source of the logo. If an object is * provided, it will be set as the image source of the logo. If an object is
@@ -310,10 +323,7 @@ olx.MapOptions.prototype.view;
* position: (ol.Coordinate|undefined), * position: (ol.Coordinate|undefined),
* positioning: (ol.OverlayPositioning|string|undefined), * positioning: (ol.OverlayPositioning|string|undefined),
* stopEvent: (boolean|undefined), * stopEvent: (boolean|undefined),
* insertFirst: (boolean|undefined), * insertFirst: (boolean|undefined)}}
* autoPan: (boolean|undefined),
* autoPanAnimation: (olx.animation.PanOptions|undefined),
* autoPanMargin: (number|undefined)}}
* @api stable * @api stable
*/ */
olx.OverlayOptions; olx.OverlayOptions;
@@ -379,35 +389,6 @@ olx.OverlayOptions.prototype.stopEvent;
olx.OverlayOptions.prototype.insertFirst; olx.OverlayOptions.prototype.insertFirst;
/**
* If set to `true` the map is panned when calling `setPosition`, so that the
* overlay is entirely visible in the current viewport.
* The default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.OverlayOptions.prototype.autoPan;
/**
* The options used to create a `ol.animation.pan` animation. This animation
* is only used when `autoPan` is enabled. By default the default options for
* `ol.animation.pan` are used. If set to `null` the panning is not animated.
* @type {olx.animation.PanOptions|undefined}
* @api
*/
olx.OverlayOptions.prototype.autoPanAnimation;
/**
* The margin (in pixels) between the overlay and the borders of the map when
* autopanning. The default is `20`.
* @type {number|undefined}
* @api
*/
olx.OverlayOptions.prototype.autoPanMargin;
/** /**
* Object literal with config options for the projection. * Object literal with config options for the projection.
* @typedef {{code: string, * @typedef {{code: string,
@@ -838,8 +819,8 @@ olx.control;
* collapsible: (boolean|undefined), * collapsible: (boolean|undefined),
* collapsed: (boolean|undefined), * collapsed: (boolean|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* label: (string|Node|undefined), * label: (string|undefined),
* collapseLabel: (string|Node|undefined), * collapseLabel: (string|undefined),
* render: (function(ol.MapEvent)|undefined), * render: (function(ol.MapEvent)|undefined),
* target: (Element|undefined)}} * target: (Element|undefined)}}
* @api * @api
@@ -891,17 +872,15 @@ olx.control.AttributionOptions.prototype.tipLabel;
/** /**
* Text label to use for the collapsed attributions button. Default is `i`. * Text label to use for the collapsed attributions button. Default is `i`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api * @api
*/ */
olx.control.AttributionOptions.prototype.label; olx.control.AttributionOptions.prototype.label;
/** /**
* Text label to use for the expanded attributions button. Default is `»`. * Text label to use for the expanded attributions button. Default is `»`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api * @api
*/ */
olx.control.AttributionOptions.prototype.collapseLabel; olx.control.AttributionOptions.prototype.collapseLabel;
@@ -1014,8 +993,6 @@ olx.control.DefaultsOptions.prototype.zoomOptions;
/** /**
* @typedef {{className: (string|undefined), * @typedef {{className: (string|undefined),
* label: (string|Node|undefined),
* labelActive: (string|Node|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* keys: (boolean|undefined), * keys: (boolean|undefined),
* target: (Element|undefined)}} * target: (Element|undefined)}}
@@ -1032,25 +1009,6 @@ olx.control.FullScreenOptions;
olx.control.FullScreenOptions.prototype.className; olx.control.FullScreenOptions.prototype.className;
/**
* Text label to use for the button. Default is `\u2194` (an arrow).
* Instead of text, also a Node (e.g. a `span` element) can be used.
* @type {string|Node|undefined}
* @api
*/
olx.control.FullScreenOptions.prototype.label;
/**
* Text label to use for the button when full-screen is active.
* Default is `\u00d7` (a cross).
* Instead of text, also a Node (e.g. a `span` element) can be used.
* @type {string|Node|undefined}
* @api
*/
olx.control.FullScreenOptions.prototype.labelActive;
/** /**
* Text label to use for the button tip. Default is `Toggle full-screen` * Text label to use for the button tip. Default is `Toggle full-screen`
* @type {string|undefined} * @type {string|undefined}
@@ -1138,9 +1096,9 @@ olx.control.MousePositionOptions.prototype.undefinedHTML;
/** /**
* @typedef {{collapsed: (boolean|undefined), * @typedef {{collapsed: (boolean|undefined),
* collapseLabel: (string|Node|undefined), * collapseLabel: (string|undefined),
* collapsible: (boolean|undefined), * collapsible: (boolean|undefined),
* label: (string|Node|undefined), * label: (string|undefined),
* layers: (Array.<ol.layer.Layer>|ol.Collection|undefined), * layers: (Array.<ol.layer.Layer>|ol.Collection|undefined),
* render: (function(ol.MapEvent)|undefined), * render: (function(ol.MapEvent)|undefined),
* target: (Element|undefined), * target: (Element|undefined),
@@ -1160,9 +1118,8 @@ olx.control.OverviewMapOptions.prototype.collapsed;
/** /**
* Text label to use for the expanded overviewmap button. Default is `«`. * Text label to use for the expanded overviewmap button. Default is `«`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api * @api
*/ */
olx.control.OverviewMapOptions.prototype.collapseLabel; olx.control.OverviewMapOptions.prototype.collapseLabel;
@@ -1177,9 +1134,8 @@ olx.control.OverviewMapOptions.prototype.collapsible;
/** /**
* Text label to use for the collapsed overviewmap button. Default is `»`. * Text label to use for the collapsed overviewmap button. Default is `»`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api * @api
*/ */
olx.control.OverviewMapOptions.prototype.label; olx.control.OverviewMapOptions.prototype.label;
@@ -1275,7 +1231,7 @@ olx.control.ScaleLineOptions.prototype.units;
/** /**
* @typedef {{duration: (number|undefined), * @typedef {{duration: (number|undefined),
* className: (string|undefined), * className: (string|undefined),
* label: (string|Node|undefined), * label: (string|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* target: (Element|undefined), * target: (Element|undefined),
* render: (function(ol.MapEvent)|undefined), * render: (function(ol.MapEvent)|undefined),
@@ -1294,9 +1250,8 @@ olx.control.RotateOptions.prototype.className;
/** /**
* Text label to use for the rotate button. Default is `⇧`. * Text label to use for the rotate button. Default is `⇧`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api stable * @api stable
*/ */
olx.control.RotateOptions.prototype.label; olx.control.RotateOptions.prototype.label;
@@ -1346,8 +1301,8 @@ olx.control.RotateOptions.prototype.target;
/** /**
* @typedef {{duration: (number|undefined), * @typedef {{duration: (number|undefined),
* className: (string|undefined), * className: (string|undefined),
* zoomInLabel: (string|Node|undefined), * zoomInLabel: (string|undefined),
* zoomOutLabel: (string|Node|undefined), * zoomOutLabel: (string|undefined),
* zoomInTipLabel: (string|undefined), * zoomInTipLabel: (string|undefined),
* zoomOutTipLabel: (string|undefined), * zoomOutTipLabel: (string|undefined),
* delta: (number|undefined), * delta: (number|undefined),
@@ -1374,18 +1329,16 @@ olx.control.ZoomOptions.prototype.className;
/** /**
* Text label to use for the zoom-in button. Default is `+`. * Text label to use for the zoom-in button. Default is `+`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api stable * @api stable
*/ */
olx.control.ZoomOptions.prototype.zoomInLabel; olx.control.ZoomOptions.prototype.zoomInLabel;
/** /**
* Text label to use for the zoom-out button. Default is `-`. * Text label to use for the zoom-out button. Default is `-`
* Instead of text, also a Node (e.g. a `span` element) can be used. * @type {string|undefined}
* @type {string|Node|undefined}
* @api stable * @api stable
*/ */
olx.control.ZoomOptions.prototype.zoomOutLabel; olx.control.ZoomOptions.prototype.zoomOutLabel;
@@ -1469,7 +1422,6 @@ olx.control.ZoomSliderOptions.prototype.render;
/** /**
* @typedef {{className: (string|undefined), * @typedef {{className: (string|undefined),
* target: (Element|undefined), * target: (Element|undefined),
* label: (string|Node|undefined),
* tipLabel: (string|undefined), * tipLabel: (string|undefined),
* extent: (ol.Extent|undefined)}} * extent: (ol.Extent|undefined)}}
* @api stable * @api stable
@@ -1493,15 +1445,6 @@ olx.control.ZoomToExtentOptions.prototype.className;
olx.control.ZoomToExtentOptions.prototype.target; olx.control.ZoomToExtentOptions.prototype.target;
/**
* Text label to use for the button. Default is `E`.
* Instead of text, also a Node (e.g. a `span` element) can be used.
* @type {string|Node|undefined}
* @api stable
*/
olx.control.ZoomToExtentOptions.prototype.label;
/** /**
* Text label to use for the button tip. Default is `Zoom to extent` * Text label to use for the button tip. Default is `Zoom to extent`
* @type {string|undefined} * @type {string|undefined}
@@ -1527,8 +1470,8 @@ olx.format;
/** /**
* @typedef {{dataProjection: ol.proj.ProjectionLike, * @typedef {{dataProjection: (ol.proj.ProjectionLike|undefined),
* featureProjection: ol.proj.ProjectionLike}} * featureProjection: (ol.proj.ProjectionLike|undefined)}}
* @api * @api
*/ */
olx.format.ReadOptions; olx.format.ReadOptions;
@@ -1540,7 +1483,7 @@ olx.format.ReadOptions;
* the format is assigned (where set). If the projection can not be derived from * the format is assigned (where set). If the projection can not be derived from
* the data and if no `defaultDataProjection` is set for a format, the features * the data and if no `defaultDataProjection` is set for a format, the features
* will not be reprojected. * will not be reprojected.
* @type {ol.proj.ProjectionLike} * @type {ol.proj.ProjectionLike|undefined}
* @api stable * @api stable
*/ */
olx.format.ReadOptions.prototype.dataProjection; olx.format.ReadOptions.prototype.dataProjection;
@@ -1549,14 +1492,14 @@ olx.format.ReadOptions.prototype.dataProjection;
/** /**
* Projection of the feature geometries created by the format reader. If not * Projection of the feature geometries created by the format reader. If not
* provided, features will be returned in the `dataProjection`. * provided, features will be returned in the `dataProjection`.
* @type {ol.proj.ProjectionLike} * @type {ol.proj.ProjectionLike|undefined}
* @api stable * @api stable
*/ */
olx.format.ReadOptions.prototype.featureProjection; olx.format.ReadOptions.prototype.featureProjection;
/** /**
* @typedef {{dataProjection: ol.proj.ProjectionLike, * @typedef {{dataProjection: (ol.proj.ProjectionLike|undefined),
* featureProjection: ol.proj.ProjectionLike}} * featureProjection: ol.proj.ProjectionLike}}
* @api * @api
*/ */
@@ -1568,7 +1511,7 @@ olx.format.WriteOptions;
* `defaultDataProjection` of the format is assigned (where set). If no * `defaultDataProjection` of the format is assigned (where set). If no
* `defaultDataProjection` is set for a format, the features will be returned * `defaultDataProjection` is set for a format, the features will be returned
* in the `featureProjection`. * in the `featureProjection`.
* @type {ol.proj.ProjectionLike} * @type {ol.proj.ProjectionLike|undefined}
* @api stable * @api stable
*/ */
olx.format.WriteOptions.prototype.dataProjection; olx.format.WriteOptions.prototype.dataProjection;
@@ -2551,8 +2494,7 @@ olx.interaction.PointerOptions.prototype.handleUpEvent;
* layers: (Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean|undefined), * layers: (Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined), * style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined),
* removeCondition: (ol.events.ConditionType|undefined), * removeCondition: (ol.events.ConditionType|undefined),
* toggleCondition: (ol.events.ConditionType|undefined), * toggleCondition: (ol.events.ConditionType|undefined)}}
* multi: (boolean|undefined)}}
* @api * @api
*/ */
olx.interaction.SelectOptions; olx.interaction.SelectOptions;
@@ -2629,15 +2571,6 @@ olx.interaction.SelectOptions.prototype.removeCondition;
*/ */
olx.interaction.SelectOptions.prototype.toggleCondition; olx.interaction.SelectOptions.prototype.toggleCondition;
/**
* A boolean that determines if the default behaviour should select only
* single features or all (overlapping) features at the clicked map
* position. Default is false i.e single select
* @type {boolean|undefined}
* @api
*/
olx.interaction.SelectOptions.prototype.multi;
/** /**
* Namespace. * Namespace.
@@ -3300,7 +3233,6 @@ olx.layer.TileOptions.prototype.useInterimTilesOnError;
* saturation: (number|undefined), * saturation: (number|undefined),
* source: (ol.source.Vector|undefined), * source: (ol.source.Vector|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined), * style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined),
* updateWhileAnimating: (boolean|undefined),
* visible: (boolean|undefined)}} * visible: (boolean|undefined)}}
* @api * @api
*/ */
@@ -3409,17 +3341,6 @@ olx.layer.VectorOptions.prototype.source;
olx.layer.VectorOptions.prototype.style; olx.layer.VectorOptions.prototype.style;
/**
* When set to `true`, feature batches will be recreated during animations.
* This means that no vectors will be shown clipped, but the setting will have a
* performance impact for large amounts of vector data. When set to `false`,
* batches will be recreated when no animation is active. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.layer.VectorOptions.prototype.updateWhileAnimating;
/** /**
* Visibility. Default is `true` (visible). * Visibility. Default is `true` (visible).
* @type {boolean|undefined} * @type {boolean|undefined}
@@ -3473,8 +3394,7 @@ olx.source;
* key: string, * key: string,
* imagerySet: string, * imagerySet: string,
* maxZoom: (number|undefined), * maxZoom: (number|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined), * tileLoadFunction: (ol.TileLoadFunctionType|undefined)}}
* wrapX: (boolean|undefined)}}
* @api * @api
*/ */
olx.source.BingMapsOptions; olx.source.BingMapsOptions;
@@ -3520,15 +3440,6 @@ olx.source.BingMapsOptions.prototype.maxZoom;
*/ */
olx.source.BingMapsOptions.prototype.tileLoadFunction; olx.source.BingMapsOptions.prototype.tileLoadFunction;
/**
* Whether to wrap the world horizontally. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.source.BingMapsOptions.prototype.wrapX;
/** /**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined), * @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* distance: (number|undefined), * distance: (number|undefined),
@@ -3644,7 +3555,7 @@ olx.source.FormatVectorOptions.prototype.projection;
* @typedef {{attributions: (Array.<ol.Attribution>|undefined), * @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* defaultProjection: ol.proj.ProjectionLike, * defaultProjection: ol.proj.ProjectionLike,
* logo: (string|olx.LogoOptions|undefined), * logo: (string|olx.LogoOptions|undefined),
* object: (GeoJSONFeature|GeoJSONFeatureCollection|undefined), * object: (GeoJSONObject|undefined),
* projection: ol.proj.ProjectionLike, * projection: ol.proj.ProjectionLike,
* text: (string|undefined), * text: (string|undefined),
* url: (string|undefined), * url: (string|undefined),
@@ -3679,8 +3590,8 @@ olx.source.GeoJSONOptions.prototype.logo;
/** /**
* GeoJSON feature or feature collection. * Object.
* @type {GeoJSONFeature|GeoJSONFeatureCollection|undefined} * @type {GeoJSONObject|undefined}
* @api * @api
*/ */
olx.source.GeoJSONOptions.prototype.object; olx.source.GeoJSONOptions.prototype.object;
@@ -4343,8 +4254,7 @@ olx.source.KMLOptions.prototype.urls;
/** /**
* @typedef {{layer: string, * @typedef {{layer: string,
* tileLoadFunction: (ol.TileLoadFunctionType|undefined), * tileLoadFunction: (ol.TileLoadFunctionType|undefined)}}
* url: (string|undefined)}}
* @api * @api
*/ */
olx.source.MapQuestOptions; olx.source.MapQuestOptions;
@@ -4366,14 +4276,6 @@ olx.source.MapQuestOptions.prototype.layer;
olx.source.MapQuestOptions.prototype.tileLoadFunction; olx.source.MapQuestOptions.prototype.tileLoadFunction;
/**
* URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
* @type {string|undefined}
* @api
*/
olx.source.MapQuestOptions.prototype.url;
/** /**
* @typedef {{projection: ol.proj.ProjectionLike, * @typedef {{projection: ol.proj.ProjectionLike,
* tileGrid: (ol.tilegrid.TileGrid|undefined)}} * tileGrid: (ol.tilegrid.TileGrid|undefined)}}
@@ -4403,8 +4305,7 @@ olx.source.TileDebugOptions.prototype.tileGrid;
* crossOrigin: (null|string|undefined), * crossOrigin: (null|string|undefined),
* maxZoom: (number|undefined), * maxZoom: (number|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined), * tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* url: (string|undefined), * url: (string|undefined)}}
* wrapX: (boolean|undefined)}}
* @api * @api
*/ */
olx.source.OSMOptions; olx.source.OSMOptions;
@@ -4457,14 +4358,6 @@ olx.source.OSMOptions.prototype.tileLoadFunction;
olx.source.OSMOptions.prototype.url; olx.source.OSMOptions.prototype.url;
/**
* Whether to wrap the world horizontally. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.source.OSMOptions.prototype.wrapX;
/** /**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined), * @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* doc: (Document|undefined), * doc: (Document|undefined),
@@ -5010,97 +4903,9 @@ olx.source.ServerVectorOptions.prototype.logo;
*/ */
olx.source.ServerVectorOptions.prototype.projection; olx.source.ServerVectorOptions.prototype.projection;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* params: (Object.<string, *>|undefined),
* logo: (string|olx.LogoOptions|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),
* projection: ol.proj.ProjectionLike,
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* url: (string|undefined),
* urls: (Array.<string>|undefined)}}
* @api
*/
olx.source.TileArcGISRestOptions;
/** /**
* Attributions. * @typedef {{crossOrigin: (null|string|undefined),
* @type {Array.<ol.Attribution>|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.attributions;
/**
* ArcGIS Rest parameters. This field is optional. Service defaults will be
* used for any fields not specified. `FORMAT` is `PNG32` by default. `F` is `IMAGE` by
* default. `TRANSPARENT` is `true` by default. `BBOX, `SIZE`, `BBOXSR`,
* and `IMAGESR` will be set dynamically. Set `LAYERS` to
* override the default service layer visibility. See
* {@link http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/}
* for further reference.
* @type {Object.<string,*>|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.params;
/**
* Logo.
* @type {string|olx.LogoOptions|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.logo;
/**
* Tile grid. Base this on the resolutions, tilesize and extent supported by the
* server.
* If this is not defined, a default grid will be used: if there is a projection
* extent, the grid will be based on that; if not, a grid based on a global
* extent with origin at 0,0 will be used.
* @type {ol.tilegrid.TileGrid|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.tileGrid;
/**
* Projection.
* @type {ol.proj.ProjectionLike}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.projection;
/**
* Optional function to load a tile given a URL.
* @type {ol.TileLoadFunctionType|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.tileLoadFunction;
/**
* ArcGIS Rest service URL for a Map Service or Image Service. The
* url should include /MapServer or /ImageServer.
* @type {string|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.url;
/**
* ArcGIS Rest service urls. Use this instead of `url` when the ArcGIS Service supports multiple
* urls for export requests.
* @type {Array.<string>|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.urls;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* crossOrigin: (null|string|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined), * tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* url: string, * url: string,
* wrapX: (boolean|undefined)}} * wrapX: (boolean|undefined)}}
@@ -5109,16 +4914,6 @@ olx.source.TileArcGISRestOptions.prototype.urls;
olx.source.TileJSONOptions; olx.source.TileJSONOptions;
/**
* Optional attributions for the source. If provided, these will be used
* instead of any attribution data advertised by the server. If not provided,
* any attributions advertised by the server will be used.
* @type {Array.<ol.Attribution>|undefined}
* @api stable
*/
olx.source.TileJSONOptions.prototype.attributions;
/** /**
* The `crossOrigin` attribute for loaded images. Note that you must provide a * The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to * `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -5919,7 +5714,6 @@ olx.style.FillOptions.prototype.color;
* img: (Image|undefined), * img: (Image|undefined),
* offset: (Array.<number>|undefined), * offset: (Array.<number>|undefined),
* offsetOrigin: (ol.style.IconOrigin|undefined), * offsetOrigin: (ol.style.IconOrigin|undefined),
* opacity: (number|undefined),
* scale: (number|undefined), * scale: (number|undefined),
* snapToPixel: (boolean|undefined), * snapToPixel: (boolean|undefined),
* rotateWithView: (boolean|undefined), * rotateWithView: (boolean|undefined),
@@ -6009,14 +5803,6 @@ olx.style.IconOptions.prototype.offset;
olx.style.IconOptions.prototype.offsetOrigin; olx.style.IconOptions.prototype.offsetOrigin;
/**
* Opacity of the icon. Default is `1`.
* @type {number|undefined}
* @api
*/
olx.style.IconOptions.prototype.opacity;
/** /**
* Scale. * Scale.
* @type {number|undefined} * @type {number|undefined}
@@ -6719,13 +6505,6 @@ olx.ViewState;
olx.ViewState.prototype.center; olx.ViewState.prototype.center;
/**
* @type {ol.proj.Projection}
* @api
*/
olx.ViewState.prototype.projection;
/** /**
* @type {number} * @type {number}
* @api * @api

View File

@@ -1,6 +1,6 @@
{ {
"name": "openlayers", "name": "openlayers-test",
"version": "3.3.0", "version": "3.1.0-pre.4",
"description": "Build tools and sources for developing OpenLayers based mapping applications", "description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [ "keywords": [
"map", "map",
@@ -25,7 +25,7 @@
}, },
"dependencies": { "dependencies": {
"async": "0.9.0", "async": "0.9.0",
"closure-util": "1.3.0", "closure-util": "1.2.0",
"fs-extra": "0.12.0", "fs-extra": "0.12.0",
"graceful-fs": "3.0.2", "graceful-fs": "3.0.2",
"htmlparser2": "3.7.3", "htmlparser2": "3.7.3",

View File

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

View File

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

View File

@@ -69,33 +69,32 @@ ol.control.Attribution = function(opt_options) {
var tipLabel = goog.isDef(options.tipLabel) ? var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Attributions'; options.tipLabel : 'Attributions';
var collapseLabel = goog.isDef(options.collapseLabel) ? /**
* @private
* @type {string}
*/
this.collapseLabel_ = goog.isDef(options.collapseLabel) ?
options.collapseLabel : '\u00BB'; options.collapseLabel : '\u00BB';
/** /**
* @private * @private
* @type {Node} * @type {string}
*/ */
this.collapseLabel_ = /** @type {Node} */ (goog.isString(collapseLabel) ? this.label_ = goog.isDef(options.label) ? options.label : 'i';
goog.dom.createDom(goog.dom.TagName.SPAN, {}, collapseLabel) : var label = goog.dom.createDom(goog.dom.TagName.SPAN, {},
collapseLabel); (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_);
var label = goog.isDef(options.label) ? options.label : 'i';
/** /**
* @private * @private
* @type {Node} * @type {Element}
*/ */
this.label_ = /** @type {Node} */ (goog.isString(label) ? this.labelSpan_ = label;
goog.dom.createDom(goog.dom.TagName.SPAN, {}, label) :
label);
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom(goog.dom.TagName.BUTTON, {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}, activeLabel); }, this.labelSpan_);
goog.events.listen(button, goog.events.EventType.CLICK, goog.events.listen(button, goog.events.EventType.CLICK,
this.handleClick_, false, this); this.handleClick_, false, this);
@@ -342,11 +341,8 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
*/ */
ol.control.Attribution.prototype.handleToggle_ = function() { ol.control.Attribution.prototype.handleToggle_ = function() {
goog.dom.classlist.toggle(this.element, 'ol-collapsed'); goog.dom.classlist.toggle(this.element, 'ol-collapsed');
if (this.collapsed_) { goog.dom.setTextContent(this.labelSpan_,
goog.dom.replaceNode(this.collapseLabel_, this.label_); (this.collapsed_) ? this.collapseLabel_ : this.label_);
} else {
goog.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_; this.collapsed_ = !this.collapsed_;
}; };

View File

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

View File

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

View File

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

View File

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

View File

@@ -325,7 +325,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
++i; ++i;
} }
var html = count + ' ' + suffix; var html = count + suffix;
if (this.renderedHTML_ != html) { if (this.renderedHTML_ != html) {
this.innerElement_.innerHTML = html; this.innerElement_.innerHTML = html;
this.renderedHTML_ = html; this.renderedHTML_ = html;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -463,7 +463,7 @@ ol.extent.forEachCorner = function(extent, callback, opt_this) {
if (val) { if (val) {
return val; return val;
} }
val = callback.call(opt_this, ol.extent.getTopLeft(extent)); val = callback.call(opt_this, ol.extent.getBottomRight(extent));
if (val) { if (val) {
return val; return val;
} }

View File

@@ -78,7 +78,7 @@ ol.FeatureOverlay = function(opt_options) {
if (goog.isDef(options.features)) { if (goog.isDef(options.features)) {
if (goog.isArray(options.features)) { if (goog.isArray(options.features)) {
this.setFeatures(new ol.Collection(options.features.slice())); this.setFeatures(new ol.Collection(goog.array.clone(options.features)));
} else { } else {
goog.asserts.assertInstanceof(options.features, ol.Collection); goog.asserts.assertInstanceof(options.features, ol.Collection);
this.setFeatures(options.features); this.setFeatures(options.features);
@@ -112,15 +112,6 @@ ol.FeatureOverlay.prototype.getFeatures = function() {
}; };
/**
* @return {?ol.Map} The map with which this feature overlay is associated.
* @api
*/
ol.FeatureOverlay.prototype.getMap = function() {
return this.map_;
};
/** /**
* @private * @private
*/ */

View File

@@ -1,5 +1,6 @@
goog.provide('ol.format.Feature'); goog.provide('ol.format.Feature');
goog.require('goog.array');
goog.require('ol.geom.Geometry'); goog.require('ol.geom.Geometry');
goog.require('ol.proj'); goog.require('ol.proj');
@@ -40,7 +41,8 @@ ol.format.Feature.prototype.getExtensions = goog.abstractMethod;
* @return {olx.format.ReadOptions|undefined} Options. * @return {olx.format.ReadOptions|undefined} Options.
* @protected * @protected
*/ */
ol.format.Feature.prototype.getReadOptions = function(source, opt_options) { ol.format.Feature.prototype.getReadOptions = function(
source, opt_options) {
var options; var options;
if (goog.isDef(opt_options)) { if (goog.isDef(opt_options)) {
options = { options = {
@@ -62,7 +64,8 @@ ol.format.Feature.prototype.getReadOptions = function(source, opt_options) {
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined} * @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
* Updated options. * Updated options.
*/ */
ol.format.Feature.prototype.adaptOptions = function(options) { ol.format.Feature.prototype.adaptOptions = function(
options) {
var updatedOptions; var updatedOptions;
if (goog.isDef(options)) { if (goog.isDef(options)) {
updatedOptions = { updatedOptions = {
@@ -174,7 +177,7 @@ ol.format.Feature.transformWithOptions = function(
// FIXME this is necessary because ol.format.GML treats extents // FIXME this is necessary because ol.format.GML treats extents
// as geometries // as geometries
return ol.proj.transformExtent( return ol.proj.transformExtent(
write ? geometry.slice() : geometry, write ? goog.array.clone(geometry) : geometry,
write ? featureProjection : dataProjection, write ? featureProjection : dataProjection,
write ? dataProjection : featureProjection); write ? dataProjection : featureProjection);
} }

View File

@@ -64,7 +64,7 @@ ol.format.GeoJSON.EXTENSIONS_ = ['.geojson'];
/** /**
* @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object. * @param {GeoJSONObject} object Object.
* @param {olx.format.ReadOptions=} opt_options Read options. * @param {olx.format.ReadOptions=} opt_options Read options.
* @private * @private
* @return {ol.geom.Geometry} Geometry. * @return {ol.geom.Geometry} Geometry.
@@ -92,7 +92,7 @@ ol.format.GeoJSON.readGeometryCollectionGeometry_ = function(
goog.asserts.assert(object.type == 'GeometryCollection'); goog.asserts.assert(object.type == 'GeometryCollection');
var geometries = goog.array.map(object.geometries, var geometries = goog.array.map(object.geometries,
/** /**
* @param {GeoJSONGeometry} geometry Geometry. * @param {GeoJSONObject} geometry Geometry.
* @return {ol.geom.Geometry} geometry Geometry. * @return {ol.geom.Geometry} geometry Geometry.
*/ */
function(geometry) { function(geometry) {
@@ -505,17 +505,18 @@ ol.format.GeoJSON.prototype.writeFeatureObject = function(
}; };
var id = feature.getId(); var id = feature.getId();
if (goog.isDefAndNotNull(id)) { if (goog.isDefAndNotNull(id)) {
object['id'] = id; goog.object.set(object, 'id', id);
} }
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
if (goog.isDefAndNotNull(geometry)) { if (goog.isDefAndNotNull(geometry)) {
object['geometry'] = goog.object.set(
ol.format.GeoJSON.writeGeometry_(geometry, opt_options); object, 'geometry',
ol.format.GeoJSON.writeGeometry_(geometry, opt_options));
} }
var properties = feature.getProperties(); var properties = feature.getProperties();
goog.object.remove(properties, feature.getGeometryName()); goog.object.remove(properties, feature.getGeometryName());
if (!goog.object.isEmpty(properties)) { if (!goog.object.isEmpty(properties)) {
object['properties'] = properties; goog.object.set(object, 'properties', properties);
} }
return object; return object;
}; };

View File

@@ -1,7 +1,9 @@
goog.provide('ol.format.GML2'); goog.provide('ol.format.GML2');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.NodeType'); goog.require('goog.dom.NodeType');
goog.require('goog.object');
goog.require('ol.extent'); goog.require('ol.extent');
goog.require('ol.format.GML'); goog.require('ol.format.GML');
goog.require('ol.format.GMLBase'); goog.require('ol.format.GMLBase');
@@ -42,8 +44,8 @@ goog.inherits(ol.format.GML2, ol.format.GMLBase);
* @type {string} * @type {string}
* @private * @private
*/ */
ol.format.GML2.schemaLocation_ = ol.format.GMLBase.GMLNS + ol.format.GML2.schemaLocation_ = 'http://www.opengis.net/gml ' +
' http://schemas.opengis.net/gml/2.1.2/feature.xsd'; 'http://schemas.opengis.net/gml/2.1.2/feature.xsd';
/** /**
@@ -56,7 +58,7 @@ ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, ''); var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = objectStack[0]; var context = objectStack[0];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var containerSrs = context['srsName']; var containerSrs = goog.object.get(context, 'srsName');
var containerDimension = node.parentNode.getAttribute('srsDimension'); var containerDimension = node.parentNode.getAttribute('srsDimension');
var axisOrientation = 'enu'; var axisOrientation = 'enu';
if (!goog.isNull(containerSrs)) { if (!goog.isNull(containerSrs)) {

View File

@@ -3,6 +3,7 @@ goog.provide('ol.format.GML3');
goog.require('goog.array'); goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.NodeType'); goog.require('goog.dom.NodeType');
goog.require('goog.object'); goog.require('goog.object');
goog.require('ol.Feature'); goog.require('ol.Feature');
@@ -83,8 +84,8 @@ goog.inherits(ol.format.GML3, ol.format.GMLBase);
* @type {string} * @type {string}
* @private * @private
*/ */
ol.format.GML3.schemaLocation_ = ol.format.GMLBase.GMLNS + ol.format.GML3.schemaLocation_ = 'http://www.opengis.net/gml ' +
' http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/' + 'http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/' +
'1.0.0/gmlsf.xsd'; '1.0.0/gmlsf.xsd';
@@ -355,7 +356,7 @@ ol.format.GML3.prototype.readFlatPos_ = function(node, objectStack) {
} }
var context = objectStack[0]; var context = objectStack[0];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var containerSrs = context['srsName']; var containerSrs = goog.object.get(context, 'srsName');
var axisOrientation = 'enu'; var axisOrientation = 'enu';
if (!goog.isNull(containerSrs)) { if (!goog.isNull(containerSrs)) {
var proj = ol.proj.get(containerSrs); var proj = ol.proj.get(containerSrs);
@@ -391,7 +392,7 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, ''); var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = objectStack[0]; var context = objectStack[0];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var containerSrs = context['srsName']; var containerSrs = goog.object.get(context, 'srsName');
var containerDimension = node.parentNode.getAttribute('srsDimension'); var containerDimension = node.parentNode.getAttribute('srsDimension');
var axisOrientation = 'enu'; var axisOrientation = 'enu';
if (!goog.isNull(containerSrs)) { if (!goog.isNull(containerSrs)) {
@@ -613,7 +614,7 @@ ol.format.GML3.prototype.SEGMENTS_PARSERS_ = Object({
ol.format.GML3.prototype.writePos_ = function(node, value, objectStack) { ol.format.GML3.prototype.writePos_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
var axisOrientation = 'enu'; var axisOrientation = 'enu';
if (goog.isDefAndNotNull(srsName)) { if (goog.isDefAndNotNull(srsName)) {
axisOrientation = ol.proj.get(srsName).getAxisOrientation(); axisOrientation = ol.proj.get(srsName).getAxisOrientation();
@@ -656,7 +657,7 @@ ol.format.GML3.prototype.getCoords_ = function(point, opt_srsName) {
ol.format.GML3.prototype.writePosList_ = function(node, value, objectStack) { ol.format.GML3.prototype.writePosList_ = function(node, value, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
// only 2d for simple features profile // only 2d for simple features profile
var points = value.getCoordinates(); var points = value.getCoordinates();
var len = points.length; var len = points.length;
@@ -679,7 +680,7 @@ ol.format.GML3.prototype.writePosList_ = function(node, value, objectStack) {
ol.format.GML3.prototype.writePoint_ = function(node, geometry, objectStack) { ol.format.GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
if (goog.isDefAndNotNull(srsName)) { if (goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -710,7 +711,7 @@ ol.format.GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
goog.asserts.assert(extent.length == 4); goog.asserts.assert(extent.length == 4);
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
if (goog.isDef(srsName)) { if (goog.isDef(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -734,7 +735,7 @@ ol.format.GML3.prototype.writeLinearRing_ =
function(node, geometry, objectStack) { function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
if (goog.isDefAndNotNull(srsName)) { if (goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -756,9 +757,9 @@ ol.format.GML3.prototype.RING_NODE_FACTORY_ =
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
var parentNode = context.node; var parentNode = context.node;
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var exteriorWritten = context['exteriorWritten']; var exteriorWritten = goog.object.get(context, 'exteriorWritten');
if (!goog.isDef(exteriorWritten)) { if (!goog.isDef(exteriorWritten)) {
context['exteriorWritten'] = true; goog.object.set(context, 'exteriorWritten', true);
} }
return ol.xml.createElementNS(parentNode.namespaceURI, return ol.xml.createElementNS(parentNode.namespaceURI,
goog.isDef(exteriorWritten) ? 'interior' : 'exterior'); goog.isDef(exteriorWritten) ? 'interior' : 'exterior');
@@ -775,7 +776,7 @@ ol.format.GML3.prototype.writeSurfaceOrPolygon_ =
function(node, geometry, objectStack) { function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
if (node.nodeName !== 'PolygonPatch' && goog.isDefAndNotNull(srsName)) { if (node.nodeName !== 'PolygonPatch' && goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -805,7 +806,7 @@ ol.format.GML3.prototype.writeCurveOrLineString_ =
function(node, geometry, objectStack) { function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
if (node.nodeName !== 'LineStringSegment' && if (node.nodeName !== 'LineStringSegment' &&
goog.isDefAndNotNull(srsName)) { goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
@@ -834,8 +835,8 @@ ol.format.GML3.prototype.writeMultiSurfaceOrPolygon_ =
function(node, geometry, objectStack) { function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
var surface = context['surface']; var surface = goog.object.get(context, 'surface');
if (goog.isDefAndNotNull(srsName)) { if (goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -857,7 +858,7 @@ ol.format.GML3.prototype.writeMultiPoint_ = function(node, geometry,
objectStack) { objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
if (goog.isDefAndNotNull(srsName)) { if (goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -879,8 +880,8 @@ ol.format.GML3.prototype.writeMultiCurveOrLineString_ =
function(node, geometry, objectStack) { function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
var curve = context['curve']; var curve = goog.object.get(context, 'curve');
if (goog.isDefAndNotNull(srsName)) { if (goog.isDefAndNotNull(srsName)) {
node.setAttribute('srsName', srsName); node.setAttribute('srsName', srsName);
} }
@@ -1029,7 +1030,7 @@ ol.format.GML3.prototype.writeFeatureElement =
} }
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featureNS = context['featureNS']; var featureNS = goog.object.get(context, 'featureNS');
var geometryName = feature.getGeometryName(); var geometryName = feature.getGeometryName();
if (!goog.isDef(context.serializers)) { if (!goog.isDef(context.serializers)) {
context.serializers = {}; context.serializers = {};
@@ -1075,8 +1076,8 @@ ol.format.GML3.prototype.writeFeatureMembers_ =
function(node, features, objectStack) { function(node, features, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featureType = context['featureType']; var featureType = goog.object.get(context, 'featureType');
var featureNS = context['featureNS']; var featureNS = goog.object.get(context, 'featureNS');
var serializers = {}; var serializers = {};
serializers[featureNS] = {}; serializers[featureNS] = {};
serializers[featureNS][featureType] = ol.xml.makeChildAppender( serializers[featureNS][featureType] = ol.xml.makeChildAppender(
@@ -1218,10 +1219,10 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ =
function(value, objectStack, opt_nodeName) { function(value, objectStack, opt_nodeName) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var multiSurface = context['multiSurface']; var multiSurface = goog.object.get(context, 'multiSurface');
var surface = context['surface']; var surface = goog.object.get(context, 'surface');
var curve = context['curve']; var curve = goog.object.get(context, 'curve');
var multiCurve = context['multiCurve']; var multiCurve = goog.object.get(context, 'multiCurve');
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
goog.asserts.assert(ol.xml.isNode(parentNode)); goog.asserts.assert(ol.xml.isNode(parentNode));
var nodeName; var nodeName;
@@ -1342,7 +1343,7 @@ ol.format.GML.prototype.writeFeatures;
* Encode an array of features in the GML 3.1.1 format as an XML node. * Encode an array of features in the GML 3.1.1 format as an XML node.
* *
* @function * @function
* @param {Array.<ol.Feature>} features Features. * @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Options. * @param {olx.format.WriteOptions=} opt_options Options.
* @return {Node} Node. * @return {Node} Node.
* @api * @api

View File

@@ -5,6 +5,7 @@ goog.provide('ol.format.GMLBase');
goog.require('goog.array'); goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.NodeType'); goog.require('goog.dom.NodeType');
goog.require('goog.object'); goog.require('goog.object');
goog.require('goog.string'); goog.require('goog.string');
@@ -67,35 +68,18 @@ ol.format.GMLBase = function(opt_options) {
*/ */
this.schemaLocation = ''; this.schemaLocation = '';
/**
* @type {Object.<string, Object.<string, Object>>}
*/
this.FEATURE_COLLECTION_PARSERS = {};
this.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS] = {
'featureMember': ol.xml.makeReplacer(
ol.format.GMLBase.prototype.readFeaturesInternal),
'featureMembers': ol.xml.makeReplacer(
ol.format.GMLBase.prototype.readFeaturesInternal)
};
goog.base(this); goog.base(this);
}; };
goog.inherits(ol.format.GMLBase, ol.format.XMLFeature); goog.inherits(ol.format.GMLBase, ol.format.XMLFeature);
/**
* @const
* @type {string}
*/
ol.format.GMLBase.GMLNS = 'http://www.opengis.net/gml';
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack. * @param {Array.<*>} objectStack Object stack.
* @return {Array.<ol.Feature>} Features. * @return {Array.<ol.Feature>} Features.
* @private
*/ */
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) { ol.format.GMLBase.prototype.readFeatures_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
var localName = ol.xml.getLocalName(node); var localName = ol.xml.getLocalName(node);
var features; var features;
@@ -106,19 +90,19 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
} else if (localName == 'featureMembers' || localName == 'featureMember') { } else if (localName == 'featureMembers' || localName == 'featureMember') {
var context = objectStack[0]; var context = objectStack[0];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featureType = context['featureType']; var featureType = goog.object.get(context, 'featureType');
if (!goog.isDef(featureType) && !goog.isNull(node.firstElementChild)) { if (!goog.isDef(featureType) && !goog.isNull(node.firstElementChild)) {
var member = node.firstElementChild; var member = node.firstElementChild;
featureType = member.nodeName.split(':').pop(); featureType = member.nodeName.split(':').pop();
context['featureType'] = featureType; goog.object.set(context, 'featureType', featureType);
context['featureNS'] = member.namespaceURI; goog.object.set(context, 'featureNS', member.namespaceURI);
} }
var parsers = {}; var parsers = {};
var parsersNS = {}; var parsersNS = {};
parsers[featureType] = (localName == 'featureMembers') ? parsers[featureType] = (localName == 'featureMembers') ?
ol.xml.makeArrayPusher(this.readFeatureElement, this) : ol.xml.makeArrayPusher(this.readFeatureElement, this) :
ol.xml.makeReplacer(this.readFeatureElement, this); ol.xml.makeReplacer(this.readFeatureElement, this);
parsersNS[context['featureNS']] = parsers; parsersNS[goog.object.get(context, 'featureNS')] = parsers;
features = ol.xml.pushParseAndPop([], parsersNS, node, objectStack); features = ol.xml.pushParseAndPop([], parsersNS, node, objectStack);
} }
if (!goog.isDef(features)) { if (!goog.isDef(features)) {
@@ -128,6 +112,19 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
}; };
/**
* @type {Object.<string, Object.<string, Object>>}
*/
ol.format.GMLBase.prototype.FEATURE_COLLECTION_PARSERS = Object({
'http://www.opengis.net/gml': {
'featureMember': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.readFeatures_),
'featureMembers': ol.xml.makeReplacer(
ol.format.GMLBase.prototype.readFeatures_)
}
});
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack. * @param {Array.<*>} objectStack Object stack.
@@ -136,7 +133,8 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) { ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) {
var context = objectStack[0]; var context = objectStack[0];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
context['srsName'] = node.firstElementChild.getAttribute('srsName'); goog.object.set(context, 'srsName',
node.firstElementChild.getAttribute('srsName'));
var geometry = ol.xml.pushParseAndPop(/** @type {ol.geom.Geometry} */(null), var geometry = ol.xml.pushParseAndPop(/** @type {ol.geom.Geometry} */(null),
this.GEOMETRY_PARSERS_, node, objectStack, this); this.GEOMETRY_PARSERS_, node, objectStack, this);
if (goog.isDefAndNotNull(geometry)) { if (goog.isDefAndNotNull(geometry)) {
@@ -156,7 +154,7 @@ ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) {
ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) { ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
var n; var n;
var fid = node.getAttribute('fid') || var fid = node.getAttribute('fid') ||
ol.xml.getAttributeNS(node, ol.format.GMLBase.GMLNS, 'id'); ol.xml.getAttributeNS(node, 'http://www.opengis.net/gml', 'id');
var values = {}, geometryName; var values = {}, geometryName;
for (n = node.firstElementChild; !goog.isNull(n); for (n = node.firstElementChild; !goog.isNull(n);
n = n.nextElementSibling) { n = n.nextElementSibling) {
@@ -552,7 +550,7 @@ ol.format.GMLBase.prototype.readFeaturesFromNode =
if (goog.isDef(opt_options)) { if (goog.isDef(opt_options)) {
goog.object.extend(options, this.getReadOptions(node, opt_options)); goog.object.extend(options, this.getReadOptions(node, opt_options));
} }
return this.readFeaturesInternal(node, [options]); return this.readFeatures_(node, [options]);
}; };

View File

@@ -71,14 +71,14 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
parseFloat(node.getAttribute('lat'))); parseFloat(node.getAttribute('lat')));
if (goog.object.containsKey(values, 'ele')) { if (goog.object.containsKey(values, 'ele')) {
flatCoordinates.push( flatCoordinates.push(
/** @type {number} */ (values['ele'])); /** @type {number} */ (goog.object.get(values, 'ele')));
goog.object.remove(values, 'ele'); goog.object.remove(values, 'ele');
} else { } else {
flatCoordinates.push(0); flatCoordinates.push(0);
} }
if (goog.object.containsKey(values, 'time')) { if (goog.object.containsKey(values, 'time')) {
flatCoordinates.push( flatCoordinates.push(
/** @type {number} */ (values['time'])); /** @type {number} */ (goog.object.get(values, 'time')));
goog.object.remove(values, 'time'); goog.object.remove(values, 'time');
} else { } else {
flatCoordinates.push(0); flatCoordinates.push(0);
@@ -98,7 +98,7 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var href = node.getAttribute('href'); var href = node.getAttribute('href');
if (!goog.isNull(href)) { if (!goog.isNull(href)) {
values['link'] = href; goog.object.set(values, 'link', href);
} }
ol.xml.parseNode(ol.format.GPX.LINK_PARSERS_, node, objectStack); ol.xml.parseNode(ol.format.GPX.LINK_PARSERS_, node, objectStack);
}; };
@@ -113,7 +113,7 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'extensions'); goog.asserts.assert(node.localName == 'extensions');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values['extensionsNode_'] = node; goog.object.set(values, 'extensionsNode_', node);
}; };
@@ -130,7 +130,7 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
if (goog.isDef(values)) { if (goog.isDef(values)) {
var rteValues = /** @type {Object} */ (objectStack[objectStack.length - 1]); var rteValues = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var flatCoordinates = /** @type {Array.<number>} */ var flatCoordinates = /** @type {Array.<number>} */
(rteValues['flatCoordinates']); (goog.object.get(rteValues, 'flatCoordinates'));
ol.format.GPX.appendCoordinate_(flatCoordinates, node, values); ol.format.GPX.appendCoordinate_(flatCoordinates, node, values);
} }
}; };
@@ -149,7 +149,7 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
if (goog.isDef(values)) { if (goog.isDef(values)) {
var trkValues = /** @type {Object} */ (objectStack[objectStack.length - 1]); var trkValues = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var flatCoordinates = /** @type {Array.<number>} */ var flatCoordinates = /** @type {Array.<number>} */
(trkValues['flatCoordinates']); (goog.object.get(trkValues, 'flatCoordinates'));
ol.format.GPX.appendCoordinate_(flatCoordinates, node, values); ol.format.GPX.appendCoordinate_(flatCoordinates, node, values);
} }
}; };
@@ -166,8 +166,8 @@ ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
ol.xml.parseNode(ol.format.GPX.TRKSEG_PARSERS_, node, objectStack); ol.xml.parseNode(ol.format.GPX.TRKSEG_PARSERS_, node, objectStack);
var flatCoordinates = /** @type {Array.<number>} */ var flatCoordinates = /** @type {Array.<number>} */
(values['flatCoordinates']); (goog.object.get(values, 'flatCoordinates'));
var ends = /** @type {Array.<number>} */ (values['ends']); var ends = /** @type {Array.<number>} */ (goog.object.get(values, 'ends'));
ends.push(flatCoordinates.length); ends.push(flatCoordinates.length);
}; };
@@ -189,7 +189,7 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
return undefined; return undefined;
} }
var flatCoordinates = /** @type {Array.<number>} */ var flatCoordinates = /** @type {Array.<number>} */
(values['flatCoordinates']); (goog.object.get(values, 'flatCoordinates'));
goog.object.remove(values, 'flatCoordinates'); goog.object.remove(values, 'flatCoordinates');
var geometry = new ol.geom.LineString(null); var geometry = new ol.geom.LineString(null);
geometry.setFlatCoordinates(ol.geom.GeometryLayout.XYZM, flatCoordinates); geometry.setFlatCoordinates(ol.geom.GeometryLayout.XYZM, flatCoordinates);
@@ -218,9 +218,9 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
return undefined; return undefined;
} }
var flatCoordinates = /** @type {Array.<number>} */ var flatCoordinates = /** @type {Array.<number>} */
(values['flatCoordinates']); (goog.object.get(values, 'flatCoordinates'));
goog.object.remove(values, 'flatCoordinates'); goog.object.remove(values, 'flatCoordinates');
var ends = /** @type {Array.<number>} */ (values['ends']); var ends = /** @type {Array.<number>} */ (goog.object.get(values, 'ends'));
goog.object.remove(values, 'ends'); goog.object.remove(values, 'ends');
var geometry = new ol.geom.MultiLineString(null); var geometry = new ol.geom.MultiLineString(null);
geometry.setFlatCoordinates( geometry.setFlatCoordinates(
@@ -501,6 +501,22 @@ ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
ol.format.GPX.prototype.readProjection; ol.format.GPX.prototype.readProjection;
/**
* @inheritDoc
*/
ol.format.GPX.prototype.readProjectionFromDocument = function(doc) {
return this.defaultDataProjection;
};
/**
* @inheritDoc
*/
ol.format.GPX.prototype.readProjectionFromNode = function(node) {
return this.defaultDataProjection;
};
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {string} value Value for the link's `href` attribute. * @param {string} value Value for the link's `href` attribute.
@@ -511,10 +527,10 @@ ol.format.GPX.writeLink_ = function(node, value, objectStack) {
node.setAttribute('href', value); node.setAttribute('href', value);
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var properties = context['properties']; var properties = goog.object.get(context, 'properties');
var link = [ var link = [
properties['linkText'], goog.object.get(properties, 'linkText'),
properties['linkType'] goog.object.get(properties, 'linkType')
]; ];
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ ({node: node}), ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ ({node: node}),
ol.format.GPX.LINK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY, ol.format.GPX.LINK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
@@ -534,25 +550,25 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
var parentNode = context.node; var parentNode = context.node;
goog.asserts.assert(ol.xml.isNode(parentNode)); goog.asserts.assert(ol.xml.isNode(parentNode));
var namespaceURI = parentNode.namespaceURI; var namespaceURI = parentNode.namespaceURI;
var properties = context['properties']; var properties = goog.object.get(context, 'properties');
//FIXME Projection handling //FIXME Projection handling
ol.xml.setAttributeNS(node, null, 'lat', coordinate[1]); ol.xml.setAttributeNS(node, null, 'lat', coordinate[1]);
ol.xml.setAttributeNS(node, null, 'lon', coordinate[0]); ol.xml.setAttributeNS(node, null, 'lon', coordinate[0]);
var geometryLayout = context['geometryLayout']; var geometryLayout = goog.object.get(context, 'geometryLayout');
/* jshint -W086 */ /* jshint -W086 */
switch (geometryLayout) { switch (geometryLayout) {
case ol.geom.GeometryLayout.XYZM: case ol.geom.GeometryLayout.XYZM:
if (coordinate[3] !== 0) { if (coordinate[3] !== 0) {
properties['time'] = coordinate[3]; goog.object.set(properties, 'time', coordinate[3]);
} }
case ol.geom.GeometryLayout.XYZ: case ol.geom.GeometryLayout.XYZ:
if (coordinate[2] !== 0) { if (coordinate[2] !== 0) {
properties['ele'] = coordinate[2]; goog.object.set(properties, 'ele', coordinate[2]);
} }
break; break;
case ol.geom.GeometryLayout.XYM: case ol.geom.GeometryLayout.XYM:
if (coordinate[2] !== 0) { if (coordinate[2] !== 0) {
properties['time'] = coordinate[2]; goog.object.set(properties, 'time', coordinate[2]);
} }
} }
/* jshint +W086 */ /* jshint +W086 */
@@ -580,8 +596,8 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
goog.asserts.assertInstanceof(geometry, ol.geom.LineString); goog.asserts.assertInstanceof(geometry, ol.geom.LineString);
geometry = /** @type {ol.geom.LineString} */ geometry = /** @type {ol.geom.LineString} */
(ol.format.Feature.transformWithOptions(geometry, true, options)); (ol.format.Feature.transformWithOptions(geometry, true, options));
context['geometryLayout'] = geometry.getLayout(); goog.object.set(context, 'geometryLayout', geometry.getLayout());
properties['rtept'] = geometry.getCoordinates(); goog.object.set(properties, 'rtept', geometry.getCoordinates());
} }
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.GPX.RTE_SEQUENCE_[parentNode.namespaceURI]; var orderedKeys = ol.format.GPX.RTE_SEQUENCE_[parentNode.namespaceURI];
@@ -607,7 +623,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
goog.asserts.assertInstanceof(geometry, ol.geom.MultiLineString); goog.asserts.assertInstanceof(geometry, ol.geom.MultiLineString);
geometry = /** @type {ol.geom.MultiLineString} */ geometry = /** @type {ol.geom.MultiLineString} */
(ol.format.Feature.transformWithOptions(geometry, true, options)); (ol.format.Feature.transformWithOptions(geometry, true, options));
properties['trkseg'] = geometry.getLineStrings(); goog.object.set(properties, 'trkseg', geometry.getLineStrings());
} }
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.GPX.TRK_SEQUENCE_[parentNode.namespaceURI]; var orderedKeys = ol.format.GPX.TRK_SEQUENCE_[parentNode.namespaceURI];
@@ -643,13 +659,13 @@ ol.format.GPX.writeWpt_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]); var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
context['properties'] = feature.getProperties(); goog.object.set(context, 'properties', feature.getProperties());
var geometry = feature.getGeometry(); var geometry = feature.getGeometry();
if (goog.isDef(geometry)) { if (goog.isDef(geometry)) {
goog.asserts.assertInstanceof(geometry, ol.geom.Point); goog.asserts.assertInstanceof(geometry, ol.geom.Point);
geometry = /** @type {ol.geom.Point} */ geometry = /** @type {ol.geom.Point} */
(ol.format.Feature.transformWithOptions(geometry, true, options)); (ol.format.Feature.transformWithOptions(geometry, true, options));
context['geometryLayout'] = geometry.getLayout(); goog.object.set(context, 'geometryLayout', geometry.getLayout());
ol.format.GPX.writeWptType_(node, geometry.getCoordinates(), objectStack); ol.format.GPX.writeWptType_(node, geometry.getCoordinates(), objectStack);
} }
}; };
@@ -738,7 +754,10 @@ ol.format.GPX.TRK_SERIALIZERS_ = ol.xml.makeStructureNS(
/** /**
* @const * @const
* @type {function(*, Array.<*>, string=): (Node|undefined)} * @param {*} value Value.
* @param {Array.<*>} objectStack Object stack.
* @param {string=} opt_nodeName Node name.
* @return {Node|undefined} Node.
* @private * @private
*/ */
ol.format.GPX.TRKSEG_NODE_FACTORY_ = ol.xml.makeSimpleNodeFactory('trkpt'); ol.format.GPX.TRKSEG_NODE_FACTORY_ = ol.xml.makeSimpleNodeFactory('trkpt');

View File

@@ -218,3 +218,11 @@ ol.format.IGC.prototype.readFeaturesFromText = function(text, opt_options) {
* @api * @api
*/ */
ol.format.IGC.prototype.readProjection; ol.format.IGC.prototype.readProjection;
/**
* @inheritDoc
*/
ol.format.IGC.prototype.readProjectionFromText = function(text) {
return this.defaultDataProjection;
};

View File

@@ -208,7 +208,7 @@ ol.format.KML.DEFAULT_FILL_STYLE_ = new ol.style.Fill({
* @type {ol.Size} * @type {ol.Size}
* @private * @private
*/ */
ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_ = [20, 2]; // FIXME maybe [8, 32] ? ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_ = [2, 20]; // FIXME maybe [8, 32] ?
/** /**
@@ -234,7 +234,7 @@ ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_ =
* @type {ol.Size} * @type {ol.Size}
* @private * @private
*/ */
ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_ = [64, 64]; ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_ = [32, 32];
/** /**
@@ -253,12 +253,11 @@ ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_ =
*/ */
ol.format.KML.DEFAULT_IMAGE_STYLE_ = new ol.style.Icon({ ol.format.KML.DEFAULT_IMAGE_STYLE_ = new ol.style.Icon({
anchor: ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_, anchor: ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_,
anchorOrigin: ol.style.IconOrigin.BOTTOM_LEFT,
anchorXUnits: ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_, anchorXUnits: ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_X_UNITS_,
anchorYUnits: ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_, anchorYUnits: ol.format.KML.DEFAULT_IMAGE_STYLE_ANCHOR_Y_UNITS_,
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
rotation: 0, rotation: 0,
scale: 0.5, scale: 1,
size: ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_, size: ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_,
src: ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_ src: ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_
}); });
@@ -473,7 +472,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
var IconObject = /** @type {Object} */ (goog.object.get(object, 'Icon', {})); var IconObject = /** @type {Object} */ (goog.object.get(object, 'Icon', {}));
var src; var src;
var href = /** @type {string|undefined} */ var href = /** @type {string|undefined} */
(IconObject['href']); (goog.object.get(IconObject, 'href'));
if (goog.isDef(href)) { if (goog.isDef(href)) {
src = href; src = href;
} else { } else {
@@ -481,7 +480,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
} }
var anchor, anchorXUnits, anchorYUnits; var anchor, anchorXUnits, anchorYUnits;
var hotSpot = /** @type {ol.format.KMLVec2_|undefined} */ var hotSpot = /** @type {ol.format.KMLVec2_|undefined} */
(object['hotSpot']); (goog.object.get(object, 'hotSpot'));
if (goog.isDef(hotSpot)) { if (goog.isDef(hotSpot)) {
anchor = [hotSpot.x, hotSpot.y]; anchor = [hotSpot.x, hotSpot.y];
anchorXUnits = hotSpot.xunits; anchorXUnits = hotSpot.xunits;
@@ -498,31 +497,31 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
var offset; var offset;
var x = /** @type {number|undefined} */ var x = /** @type {number|undefined} */
(IconObject['x']); (goog.object.get(IconObject, 'x'));
var y = /** @type {number|undefined} */ var y = /** @type {number|undefined} */
(IconObject['y']); (goog.object.get(IconObject, 'y'));
if (goog.isDef(x) && goog.isDef(y)) { if (goog.isDef(x) && goog.isDef(y)) {
offset = [x, y]; offset = [x, y];
} }
var size; var size;
var w = /** @type {number|undefined} */ var w = /** @type {number|undefined} */
(IconObject['w']); (goog.object.get(IconObject, 'w'));
var h = /** @type {number|undefined} */ var h = /** @type {number|undefined} */
(IconObject['h']); (goog.object.get(IconObject, 'h'));
if (goog.isDef(w) && goog.isDef(h)) { if (goog.isDef(w) && goog.isDef(h)) {
size = [w, h]; size = [w, h];
} }
var rotation; var rotation;
var heading = /** @type {number|undefined} */ var heading = /** @type {number|undefined} */
(object['heading']); (goog.object.get(object, 'heading'));
if (goog.isDef(heading)) { if (goog.isDef(heading)) {
rotation = goog.math.toRadians(heading); rotation = goog.math.toRadians(heading);
} }
var scale = /** @type {number|undefined} */ var scale = /** @type {number|undefined} */
(object['scale']); (goog.object.get(object, 'scale'));
if (src == ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_) { if (src == ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_) {
size = ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_; size = ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_;
} }
@@ -540,7 +539,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
size: size, size: size,
src: src src: src
}); });
styleObject['imageStyle'] = imageStyle; goog.object.set(styleObject, 'imageStyle', imageStyle);
}; };
@@ -566,9 +565,9 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
(goog.object.get(object, 'color', ol.format.KML.DEFAULT_COLOR_)) (goog.object.get(object, 'color', ol.format.KML.DEFAULT_COLOR_))
}), }),
scale: /** @type {number|undefined} */ scale: /** @type {number|undefined} */
(object['scale']) (goog.object.get(object, 'scale'))
}); });
styleObject['textStyle'] = textStyle; goog.object.set(styleObject, 'textStyle', textStyle);
}; };
@@ -597,7 +596,7 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
(goog.object.get(object, 'color', ol.format.KML.DEFAULT_COLOR_)), (goog.object.get(object, 'color', ol.format.KML.DEFAULT_COLOR_)),
width: /** @type {number} */ (goog.object.get(object, 'width', 1)) width: /** @type {number} */ (goog.object.get(object, 'width', 1))
}); });
styleObject['strokeStyle'] = strokeStyle; goog.object.set(styleObject, 'strokeStyle', strokeStyle);
}; };
@@ -621,15 +620,15 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
color: /** @type {ol.Color} */ color: /** @type {ol.Color} */
(goog.object.get(object, 'color', ol.format.KML.DEFAULT_COLOR_)) (goog.object.get(object, 'color', ol.format.KML.DEFAULT_COLOR_))
}); });
styleObject['fillStyle'] = fillStyle; goog.object.set(styleObject, 'fillStyle', fillStyle);
var fill = /** @type {boolean|undefined} */ (object['fill']); var fill = /** @type {boolean|undefined} */ (goog.object.get(object, 'fill'));
if (goog.isDef(fill)) { if (goog.isDef(fill)) {
styleObject['fill'] = fill; goog.object.set(styleObject, 'fill', fill);
} }
var outline = var outline =
/** @type {boolean|undefined} */ (object['outline']); /** @type {boolean|undefined} */ (goog.object.get(object, 'outline'));
if (goog.isDef(outline)) { if (goog.isDef(outline)) {
styleObject['outline'] = outline; goog.object.set(styleObject, 'outline', outline);
} }
}; };
@@ -945,7 +944,7 @@ ol.format.KML.readStyle_ = function(node, objectStack) {
var fillStyle = /** @type {ol.style.Fill} */ (goog.object.get( var fillStyle = /** @type {ol.style.Fill} */ (goog.object.get(
styleObject, 'fillStyle', ol.format.KML.DEFAULT_FILL_STYLE_)); styleObject, 'fillStyle', ol.format.KML.DEFAULT_FILL_STYLE_));
var fill = /** @type {boolean|undefined} */ var fill = /** @type {boolean|undefined} */
(styleObject['fill']); (goog.object.get(styleObject, 'fill'));
if (goog.isDef(fill) && !fill) { if (goog.isDef(fill) && !fill) {
fillStyle = null; fillStyle = null;
} }
@@ -956,7 +955,7 @@ ol.format.KML.readStyle_ = function(node, objectStack) {
var strokeStyle = /** @type {ol.style.Stroke} */ (goog.object.get( var strokeStyle = /** @type {ol.style.Stroke} */ (goog.object.get(
styleObject, 'strokeStyle', ol.format.KML.DEFAULT_STROKE_STYLE_)); styleObject, 'strokeStyle', ol.format.KML.DEFAULT_STROKE_STYLE_));
var outline = /** @type {boolean|undefined} */ var outline = /** @type {boolean|undefined} */
(styleObject['outline']); (goog.object.get(styleObject, 'outline'));
if (goog.isDef(outline) && !outline) { if (goog.isDef(outline) && !outline) {
strokeStyle = null; strokeStyle = null;
} }
@@ -986,7 +985,7 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
var featureObject = var featureObject =
/** @type {Object} */ (objectStack[objectStack.length - 1]); /** @type {Object} */ (objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isObject(featureObject)); goog.asserts.assert(goog.isObject(featureObject));
featureObject[name] = data; goog.object.set(featureObject, name, data);
} }
} }
}; };
@@ -1018,15 +1017,15 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
return; return;
} }
var key = /** @type {string|undefined} */ var key = /** @type {string|undefined} */
(pairObject['key']); (goog.object.get(pairObject, 'key'));
if (goog.isDef(key) && key == 'normal') { if (goog.isDef(key) && key == 'normal') {
var styleUrl = /** @type {string|undefined} */ var styleUrl = /** @type {string|undefined} */
(pairObject['styleUrl']); (goog.object.get(pairObject, 'styleUrl'));
if (goog.isDef(styleUrl)) { if (goog.isDef(styleUrl)) {
objectStack[objectStack.length - 1] = styleUrl; objectStack[objectStack.length - 1] = styleUrl;
} }
var Style = /** @type {ol.style.Style} */ var Style = /** @type {ol.style.Style} */
(pairObject['Style']); (goog.object.get(pairObject, 'Style'));
if (goog.isDef(Style)) { if (goog.isDef(Style)) {
objectStack[objectStack.length - 1] = Style; objectStack[objectStack.length - 1] = Style;
} }
@@ -1049,9 +1048,9 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
var placemarkObject = objectStack[objectStack.length - 1]; var placemarkObject = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(placemarkObject)); goog.asserts.assert(goog.isObject(placemarkObject));
if (goog.isArray(styleMapValue)) { if (goog.isArray(styleMapValue)) {
placemarkObject['Style'] = styleMapValue; goog.object.set(placemarkObject, 'Style', styleMapValue);
} else if (goog.isString(styleMapValue)) { } else if (goog.isString(styleMapValue)) {
placemarkObject['styleUrl'] = styleMapValue; goog.object.set(placemarkObject, 'styleUrl', styleMapValue);
} else { } else {
goog.asserts.fail(); goog.asserts.fail();
} }
@@ -1083,7 +1082,7 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
var data = ol.format.XSD.readString(node); var data = ol.format.XSD.readString(node);
var featureObject = var featureObject =
/** @type {Object} */ (objectStack[objectStack.length - 1]); /** @type {Object} */ (objectStack[objectStack.length - 1]);
featureObject[name] = data; goog.object.set(featureObject, name, data);
} }
}; };
@@ -1130,18 +1129,6 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
}; };
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @private
*/
ol.format.KML.LinkParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Link');
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
};
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack. * @param {Array.<*>} objectStack Object stack.
@@ -1343,35 +1330,6 @@ ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeParsersNS(
}); });
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeParsersNS(
ol.format.KML.NAMESPACE_URIS_, {
'ExtendedData': ol.format.KML.ExtendedDataParser_,
'Link': ol.format.KML.LinkParser_,
'address': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'description': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'name': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'open': ol.xml.makeObjectPropertySetter(ol.format.XSD.readBoolean),
'phoneNumber': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
'visibility': ol.xml.makeObjectPropertySetter(ol.format.XSD.readBoolean)
});
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.KML.LINK_PARSERS_ = ol.xml.makeParsersNS(
ol.format.KML.NAMESPACE_URIS_, {
'href': ol.xml.makeObjectPropertySetter(ol.format.KML.readURI_)
});
/** /**
* @const * @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>} * @type {Object.<string, Object.<string, ol.xml.Parser>>}
@@ -1752,71 +1710,6 @@ ol.format.KML.prototype.readNameFromNode = function(node) {
}; };
/**
* @param {Document|Node|string} source Souce.
* @return {Array.<Object>} Network links.
* @api
*/
ol.format.KML.prototype.readNetworkLinks = function(source) {
var networkLinks = [];
if (ol.xml.isDocument(source)) {
goog.array.extend(networkLinks, this.readNetworkLinksFromDocument(
/** @type {Document} */ (source)));
} else if (ol.xml.isNode(source)) {
goog.array.extend(networkLinks, this.readNetworkLinksFromNode(
/** @type {Node} */ (source)));
} else if (goog.isString(source)) {
var doc = ol.xml.parse(source);
goog.array.extend(networkLinks, this.readNetworkLinksFromDocument(doc));
} else {
goog.asserts.fail();
}
return networkLinks;
};
/**
* @param {Document} doc Document.
* @return {Array.<Object>} Network links.
*/
ol.format.KML.prototype.readNetworkLinksFromDocument = function(doc) {
var n, networkLinks = [];
for (n = doc.firstChild; !goog.isNull(n); n = n.nextSibling) {
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
goog.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
}
}
return networkLinks;
};
/**
* @param {Node} node Node.
* @return {Array.<Object>} Network links.
*/
ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
var n, networkLinks = [];
for (n = node.firstElementChild; !goog.isNull(n); n = n.nextElementSibling) {
if (goog.array.contains(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
n.localName == 'NetworkLink') {
var obj = ol.xml.pushParseAndPop({}, ol.format.KML.NETWORK_LINK_PARSERS_,
n, []);
networkLinks.push(obj);
}
}
for (n = node.firstElementChild; !goog.isNull(n); n = n.nextElementSibling) {
var localName = ol.xml.getLocalName(n);
if (goog.array.contains(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
(localName == 'Document' ||
localName == 'Folder' ||
localName == 'kml')) {
goog.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
}
}
return networkLinks;
};
/** /**
* Read the projection from a KML source. * Read the projection from a KML source.
* *
@@ -1828,6 +1721,22 @@ ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
ol.format.KML.prototype.readProjection; ol.format.KML.prototype.readProjection;
/**
* @inheritDoc
*/
ol.format.KML.prototype.readProjectionFromDocument = function(doc) {
return this.defaultDataProjection;
};
/**
* @inheritDoc
*/
ol.format.KML.prototype.readProjectionFromNode = function(node) {
return this.defaultDataProjection;
};
/** /**
* @param {Node} node Node to append a TextNode with the color to. * @param {Node} node Node to append a TextNode with the color to.
* @param {ol.Color|string} color Color. * @param {ol.Color|string} color Color.
@@ -1857,8 +1766,8 @@ ol.format.KML.writeCoordinatesTextNode_ =
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var layout = context['layout']; var layout = goog.object.get(context, 'layout');
var stride = context['stride']; var stride = goog.object.get(context, 'stride');
var dimension; var dimension;
if (layout == ol.geom.GeometryLayout.XY || if (layout == ol.geom.GeometryLayout.XY ||
@@ -1942,15 +1851,16 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
}; };
if (!goog.isNull(size)) { if (!goog.isNull(size)) {
iconProperties['w'] = size[0]; goog.object.set(iconProperties, 'w', size[0]);
iconProperties['h'] = size[1]; goog.object.set(iconProperties, 'h', size[1]);
var anchor = style.getAnchor(); // top-left var anchor = style.getAnchor(); // top-left
var origin = style.getOrigin(); // top-left var origin = style.getOrigin(); // top-left
if (!goog.isNull(origin) && !goog.isNull(iconImageSize) && if (!goog.isNull(origin) && !goog.isNull(iconImageSize) &&
origin[0] !== 0 && origin[1] !== size[1]) { origin[0] !== 0 && origin[1] !== size[1]) {
iconProperties['x'] = origin[0]; goog.object.set(iconProperties, 'x', origin[0]);
iconProperties['y'] = iconImageSize[1] - (origin[1] + size[1]); goog.object.set(iconProperties, 'y',
iconImageSize[1] - (origin[1] + size[1]));
} }
if (!goog.isNull(anchor) && if (!goog.isNull(anchor) &&
@@ -1961,20 +1871,20 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
y: size[1] - anchor[1], y: size[1] - anchor[1],
yunits: ol.style.IconAnchorUnits.PIXELS yunits: ol.style.IconAnchorUnits.PIXELS
}; };
properties['hotSpot'] = hotSpot; goog.object.set(properties, 'hotSpot', hotSpot);
} }
} }
properties['Icon'] = iconProperties; goog.object.set(properties, 'Icon', iconProperties);
var scale = style.getScale(); var scale = style.getScale();
if (scale !== 1) { if (scale !== 1) {
properties['scale'] = scale; goog.object.set(properties, 'scale', scale);
} }
var rotation = style.getRotation(); var rotation = style.getRotation();
if (rotation !== 0) { if (rotation !== 0) {
properties['heading'] = rotation; // 0-360 goog.object.set(properties, 'heading', rotation); // 0-360
} }
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
@@ -1996,11 +1906,11 @@ ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
var properties = {}; var properties = {};
var fill = style.getFill(); var fill = style.getFill();
if (!goog.isNull(fill)) { if (!goog.isNull(fill)) {
properties['color'] = fill.getColor(); goog.object.set(properties, 'color', fill.getColor());
} }
var scale = style.getScale(); var scale = style.getScale();
if (goog.isDef(scale) && scale !== 1) { if (goog.isDef(scale) && scale !== 1) {
properties['scale'] = scale; goog.object.set(properties, 'scale', scale);
} }
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = var orderedKeys =
@@ -2109,10 +2019,10 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
// resolution-independent here // resolution-independent here
var styles = styleFunction.call(feature, 0); var styles = styleFunction.call(feature, 0);
if (!goog.isNull(styles) && styles.length > 0) { if (!goog.isNull(styles) && styles.length > 0) {
properties['Style'] = styles[0]; goog.object.set(properties, 'Style', styles[0]);
var textStyle = styles[0].getText(); var textStyle = styles[0].getText();
if (!goog.isNull(textStyle)) { if (!goog.isNull(textStyle)) {
properties['name'] = textStyle.getText(); goog.object.set(properties, 'name', textStyle.getText());
} }
} }
} }
@@ -2147,8 +2057,8 @@ ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
(geometry instanceof ol.geom.LinearRing)); (geometry instanceof ol.geom.LinearRing));
var flatCoordinates = geometry.getFlatCoordinates(); var flatCoordinates = geometry.getFlatCoordinates();
var /** @type {ol.xml.NodeStackItem} */ context = {node: node}; var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
context['layout'] = geometry.getLayout(); goog.object.set(context, 'layout', geometry.getLayout());
context['stride'] = geometry.getStride(); goog.object.set(context, 'stride', geometry.getStride());
ol.xml.pushSerializeAndPop(context, ol.xml.pushSerializeAndPop(context,
ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_, ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_,
ol.format.KML.COORDINATES_NODE_FACTORY_, ol.format.KML.COORDINATES_NODE_FACTORY_,
@@ -2218,16 +2128,16 @@ ol.format.KML.writeStyle_ = function(node, style, objectStack) {
var imageStyle = style.getImage(); var imageStyle = style.getImage();
var textStyle = style.getText(); var textStyle = style.getText();
if (!goog.isNull(imageStyle)) { if (!goog.isNull(imageStyle)) {
properties['IconStyle'] = imageStyle; goog.object.set(properties, 'IconStyle', imageStyle);
} }
if (!goog.isNull(textStyle)) { if (!goog.isNull(textStyle)) {
properties['LabelStyle'] = textStyle; goog.object.set(properties, 'LabelStyle', textStyle);
} }
if (!goog.isNull(strokeStyle)) { if (!goog.isNull(strokeStyle)) {
properties['LineStyle'] = strokeStyle; goog.object.set(properties, 'LineStyle', strokeStyle);
} }
if (!goog.isNull(fillStyle)) { if (!goog.isNull(fillStyle)) {
properties['PolyStyle'] = fillStyle; goog.object.set(properties, 'PolyStyle', fillStyle);
} }
var parentNode = objectStack[objectStack.length - 1].node; var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.KML.STYLE_SEQUENCE_[parentNode.namespaceURI]; var orderedKeys = ol.format.KML.STYLE_SEQUENCE_[parentNode.namespaceURI];
@@ -2698,9 +2608,9 @@ ol.format.KML.prototype.writeFeaturesNode = function(features, opt_options) {
var /** @type {ol.xml.NodeStackItem} */ context = {node: kml}; var /** @type {ol.xml.NodeStackItem} */ context = {node: kml};
var properties = {}; var properties = {};
if (features.length > 1) { if (features.length > 1) {
properties['Document'] = features; goog.object.set(properties, 'Document', features);
} else if (features.length == 1) { } else if (features.length == 1) {
properties['Placemark'] = features[0]; goog.object.set(properties, 'Placemark', features[0]);
} }
var orderedKeys = ol.format.KML.KML_SEQUENCE_[kml.namespaceURI]; var orderedKeys = ol.format.KML.KML_SEQUENCE_[kml.namespaceURI];
var values = ol.xml.makeSequence(properties, orderedKeys); var values = ol.xml.makeSequence(properties, orderedKeys);

View File

@@ -67,7 +67,7 @@ ol.format.OSMXML.readNode_ = function(node, objectStack) {
parseFloat(node.getAttribute('lon')), parseFloat(node.getAttribute('lon')),
parseFloat(node.getAttribute('lat')) parseFloat(node.getAttribute('lat'))
]); ]);
state.nodes[id] = coordinates; goog.object.set(state.nodes, id, coordinates);
var values = ol.xml.pushParseAndPop({ var values = ol.xml.pushParseAndPop({
tags: {} tags: {}
@@ -100,7 +100,7 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) {
var state = /** @type {Object} */ (objectStack[objectStack.length - 1]); var state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
var flatCoordinates = /** @type {Array.<number>} */ ([]); var flatCoordinates = /** @type {Array.<number>} */ ([]);
for (var i = 0, ii = values.ndrefs.length; i < ii; i++) { for (var i = 0, ii = values.ndrefs.length; i < ii; i++) {
var point = state.nodes[values.ndrefs[i]]; var point = goog.object.get(state.nodes, values.ndrefs[i]);
goog.array.extend(flatCoordinates, point); goog.array.extend(flatCoordinates, point);
} }
var geometry; var geometry;
@@ -145,7 +145,7 @@ ol.format.OSMXML.readTag_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'tag'); goog.asserts.assert(node.localName == 'tag');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]); var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
values.tags[node.getAttribute('k')] = node.getAttribute('v'); goog.object.set(values.tags, node.getAttribute('k'), node.getAttribute('v'));
}; };
@@ -234,3 +234,19 @@ ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
* @api stable * @api stable
*/ */
ol.format.OSMXML.prototype.readProjection; ol.format.OSMXML.prototype.readProjection;
/**
* @inheritDoc
*/
ol.format.OSMXML.prototype.readProjectionFromDocument = function(doc) {
return this.defaultDataProjection;
};
/**
* @inheritDoc
*/
ol.format.OSMXML.prototype.readProjectionFromNode = function(node) {
return this.defaultDataProjection;
};

View File

@@ -2,6 +2,7 @@ goog.provide('ol.format.OWS');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom.NodeType'); goog.require('goog.dom.NodeType');
goog.require('goog.object');
goog.require('ol.format.XLink'); goog.require('ol.format.XLink');
goog.require('ol.format.XML'); goog.require('ol.format.XML');
goog.require('ol.format.XSD'); goog.require('ol.format.XSD');
@@ -83,13 +84,20 @@ ol.format.OWS.readAllowedValues_ = function(node, objectStack) {
ol.format.OWS.readConstraint_ = function(node, objectStack) { ol.format.OWS.readConstraint_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Constraint'); goog.asserts.assert(node.localName == 'Constraint');
var object = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(object));
var name = node.getAttribute('name'); var name = node.getAttribute('name');
if (!goog.isDef(name)) { var value = ol.xml.pushParseAndPop({},
return undefined;
}
return ol.xml.pushParseAndPop({'name': name},
ol.format.OWS.CONSTRAINT_PARSERS_, node, ol.format.OWS.CONSTRAINT_PARSERS_, node,
objectStack); objectStack);
if (!goog.isDef(value)) {
return undefined;
}
if (!goog.isDef(object.constraints)) {
object.constraints = {};
}
object.constraints[name] = value;
}; };
@@ -130,12 +138,22 @@ ol.format.OWS.readDcp_ = function(node, objectStack) {
ol.format.OWS.readGet_ = function(node, objectStack) { ol.format.OWS.readGet_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Get'); goog.asserts.assert(node.localName == 'Get');
var href = ol.format.XLink.readHref(node); var object = objectStack[objectStack.length - 1];
if (!goog.isDef(href)) { var url = ol.format.XLink.readHref(node);
goog.asserts.assert(goog.isObject(object));
var value = ol.xml.pushParseAndPop({'url': url},
ol.format.OWS.REQUEST_METHOD_PARSERS_, node, objectStack);
if (!goog.isDef(value)) {
return undefined; return undefined;
} }
return ol.xml.pushParseAndPop({'href': href}, var get = goog.object.get(object, 'get');
ol.format.OWS.REQUEST_METHOD_PARSERS_, node, objectStack); if (!goog.isDef(get)) {
goog.object.set(object, 'get', [value]);
}else {
goog.asserts.assert(goog.isArray(get));
get.push(value);
}
}; };
@@ -171,7 +189,7 @@ ol.format.OWS.readOperation_ = function(node, objectStack) {
var object = /** @type {Object} */ var object = /** @type {Object} */
(objectStack[objectStack.length - 1]); (objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isObject(object)); goog.asserts.assert(goog.isObject(object));
object[name] = value; goog.object.set(object, name, value);
}; };
@@ -256,12 +274,18 @@ ol.format.OWS.readServiceProvider_ = function(node, objectStack) {
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack. * @param {Array.<*>} objectStack Object stack.
* @private * @private
* @return {string|undefined} * @return {Object|undefined}
*/ */
ol.format.OWS.readValue_ = function(node, objectStack) { ol.format.OWS.readValue_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Value'); goog.asserts.assert(node.localName == 'Value');
return ol.format.XSD.readString(node); var object = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(object));
var key = ol.format.XSD.readString(node);
if (!goog.isDef(key)) {
return undefined;
}
goog.object.set(object, key, true);
}; };
@@ -284,11 +308,14 @@ ol.format.OWS.NAMESPACE_URIS_ = [
ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'ServiceIdentification': ol.xml.makeObjectPropertySetter( 'ServiceIdentification': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readServiceIdentification_), ol.format.OWS.readServiceIdentification_,
'serviceIdentification'),
'ServiceProvider': ol.xml.makeObjectPropertySetter( 'ServiceProvider': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readServiceProvider_), ol.format.OWS.readServiceProvider_,
'serviceProvider'),
'OperationsMetadata': ol.xml.makeObjectPropertySetter( 'OperationsMetadata': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readOperationsMetadata_) ol.format.OWS.readOperationsMetadata_,
'operationsMetadata')
}); });
@@ -300,14 +327,17 @@ ol.format.OWS.PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'DeliveryPoint': ol.xml.makeObjectPropertySetter( 'DeliveryPoint': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString), ol.format.XSD.readString, 'deliveryPoint'),
'City': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'City': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'city'),
'AdministrativeArea': ol.xml.makeObjectPropertySetter( 'AdministrativeArea': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString), ol.format.XSD.readString, 'administrativeArea'),
'PostalCode': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'PostalCode': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'Country': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'postalCode'),
'Country': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString, 'country'),
'ElectronicMailAddress': ol.xml.makeObjectPropertySetter( 'ElectronicMailAddress': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString) ol.format.XSD.readString, 'electronicMailAddress')
}); });
@@ -318,7 +348,7 @@ ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'Value': ol.xml.makeObjectPropertyPusher(ol.format.OWS.readValue_) 'Value': ol.format.OWS.readValue_
}); });
@@ -330,7 +360,8 @@ ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'AllowedValues': ol.xml.makeObjectPropertySetter( 'AllowedValues': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readAllowedValues_) ol.format.OWS.readAllowedValues_, 'allowedValues'
)
}); });
@@ -341,8 +372,10 @@ ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'Phone': ol.xml.makeObjectPropertySetter(ol.format.OWS.readPhone_), 'Phone': ol.xml.makeObjectPropertySetter(
'Address': ol.xml.makeObjectPropertySetter(ol.format.OWS.readAddress_) ol.format.OWS.readPhone_, 'phone'),
'Address': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readAddress_, 'address')
}); });
@@ -353,7 +386,8 @@ ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'HTTP': ol.xml.makeObjectPropertySetter(ol.format.OWS.readHttp_) 'HTTP': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readHttp_, 'http')
}); });
@@ -364,7 +398,7 @@ ol.format.OWS.DCP_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'Get': ol.xml.makeObjectPropertyPusher(ol.format.OWS.readGet_), 'Get': ol.format.OWS.readGet_,
'Post': undefined // TODO 'Post': undefined // TODO
}); });
@@ -376,7 +410,8 @@ ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.OPERATION_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.OPERATION_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'DCP': ol.xml.makeObjectPropertySetter(ol.format.OWS.readDcp_) 'DCP': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readDcp_, 'dcp')
}); });
@@ -398,8 +433,10 @@ ol.format.OWS.OPERATIONS_METADATA_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'Voice': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'Voice': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'Facsimile': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString) 'voice'),
'Facsimile': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'facsimile')
}); });
@@ -410,8 +447,7 @@ ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeParsersNS(
*/ */
ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeParsersNS( ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'Constraint': ol.xml.makeObjectPropertyPusher( 'Constraint': ol.format.OWS.readConstraint_
ol.format.OWS.readConstraint_)
}); });
@@ -424,10 +460,11 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
ol.xml.makeParsersNS( ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'IndividualName': ol.xml.makeObjectPropertySetter( 'IndividualName': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString), ol.format.XSD.readString, 'individualName'),
'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'PositionName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'positionName'),
'ContactInfo': ol.xml.makeObjectPropertySetter( 'ContactInfo': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readContactInfo_) ol.format.OWS.readContactInfo_, 'contactInfo')
}); });
@@ -439,10 +476,12 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ = ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
ol.xml.makeParsersNS( ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'title'),
'ServiceTypeVersion': ol.xml.makeObjectPropertySetter( 'ServiceTypeVersion': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString), ol.format.XSD.readString, 'serviceTypeVersion'),
'ServiceType': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString) 'ServiceType': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString, 'serviceType')
}); });
@@ -454,8 +493,10 @@ ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
ol.format.OWS.SERVICE_PROVIDER_PARSERS_ = ol.format.OWS.SERVICE_PROVIDER_PARSERS_ =
ol.xml.makeParsersNS( ol.xml.makeParsersNS(
ol.format.OWS.NAMESPACE_URIS_, { ol.format.OWS.NAMESPACE_URIS_, {
'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString), 'ProviderName': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString,
'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref), 'providerName'),
'ProviderSite': ol.xml.makeObjectPropertySetter(ol.format.XLink.readHref,
'providerSite'),
'ServiceContact': ol.xml.makeObjectPropertySetter( 'ServiceContact': ol.xml.makeObjectPropertySetter(
ol.format.OWS.readServiceContact_) ol.format.OWS.readServiceContact_, 'serviceContact')
}); });

View File

@@ -340,6 +340,14 @@ ol.format.Polyline.prototype.readGeometryFromText =
ol.format.Polyline.prototype.readProjection; ol.format.Polyline.prototype.readProjection;
/**
* @inheritDoc
*/
ol.format.Polyline.prototype.readProjectionFromText = function(text) {
return this.defaultDataProjection;
};
/** /**
* @inheritDoc * @inheritDoc
*/ */

View File

@@ -111,9 +111,7 @@ ol.format.TextFeature.prototype.readProjection = function(source) {
* @protected * @protected
* @return {ol.proj.Projection} Projection. * @return {ol.proj.Projection} Projection.
*/ */
ol.format.TextFeature.prototype.readProjectionFromText = function(text) { ol.format.TextFeature.prototype.readProjectionFromText = goog.abstractMethod;
return this.defaultDataProjection;
};
/** /**

View File

@@ -397,7 +397,7 @@ ol.format.TopoJSON.prototype.readProjection = function(object) {
/** /**
* @const * @const
* @private * @private
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): ol.geom.Geometry>} * @type {Object.<string, function(TopoJSONGeometry, Array, ...[Array]): ol.geom.Geometry>}
*/ */
ol.format.TopoJSON.GEOMETRY_READERS_ = { ol.format.TopoJSON.GEOMETRY_READERS_ = {
'Point': ol.format.TopoJSON.readPointGeometry_, 'Point': ol.format.TopoJSON.readPointGeometry_,

View File

@@ -125,9 +125,6 @@ ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.object.extend(context, this.getReadOptions(node, goog.object.extend(context, this.getReadOptions(node,
goog.isDef(opt_options) ? opt_options : {})); goog.isDef(opt_options) ? opt_options : {}));
var objectStack = [context]; var objectStack = [context];
this.gmlFormat_.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS][
'featureMember'] =
ol.xml.makeArrayPusher(ol.format.GMLBase.prototype.readFeaturesInternal);
var features = ol.xml.pushParseAndPop([], var features = ol.xml.pushParseAndPop([],
this.gmlFormat_.FEATURE_COLLECTION_PARSERS, node, this.gmlFormat_.FEATURE_COLLECTION_PARSERS, node,
objectStack, this.gmlFormat_); objectStack, this.gmlFormat_);
@@ -223,7 +220,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
var result = {}; var result = {};
var value = ol.format.XSD.readNonNegativeIntegerString( var value = ol.format.XSD.readNonNegativeIntegerString(
node.getAttribute('numberOfFeatures')); node.getAttribute('numberOfFeatures'));
result['numberOfFeatures'] = value; goog.object.set(result, 'numberOfFeatures', value);
return ol.xml.pushParseAndPop( return ol.xml.pushParseAndPop(
/** @type {ol.format.WFS.FeatureCollectionMetadata} */ (result), /** @type {ol.format.WFS.FeatureCollectionMetadata} */ (result),
ol.format.WFS.FEATURE_COLLECTION_PARSERS_, node, [], this.gmlFormat_); ol.format.WFS.FEATURE_COLLECTION_PARSERS_, node, [], this.gmlFormat_);
@@ -370,8 +367,8 @@ ol.format.WFS.QUERY_SERIALIZERS_ = {
ol.format.WFS.writeFeature_ = function(node, feature, objectStack) { ol.format.WFS.writeFeature_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featureType = context['featureType']; var featureType = goog.object.get(context, 'featureType');
var featureNS = context['featureNS']; var featureNS = goog.object.get(context, 'featureNS');
var child = ol.xml.createElementNS(featureNS, featureType); var child = ol.xml.createElementNS(featureNS, featureType);
node.appendChild(child); node.appendChild(child);
ol.format.GML3.prototype.writeFeatureElement(child, feature, objectStack); ol.format.GML3.prototype.writeFeatureElement(child, feature, objectStack);
@@ -402,11 +399,11 @@ ol.format.WFS.writeOgcFidFilter_ = function(node, fid, objectStack) {
ol.format.WFS.writeDelete_ = function(node, feature, objectStack) { ol.format.WFS.writeDelete_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featureType = context['featureType']; var featureType = goog.object.get(context, 'featureType');
var featurePrefix = context['featurePrefix']; var featurePrefix = goog.object.get(context, 'featurePrefix');
featurePrefix = goog.isDef(featurePrefix) ? featurePrefix : featurePrefix = goog.isDef(featurePrefix) ? featurePrefix :
ol.format.WFS.FEATURE_PREFIX; ol.format.WFS.FEATURE_PREFIX;
var featureNS = context['featureNS']; var featureNS = goog.object.get(context, 'featureNS');
node.setAttribute('typeName', featurePrefix + ':' + featureType); node.setAttribute('typeName', featurePrefix + ':' + featureType);
ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix, ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix,
featureNS); featureNS);
@@ -426,11 +423,11 @@ ol.format.WFS.writeDelete_ = function(node, feature, objectStack) {
ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) { ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featureType = context['featureType']; var featureType = goog.object.get(context, 'featureType');
var featurePrefix = context['featurePrefix']; var featurePrefix = goog.object.get(context, 'featurePrefix');
featurePrefix = goog.isDef(featurePrefix) ? featurePrefix : featurePrefix = goog.isDef(featurePrefix) ? featurePrefix :
ol.format.WFS.FEATURE_PREFIX; ol.format.WFS.FEATURE_PREFIX;
var featureNS = context['featureNS']; var featureNS = goog.object.get(context, 'featureNS');
node.setAttribute('typeName', featurePrefix + ':' + featureType); node.setAttribute('typeName', featurePrefix + ':' + featureType);
ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix, ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix,
featureNS); featureNS);
@@ -445,7 +442,7 @@ ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) {
} }
} }
ol.xml.pushSerializeAndPop({node: node, srsName: ol.xml.pushSerializeAndPop({node: node, srsName:
context['srsName']}, goog.object.get(context, 'srsName')},
ol.format.WFS.TRANSACTION_SERIALIZERS_, ol.format.WFS.TRANSACTION_SERIALIZERS_,
ol.xml.makeSimpleNodeFactory('Property'), values, ol.xml.makeSimpleNodeFactory('Property'), values,
objectStack); objectStack);
@@ -521,10 +518,10 @@ ol.format.WFS.TRANSACTION_SERIALIZERS_ = {
ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) { ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var featurePrefix = context['featurePrefix']; var featurePrefix = goog.object.get(context, 'featurePrefix');
var featureNS = context['featureNS']; var featureNS = goog.object.get(context, 'featureNS');
var propertyNames = context['propertyNames']; var propertyNames = goog.object.get(context, 'propertyNames');
var srsName = context['srsName']; var srsName = goog.object.get(context, 'srsName');
var prefix = goog.isDef(featurePrefix) ? featurePrefix + ':' : ''; var prefix = goog.isDef(featurePrefix) ? featurePrefix + ':' : '';
node.setAttribute('typeName', prefix + featureType); node.setAttribute('typeName', prefix + featureType);
if (goog.isDef(srsName)) { if (goog.isDef(srsName)) {
@@ -540,7 +537,7 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
ol.format.WFS.QUERY_SERIALIZERS_, ol.format.WFS.QUERY_SERIALIZERS_,
ol.xml.makeSimpleNodeFactory('PropertyName'), propertyNames, ol.xml.makeSimpleNodeFactory('PropertyName'), propertyNames,
objectStack); objectStack);
var bbox = context['bbox']; var bbox = goog.object.get(context, 'bbox');
if (goog.isDef(bbox)) { if (goog.isDef(bbox)) {
var child = ol.xml.createElementNS('http://www.opengis.net/ogc', 'Filter'); var child = ol.xml.createElementNS('http://www.opengis.net/ogc', 'Filter');
ol.format.WFS.writeOgcBBOX_(child, bbox, objectStack); ol.format.WFS.writeOgcBBOX_(child, bbox, objectStack);
@@ -572,7 +569,7 @@ ol.format.WFS.writeOgcPropertyName_ = function(node, value, objectStack) {
ol.format.WFS.writeOgcBBOX_ = function(node, bbox, objectStack) { ol.format.WFS.writeOgcBBOX_ = function(node, bbox, objectStack) {
var context = objectStack[objectStack.length - 1]; var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context)); goog.asserts.assert(goog.isObject(context));
var geometryName = context['geometryName']; var geometryName = goog.object.get(context, 'geometryName');
var bboxNode = ol.xml.createElementNS('http://www.opengis.net/ogc', 'BBOX'); var bboxNode = ol.xml.createElementNS('http://www.opengis.net/ogc', 'BBOX');
node.appendChild(bboxNode); node.appendChild(bboxNode);
ol.format.WFS.writeOgcPropertyName_(bboxNode, geometryName, objectStack); ol.format.WFS.writeOgcPropertyName_(bboxNode, geometryName, objectStack);
@@ -750,10 +747,8 @@ ol.format.WFS.prototype.readProjectionFromDocument = function(doc) {
ol.format.WFS.prototype.readProjectionFromNode = function(node) { ol.format.WFS.prototype.readProjectionFromNode = function(node) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'FeatureCollection'); goog.asserts.assert(node.localName == 'FeatureCollection');
node = node.firstElementChild.firstElementChild;
if (goog.isDefAndNotNull(node.firstElementChild) && if (goog.isDefAndNotNull(node)) {
goog.isDefAndNotNull(node.firstElementChild.firstElementChild)) {
node = node.firstElementChild.firstElementChild;
for (var n = node.firstElementChild; !goog.isNull(n); for (var n = node.firstElementChild; !goog.isNull(n);
n = n.nextElementSibling) { n = n.nextElementSibling) {
if (!(n.childNodes.length === 0 || if (!(n.childNodes.length === 0 ||
@@ -765,6 +760,5 @@ ol.format.WFS.prototype.readProjectionFromNode = function(node) {
} }
} }
} }
return null; return null;
}; };

View File

@@ -291,6 +291,14 @@ ol.format.WKT.prototype.readGeometryFromText = function(text, opt_options) {
}; };
/**
* @inheritDoc
*/
ol.format.WKT.prototype.readProjectionFromText = function(text) {
return null;
};
/** /**
* Encode a feature as a WKT string. * Encode a feature as a WKT string.
* *

View File

@@ -136,14 +136,14 @@ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ =
if (!goog.isDef(geographicBoundingBox)) { if (!goog.isDef(geographicBoundingBox)) {
return undefined; return undefined;
} }
var westBoundLongitude = /** @type {number|undefined} */ var westBoundLongitude = /** @type {number|undefined} */ (goog.object.get(
(geographicBoundingBox['westBoundLongitude']); geographicBoundingBox, 'westBoundLongitude'));
var southBoundLatitude = /** @type {number|undefined} */ var southBoundLatitude = /** @type {number|undefined} */ (goog.object.get(
(geographicBoundingBox['southBoundLatitude']); geographicBoundingBox, 'southBoundLatitude'));
var eastBoundLongitude = /** @type {number|undefined} */ var eastBoundLongitude = /** @type {number|undefined} */ (goog.object.get(
(geographicBoundingBox['eastBoundLongitude']); geographicBoundingBox, 'eastBoundLongitude'));
var northBoundLatitude = /** @type {number|undefined} */ var northBoundLatitude = /** @type {number|undefined} */ (goog.object.get(
(geographicBoundingBox['northBoundLatitude']); geographicBoundingBox, 'northBoundLatitude'));
if (!goog.isDef(westBoundLongitude) || !goog.isDef(southBoundLatitude) || if (!goog.isDef(westBoundLongitude) || !goog.isDef(southBoundLatitude) ||
!goog.isDef(eastBoundLongitude) || !goog.isDef(northBoundLatitude)) { !goog.isDef(eastBoundLongitude) || !goog.isDef(northBoundLatitude)) {
return undefined; return undefined;
@@ -280,62 +280,64 @@ ol.format.WMSCapabilities.readLayer_ = function(node, objectStack) {
var queryable = var queryable =
ol.format.XSD.readBooleanString(node.getAttribute('queryable')); ol.format.XSD.readBooleanString(node.getAttribute('queryable'));
if (!goog.isDef(queryable)) { if (!goog.isDef(queryable)) {
queryable = parentLayerObject['queryable']; queryable = goog.object.get(parentLayerObject, 'queryable');
} }
layerObject['queryable'] = goog.isDef(queryable) ? queryable : false; goog.object.set(
layerObject, 'queryable', goog.isDef(queryable) ? queryable : false);
var cascaded = ol.format.XSD.readNonNegativeIntegerString( var cascaded = ol.format.XSD.readNonNegativeIntegerString(
node.getAttribute('cascaded')); node.getAttribute('cascaded'));
if (!goog.isDef(cascaded)) { if (!goog.isDef(cascaded)) {
cascaded = parentLayerObject['cascaded']; cascaded = goog.object.get(parentLayerObject, 'cascaded');
} }
layerObject['cascaded'] = cascaded; goog.object.set(layerObject, 'cascaded', cascaded);
var opaque = ol.format.XSD.readBooleanString(node.getAttribute('opaque')); var opaque = ol.format.XSD.readBooleanString(node.getAttribute('opaque'));
if (!goog.isDef(opaque)) { if (!goog.isDef(opaque)) {
opaque = parentLayerObject['opaque']; opaque = goog.object.get(parentLayerObject, 'opaque');
} }
layerObject['opaque'] = goog.isDef(opaque) ? opaque : false; goog.object.set(layerObject, 'opaque', goog.isDef(opaque) ? opaque : false);
var noSubsets = var noSubsets =
ol.format.XSD.readBooleanString(node.getAttribute('noSubsets')); ol.format.XSD.readBooleanString(node.getAttribute('noSubsets'));
if (!goog.isDef(noSubsets)) { if (!goog.isDef(noSubsets)) {
noSubsets = parentLayerObject['noSubsets']; noSubsets = goog.object.get(parentLayerObject, 'noSubsets');
} }
layerObject['noSubsets'] = goog.isDef(noSubsets) ? noSubsets : false; goog.object.set(
layerObject, 'noSubsets', goog.isDef(noSubsets) ? noSubsets : false);
var fixedWidth = var fixedWidth =
ol.format.XSD.readDecimalString(node.getAttribute('fixedWidth')); ol.format.XSD.readDecimalString(node.getAttribute('fixedWidth'));
if (!goog.isDef(fixedWidth)) { if (!goog.isDef(fixedWidth)) {
fixedWidth = parentLayerObject['fixedWidth']; fixedWidth = goog.object.get(parentLayerObject, 'fixedWidth');
} }
layerObject['fixedWidth'] = fixedWidth; goog.object.set(layerObject, 'fixedWidth', fixedWidth);
var fixedHeight = var fixedHeight =
ol.format.XSD.readDecimalString(node.getAttribute('fixedHeight')); ol.format.XSD.readDecimalString(node.getAttribute('fixedHeight'));
if (!goog.isDef(fixedHeight)) { if (!goog.isDef(fixedHeight)) {
fixedHeight = parentLayerObject['fixedHeight']; fixedHeight = goog.object.get(parentLayerObject, 'fixedHeight');
} }
layerObject['fixedHeight'] = fixedHeight; goog.object.set(layerObject, 'fixedHeight', fixedHeight);
// See 7.2.4.8 // See 7.2.4.8
var addKeys = ['Style', 'CRS', 'AuthorityURL']; var addKeys = ['Style', 'CRS', 'AuthorityURL'];
goog.array.forEach(addKeys, function(key) { goog.array.forEach(addKeys, function(key) {
var parentValue = parentLayerObject[key]; var parentValue = goog.object.get(parentLayerObject, key);
if (goog.isDef(parentValue)) { if (goog.isDef(parentValue)) {
var childValue = goog.object.setIfUndefined(layerObject, key, []); var childValue = goog.object.setIfUndefined(layerObject, key, []);
childValue = childValue.concat(parentValue); childValue = childValue.concat(parentValue);
layerObject[key] = childValue; goog.object.set(layerObject, key, childValue);
} }
}); });
var replaceKeys = ['EX_GeographicBoundingBox', 'BoundingBox', 'Dimension', var replaceKeys = ['EX_GeographicBoundingBox', 'BoundingBox', 'Dimension',
'Attribution', 'MinScaleDenominator', 'MaxScaleDenominator']; 'Attribution', 'MinScaleDenominator', 'MaxScaleDenominator'];
goog.array.forEach(replaceKeys, function(key) { goog.array.forEach(replaceKeys, function(key) {
var childValue = layerObject[key]; var childValue = goog.object.get(layerObject, key);
if (!goog.isDef(childValue)) { if (!goog.isDef(childValue)) {
var parentValue = parentLayerObject[key]; var parentValue = goog.object.get(parentLayerObject, key);
layerObject[key] = parentValue; goog.object.set(layerObject, key, parentValue);
} }
}); });
@@ -454,7 +456,7 @@ ol.format.WMSCapabilities.readSizedFormatOnlineresource_ =
ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('width')), ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('width')),
ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('height')) ol.format.XSD.readNonNegativeIntegerString(node.getAttribute('height'))
]; ];
formatOnlineresource['size'] = size; goog.object.set(formatOnlineresource, 'size', size);
return formatOnlineresource; return formatOnlineresource;
} }
return undefined; return undefined;
@@ -473,7 +475,7 @@ ol.format.WMSCapabilities.readAuthorityURL_ = function(node, objectStack) {
var authorityObject = var authorityObject =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack); ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
if (goog.isDef(authorityObject)) { if (goog.isDef(authorityObject)) {
authorityObject['name'] = node.getAttribute('name'); goog.object.set(authorityObject, 'name', node.getAttribute('name'));
return authorityObject; return authorityObject;
} }
return undefined; return undefined;
@@ -492,7 +494,7 @@ ol.format.WMSCapabilities.readMetadataURL_ = function(node, objectStack) {
var metadataObject = var metadataObject =
ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack); ol.format.WMSCapabilities.readFormatOnlineresource_(node, objectStack);
if (goog.isDef(metadataObject)) { if (goog.isDef(metadataObject)) {
metadataObject['type'] = node.getAttribute('type'); goog.object.set(metadataObject, 'type', node.getAttribute('type'));
return metadataObject; return metadataObject;
} }
return undefined; return undefined;

View File

@@ -2,6 +2,7 @@ goog.provide('ol.format.WMSGetFeatureInfo');
goog.require('goog.array'); goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.NodeType'); goog.require('goog.dom.NodeType');
goog.require('goog.object'); goog.require('goog.object');
goog.require('goog.string'); goog.require('goog.string');
@@ -89,14 +90,14 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ =
ol.format.WMSGetFeatureInfo.layerIdentifier_) + ol.format.WMSGetFeatureInfo.layerIdentifier_) +
ol.format.WMSGetFeatureInfo.featureIdentifier_; ol.format.WMSGetFeatureInfo.featureIdentifier_;
context['featureType'] = featureType; goog.object.set(context, 'featureType', featureType);
context['featureNS'] = this.featureNS_; goog.object.set(context, 'featureNS', this.featureNS_);
var parsers = {}; var parsers = {};
parsers[featureType] = ol.xml.makeArrayPusher( parsers[featureType] = ol.xml.makeArrayPusher(
this.gmlFormat_.readFeatureElement, this.gmlFormat_); this.gmlFormat_.readFeatureElement, this.gmlFormat_);
var parsersNS = ol.xml.makeParsersNS( var parsersNS = ol.xml.makeParsersNS(
[context['featureNS'], null], parsers); [goog.object.get(context, 'featureNS'), null], parsers);
layer.namespaceURI = this.featureNS_; layer.namespaceURI = this.featureNS_;
var layerFeatures = ol.xml.pushParseAndPop( var layerFeatures = ol.xml.pushParseAndPop(
[], parsersNS, layer, objectStack, this.gmlFormat_); [], parsersNS, layer, objectStack, this.gmlFormat_);

View File

@@ -1,400 +0,0 @@
goog.provide('ol.format.WMTSCapabilities');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('goog.object');
goog.require('goog.string');
goog.require('ol.extent');
goog.require('ol.format.OWS');
goog.require('ol.format.XLink');
goog.require('ol.format.XML');
goog.require('ol.format.XSD');
goog.require('ol.xml');
/**
* @classdesc
* Format for reading WMTS capabilities data.
*
* @constructor
* @extends {ol.format.XML}
* @api
*/
ol.format.WMTSCapabilities = function() {
goog.base(this);
/**
* @type {ol.format.OWS}
* @private
*/
this.owsParser_ = new ol.format.OWS();
};
goog.inherits(ol.format.WMTSCapabilities, ol.format.XML);
/**
* Read a WMTS capabilities document.
*
* @function
* @param {Document|Node|string} source The XML source.
* @return {Object} An object representing the WMTS capabilities.
* @api
*/
ol.format.WMTSCapabilities.prototype.read;
/**
* @param {Document} doc Document.
* @return {Object} WMTS Capability object.
*/
ol.format.WMTSCapabilities.prototype.readFromDocument = function(doc) {
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT);
for (var n = doc.firstChild; !goog.isNull(n); n = n.nextSibling) {
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
return this.readFromNode(n);
}
}
return null;
};
/**
* @param {Node} node Node.
* @return {Object} WMTS Capability object.
*/
ol.format.WMTSCapabilities.prototype.readFromNode = function(node) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Capabilities');
this.version = goog.string.trim(node.getAttribute('version'));
goog.asserts.assertString(this.version);
var WMTSCapabilityObject = this.owsParser_.readFromNode(node);
if (!goog.isDef(WMTSCapabilityObject)) {
return null;
}
goog.object.set(WMTSCapabilityObject, 'version', this.version);
WMTSCapabilityObject = ol.xml.pushParseAndPop(WMTSCapabilityObject,
ol.format.WMTSCapabilities.PARSERS_, node, []);
return goog.isDef(WMTSCapabilityObject) ? WMTSCapabilityObject : null;
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Attribution object.
*/
ol.format.WMTSCapabilities.readContents_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Contents');
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.CONTENTS_PARSERS_, node, objectStack);
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Layers object.
*/
ol.format.WMTSCapabilities.readLayer_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
goog.asserts.assert(node.localName == 'Layer');
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.LAYER_PARSERS_, node, objectStack);
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Tile Matrix Set object.
*/
ol.format.WMTSCapabilities.readTileMatrixSet_ = function(node, objectStack) {
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.TMS_PARSERS_, node, objectStack);
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Style object.
*/
ol.format.WMTSCapabilities.readStyle_ = function(node, objectStack) {
var style = ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.STYLE_PARSERS_, node, objectStack);
if (!goog.isDef(style)) {
return undefined;
}
var isDefault = node.getAttribute('isDefault') === 'true';
style['isDefault'] = isDefault;
return style;
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Tile Matrix Set Link object.
*/
ol.format.WMTSCapabilities.readTileMatrixSetLink_ = function(node,
objectStack) {
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_, node, objectStack);
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Resource URL object.
*/
ol.format.WMTSCapabilities.readResourceUrl_ = function(node, objectStack) {
var format = node.getAttribute('format');
var template = node.getAttribute('template');
var resourceType = node.getAttribute('resourceType');
var resource = {};
if (goog.isDef(format)) {
resource['format'] = format;
}
if (goog.isDef(template)) {
resource['template'] = template;
}
if (goog.isDef(resourceType)) {
resource['resourceType'] = resourceType;
}
return resource;
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} WGS84 BBox object.
*/
ol.format.WMTSCapabilities.readWgs84BoundingBox_ = function(node, objectStack) {
var coordinates = ol.xml.pushParseAndPop([],
ol.format.WMTSCapabilities.WGS84_BBOX_READERS_, node, objectStack);
if (coordinates.length != 2) {
return undefined;
}
return ol.extent.boundingExtent(coordinates);
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Legend object.
*/
ol.format.WMTSCapabilities.readLegendUrl_ = function(node, objectStack) {
var legend = {};
legend['format'] = node.getAttribute('format');
legend['href'] = ol.format.XLink.readHref(node);
return legend;
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} Coordinates object.
*/
ol.format.WMTSCapabilities.readCoordinates_ = function(node, objectStack) {
var coordinates = ol.format.XSD.readString(node).split(' ');
if (!goog.isDef(coordinates) || coordinates.length != 2) {
return undefined;
}
var x = +coordinates[0];
var y = +coordinates[1];
if (isNaN(x) || isNaN(y)) {
return undefined;
}
return [x, y];
};
/**
* @private
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Object|undefined} TileMatrix object.
*/
ol.format.WMTSCapabilities.readTileMatrix_ = function(node, objectStack) {
return ol.xml.pushParseAndPop({},
ol.format.WMTSCapabilities.TM_PARSERS_, node, objectStack);
};
/**
* @const
* @private
* @type {Array.<string>}
*/
ol.format.WMTSCapabilities.NAMESPACE_URIS_ = [
null,
'http://www.opengis.net/wmts/1.0'
];
/**
* @const
* @private
* @type {Array.<string>}
*/
ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_ = [
null,
'http://www.opengis.net/ows/1.1'
];
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'Contents': ol.xml.makeObjectPropertySetter(
ol.format.WMTSCapabilities.readContents_)
});
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.CONTENTS_PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'Layer': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readLayer_),
'TileMatrixSet': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readTileMatrixSet_)
});
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.LAYER_PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'Style': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readStyle_),
'Format': ol.xml.makeObjectPropertyPusher(
ol.format.XSD.readString),
'TileMatrixSetLink': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readTileMatrixSetLink_),
'ResourceURL': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readResourceUrl_)
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
'Title': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString),
'Abstract': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString),
'WGS84BoundingBox': ol.xml.makeObjectPropertySetter(
ol.format.WMTSCapabilities.readWgs84BoundingBox_),
'Identifier': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString)
}));
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.STYLE_PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'LegendURL': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readLegendUrl_)
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
'Title': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString),
'Identifier': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString)
}));
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'TileMatrixSet': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString)
});
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.WGS84_BBOX_READERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
'LowerCorner': ol.xml.makeArrayPusher(
ol.format.WMTSCapabilities.readCoordinates_),
'UpperCorner': ol.xml.makeArrayPusher(
ol.format.WMTSCapabilities.readCoordinates_)
});
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.TMS_PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'WellKnownScaleSet': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString),
'TileMatrix': ol.xml.makeObjectPropertyPusher(
ol.format.WMTSCapabilities.readTileMatrix_)
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
'SupportedCRS': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString),
'Identifier': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString)
}));
/**
* @const
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.WMTSCapabilities.TM_PARSERS_ = ol.xml.makeParsersNS(
ol.format.WMTSCapabilities.NAMESPACE_URIS_, {
'TopLeftCorner': ol.xml.makeObjectPropertySetter(
ol.format.WMTSCapabilities.readCoordinates_),
'ScaleDenominator': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readDecimal),
'TileWidth': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readNonNegativeInteger),
'TileHeight': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readNonNegativeInteger),
'MatrixWidth': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readNonNegativeInteger),
'MatrixHeight': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readNonNegativeInteger)
}, ol.xml.makeParsersNS(ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_, {
'Identifier': ol.xml.makeObjectPropertySetter(
ol.format.XSD.readString)
}));

View File

@@ -185,9 +185,7 @@ ol.format.XMLFeature.prototype.readProjection = function(source) {
* @protected * @protected
* @return {ol.proj.Projection} Projection. * @return {ol.proj.Projection} Projection.
*/ */
ol.format.XMLFeature.prototype.readProjectionFromDocument = function(doc) { ol.format.XMLFeature.prototype.readProjectionFromDocument = goog.abstractMethod;
return this.defaultDataProjection;
};
/** /**
@@ -195,9 +193,7 @@ ol.format.XMLFeature.prototype.readProjectionFromDocument = function(doc) {
* @protected * @protected
* @return {ol.proj.Projection} Projection. * @return {ol.proj.Projection} Projection.
*/ */
ol.format.XMLFeature.prototype.readProjectionFromNode = function(node) { ol.format.XMLFeature.prototype.readProjectionFromNode = goog.abstractMethod;
return this.defaultDataProjection;
};
/** /**

View File

@@ -94,14 +94,20 @@ ol.geom.Circle.prototype.getCenter = function() {
/** /**
* @inheritDoc * @inheritDoc
* @api
*/ */
ol.geom.Circle.prototype.computeExtent = function(extent) { ol.geom.Circle.prototype.getExtent = function(opt_extent) {
var flatCoordinates = this.flatCoordinates; if (this.extentRevision != this.getRevision()) {
var radius = flatCoordinates[this.stride] - flatCoordinates[0]; var flatCoordinates = this.flatCoordinates;
return ol.extent.createOrUpdate( var radius = flatCoordinates[this.stride] - flatCoordinates[0];
flatCoordinates[0] - radius, flatCoordinates[1] - radius, this.extent = ol.extent.createOrUpdate(
flatCoordinates[0] + radius, flatCoordinates[1] + radius, flatCoordinates[0] - radius, flatCoordinates[1] - radius,
extent); flatCoordinates[0] + radius, flatCoordinates[1] + radius,
this.extent);
this.extentRevision = this.getRevision();
}
goog.asserts.assert(goog.isDef(this.extent));
return ol.extent.returnOrUpdate(this.extent, opt_extent);
}; };

View File

@@ -37,7 +37,7 @@ ol.geom.flat.geodesic.line_ =
/** @type {Array.<number>} */ /** @type {Array.<number>} */
var fractionStack = [1, 0]; var fractionStack = [1, 0];
/** @type {Object.<string, boolean>} */ /** @type {Object.<number, boolean>} */
var fractions = {}; var fractions = {};
var maxIterations = 1e5; var maxIterations = 1e5;
@@ -52,7 +52,7 @@ ol.geom.flat.geodesic.line_ =
key = fracA.toString(); key = fracA.toString();
if (!goog.object.containsKey(fractions, key)) { if (!goog.object.containsKey(fractions, key)) {
flatCoordinates.push(a[0], a[1]); flatCoordinates.push(a[0], a[1]);
fractions[key] = true; goog.object.set(fractions, key, true);
} }
// Pop the b coordinate off the stack // Pop the b coordinate off the stack
fracB = fractionStack.pop(); fracB = fractionStack.pop();
@@ -70,7 +70,7 @@ ol.geom.flat.geodesic.line_ =
flatCoordinates.push(b[0], b[1]); flatCoordinates.push(b[0], b[1]);
key = fracB.toString(); key = fracB.toString();
goog.asserts.assert(!goog.object.containsKey(fractions, key)); goog.asserts.assert(!goog.object.containsKey(fractions, key));
fractions[key] = true; goog.object.set(fractions, key, true);
} else { } else {
// Otherwise, we need to subdivide the current line segment. Split it // Otherwise, we need to subdivide the current line segment. Split it
// into two and push the two line segments onto the stack. // into two and push the two line segments onto the stack.

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