Compare commits
7 Commits
v3.19.0-be
...
v3.16.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c7ffed415 | ||
|
|
9050ee550f | ||
|
|
2c1353f6e9 | ||
|
|
783721951a | ||
|
|
c5dcde4455 | ||
|
|
47cc4aac62 | ||
|
|
f86e7e5a71 |
@@ -80,7 +80,7 @@ include:
|
|||||||
### Follow OpenLayers 3's coding style
|
### Follow OpenLayers 3's coding style
|
||||||
|
|
||||||
OpenLayers 3 follows [Google's JavaScript Style
|
OpenLayers 3 follows [Google's JavaScript Style
|
||||||
Guide](https://google.github.io/styleguide/javascriptguide.xml).
|
Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).
|
||||||
This is checked using [ESLint](http://eslint.org/), you
|
This is checked using [ESLint](http://eslint.org/), you
|
||||||
can run the linter locally on your machine before committing using the `lint`
|
can run the linter locally on your machine before committing using the `lint`
|
||||||
target:
|
target:
|
||||||
|
|||||||
8
Makefile
8
Makefile
@@ -2,7 +2,7 @@ OS := $(shell uname)
|
|||||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
SRC_GLSL := $(shell find src -type f -name '*.glsl')
|
SRC_GLSL := $(shell find src -type f -name '*.glsl')
|
||||||
SRC_SHADER_JS := $(patsubst %shader.glsl,%shader.js,$(SRC_GLSL))
|
SRC_SHADER_JS := $(patsubst %.glsl,%shader.js,$(SRC_GLSL))
|
||||||
SRC_JS := $(filter-out $(SRC_SHADER_JS),$(shell find src -name '*.js'))
|
SRC_JS := $(filter-out $(SRC_SHADER_JS),$(shell find src -name '*.js'))
|
||||||
SRC_JSDOC = $(shell find src -type f -name '*.jsdoc')
|
SRC_JSDOC = $(shell find src -type f -name '*.jsdoc')
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ build/timestamps/check-%-timestamp: $(BUILD_HOSTED)/examples/%.html \
|
|||||||
$(BUILD_HOSTED)/build/ol.js \
|
$(BUILD_HOSTED)/build/ol.js \
|
||||||
$(BUILD_HOSTED)/css/ol.css
|
$(BUILD_HOSTED)/css/ol.css
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
node tasks/check-example.js $<
|
./node_modules/.bin/phantomjs --local-to-remote-url-access=true --ssl-protocol=any --ignore-ssl-errors=true bin/check-example.js $<
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
build/compiled-examples/all.js: $(EXAMPLES_JS)
|
build/compiled-examples/all.js: $(EXAMPLES_JS)
|
||||||
@@ -252,7 +252,7 @@ build/timestamps/eslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \
|
|||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@echo "Running eslint..."
|
@echo "Running eslint..."
|
||||||
@./node_modules/.bin/eslint --quiet tasks test test_rendering src examples
|
@./node_modules/.bin/eslint $?
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
build/timestamps/node-modules-timestamp: package.json
|
build/timestamps/node-modules-timestamp: package.json
|
||||||
@@ -298,5 +298,5 @@ build/test_rendering_requires.js: $(SPEC_RENDERING_JS)
|
|||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@node tasks/generate-requires.js $^ > $@
|
@node tasks/generate-requires.js $^ > $@
|
||||||
|
|
||||||
%shader.js: %shader.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py build/timestamps/node-modules-timestamp
|
%shader.js: %.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py build/timestamps/node-modules-timestamp
|
||||||
@python bin/pyglslunit.py --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shader.mustache > $@
|
@python bin/pyglslunit.py --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shader.mustache > $@
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
[](https://coveralls.io/r/openlayers/ol3?branch=master)
|
[](https://coveralls.io/r/openlayers/ol3?branch=master)
|
||||||
[](http://osgeo.org/)
|
[](http://osgeo.org/)
|
||||||
|
|
||||||
[OpenLayers 3](http://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).
|
[OpenLayers 3](http://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
@@ -12,13 +12,9 @@
|
|||||||
- Install with npm: `npm install openlayers`
|
- Install with npm: `npm install openlayers`
|
||||||
- Clone the repo: `git clone git@github.com:openlayers/ol3.git`
|
- Clone the repo: `git clone git@github.com:openlayers/ol3.git`
|
||||||
|
|
||||||
## Supported Browsers
|
|
||||||
|
|
||||||
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io) for `requestAnimationFrame` and `Element.prototype.classList` are required, and using the KML format requires a polyfill for `URL`.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Check out the [hosted examples](http://openlayers.org/en/latest/examples/), the [workshop](http://openlayers.org/workshop/) or the [API documentation](http://openlayers.org/en/latest/apidoc/).
|
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/workshop/) or [API docs](http://openlayers.org/en/master/apidoc/).
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
|
|
||||||
|
|||||||
@@ -1,151 +1,8 @@
|
|||||||
## Upgrade notes
|
## Upgrade notes
|
||||||
|
|
||||||
#### `goog.DEBUG` define was renamed to `ol.DEBUG`
|
|
||||||
|
|
||||||
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
|
|
||||||
|
|
||||||
#### `ol.format.ogc.filter` namespace was renamed to `ol.format.filter`
|
|
||||||
|
|
||||||
`ol.format.ogc.filter` was simplified to `ol.format.filter`; to upgrade your code, simply remove the `ogc` string from the name.
|
|
||||||
For example: `ol.format.ogc.filter.and` to `ol.format.filter.and`.
|
|
||||||
|
|
||||||
#### Changes only relevant to those who compile their applications together with the Closure Compiler
|
|
||||||
|
|
||||||
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
|
|
||||||
|
|
||||||
* rename `ol.CollectionProperty` to `ol.Collection.Property`
|
|
||||||
* rename `ol.DeviceOrientationProperty` to `ol.DeviceOrientation.Property`
|
|
||||||
* rename `ol.DragBoxEvent` to `ol.interaction.DragBox.Event`
|
|
||||||
* rename `ol.DragBoxEventType` to `ol.interaction.DragBox.EventType`
|
|
||||||
* rename `ol.GeolocationProperty` to `ol.Geolocation.Property`
|
|
||||||
* rename `ol.OverlayPositioning` to `ol.Overlay.Positioning`
|
|
||||||
* rename `ol.OverlayProperty` to `ol.Overlay.Property`
|
|
||||||
* rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property`
|
|
||||||
* rename `ol.format.IGCZ` to `ol.format.IGC.Z`
|
|
||||||
* rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode`
|
|
||||||
* rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event`
|
|
||||||
* rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType`
|
|
||||||
* rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event`
|
|
||||||
* rename `ol.interaction.ExtentEventType` to `ol.interaction.Extent.EventType`
|
|
||||||
* rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event`
|
|
||||||
* rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType`
|
|
||||||
* rename `ol.interaction.ModifyEvent` to `ol.interaction.Modify.Event`
|
|
||||||
* rename `ol.interaction.SelectEvent` to `ol.interaction.Select.Event`
|
|
||||||
* rename `ol.interaction.SelectEventType` to `ol.interaction.Select.EventType`
|
|
||||||
* rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event`
|
|
||||||
* rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType`
|
|
||||||
* rename `ol.layer.GroupProperty` to `ol.layer.Group.Property`
|
|
||||||
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
|
|
||||||
* rename `ol.layer.TileProperty` to `ol.layer.Tile.Property`
|
|
||||||
* rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
|
|
||||||
* rename `ol.MapEventType` to `ol.MapEvent.Type`
|
|
||||||
* rename `ol.MapProperty` to `ol.Map.Property`
|
|
||||||
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
|
|
||||||
* rename `ol.RendererType` to `ol.renderer.Type`
|
|
||||||
* rename `ol.source.ImageEvent` to `ol.source.Image.Event`
|
|
||||||
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
|
|
||||||
* rename `ol.source.RasterEvent` to `ol.source.Raster.Event`
|
|
||||||
* rename `ol.source.RasterEventType` to `ol.source.Raster.EventType`
|
|
||||||
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
|
|
||||||
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
|
|
||||||
* rename `ol.source.VectorEvent` to `ol.source.Vector.Event`
|
|
||||||
* rename `ol.source.VectorEventType` to `ol.source.Vector.EventType`
|
|
||||||
* rename `ol.source.wms.ServerType` to `ol.source.WMSServerType`
|
|
||||||
* rename `ol.source.WMTSRequestEncoding` to `ol.source.WMTS.RequestEncoding`
|
|
||||||
* rename `ol.style.IconAnchorUnits` to `ol.style.Icon.AnchorUnits`
|
|
||||||
* rename `ol.style.IconOrigin` to `ol.style.Icon.Origin`
|
|
||||||
|
|
||||||
### v3.18.0
|
|
||||||
|
|
||||||
#### Removal of the DOM renderer
|
|
||||||
|
|
||||||
The DOM renderer has been removed. Instead, the Canvas renderer should be used. If you were previously constructing a map with `'dom'` as the `renderer` option, you will see an error message in the console in debug mode and the Canvas renderer will be used instead. To remove the warning, remove the `renderer` option from your map constructor.
|
|
||||||
|
|
||||||
#### Changes in the way assertions are handled
|
|
||||||
|
|
||||||
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
|
||||||
|
|
||||||
#### Removal of `ol.ENABLE_NAMED_COLORS`
|
|
||||||
|
|
||||||
This option was previously needed to use named colors with the WebGL renderer but is no longer needed.
|
|
||||||
|
|
||||||
#### KML format now uses URL()
|
|
||||||
|
|
||||||
The URL constructor is supported by all modern browsers, but not by older ones, such as IE. To use the KML format in such older browsers, a URL polyfill will have to be loaded before use.
|
|
||||||
|
|
||||||
#### Changes only relevant to those who compile their applications together with the Closure Compiler
|
|
||||||
|
|
||||||
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
|
|
||||||
|
|
||||||
* rename `ol.CollectionEventType` to `ol.Collection.EventType`
|
|
||||||
* rename `ol.CollectionEvent` to `ol.Collection.Event`
|
|
||||||
* rename `ol.ViewHint` to `ol.View.Hint`
|
|
||||||
* rename `ol.ViewProperty` to `ol.View.Property`
|
|
||||||
* rename `ol.render.webgl.imagereplay.shader.Default.Locations` to `ol.render.webgl.imagereplay.defaultshader.Locations`
|
|
||||||
* rename `ol.render.webgl.imagereplay.shader.DefaultFragment` to `ol.render.webgl.imagereplay.defaultshader.Fragment`
|
|
||||||
* rename `ol.render.webgl.imagereplay.shader.DefaultVertex` to `ol.render.webgl.imagereplay.defaultshader.Vertex`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.DefaultFragment` to `ol.renderer.webgl.defaultmapshader.Fragment`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.DefaultVertex` to `ol.renderer.webgl.defaultmapshader.Vertex`
|
|
||||||
* rename `ol.renderer.webgl.tilelayer.shader.Fragment` to `ol.renderer.webgl.tilelayershader.Fragment`
|
|
||||||
* rename `ol.renderer.webgl.tilelayer.shader.Locations` to `ol.renderer.webgl.tilelayershader.Locations`
|
|
||||||
* rename `ol.renderer.webgl.tilelayer.shader.Vertex` to `ol.renderer.webgl.tilelayershader.Vertex`
|
|
||||||
* rename `ol.webgl.WebGLContextEventType` to `ol.webgl.ContextEventType`
|
|
||||||
* rename `ol.webgl.shader.Fragment` to `ol.webgl.Fragment`
|
|
||||||
* rename `ol.webgl.shader.Vertex` to `ol.webgl.Vertex`
|
|
||||||
|
|
||||||
### v3.17.0
|
|
||||||
|
|
||||||
#### `ol.source.MapQuest` removal
|
|
||||||
|
|
||||||
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
|
|
||||||
|
|
||||||
#### `ol.interaction.ModifyEvent` changes
|
|
||||||
|
|
||||||
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
|
|
||||||
|
|
||||||
#### Removal of ol.raster namespace
|
|
||||||
|
|
||||||
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
|
|
||||||
* `ol.raster.Operation` to `ol.RasterOperation`
|
|
||||||
* `ol.raster.OperationType` to `ol.RasterOperationType`
|
|
||||||
|
|
||||||
#### All typedefs now in ol namespace
|
|
||||||
|
|
||||||
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
|
|
||||||
* ol.events.ConditionType to ol.EventsConditionType
|
|
||||||
* ol.events.EventTargetLike to ol.EventTargetLike
|
|
||||||
* ol.events.Key to ol.EventsKey
|
|
||||||
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
|
|
||||||
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
|
|
||||||
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
|
|
||||||
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
|
|
||||||
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
|
|
||||||
* ol.interaction.SnapResultType to ol.SnapResultType
|
|
||||||
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
|
|
||||||
* ol.proj.ProjectionLike to ol.ProjectionLike
|
|
||||||
* ol.style.AtlasBlock to ol.AtlasBlock
|
|
||||||
* ol.style.AtlasInfo to ol.AtlasInfo
|
|
||||||
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
|
|
||||||
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
|
|
||||||
* ol.style.ImageOptions to ol.StyleImageOptions
|
|
||||||
* ol.style.GeometryFunction to ol.StyleGeometryFunction
|
|
||||||
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
|
|
||||||
* ol.style.StyleFunction to ol.StyleFunction
|
|
||||||
|
|
||||||
### v3.16.0
|
|
||||||
|
|
||||||
#### Rendering change for tile sources
|
|
||||||
|
|
||||||
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
|
|
||||||
|
|
||||||
#### Move of typedefs out of code and into separate file
|
#### Move of typedefs out of code and into separate file
|
||||||
|
|
||||||
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
|
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
|
||||||
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
|
|
||||||
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
|
|
||||||
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
|
|
||||||
|
|
||||||
#### Removal of `opaque` option for `ol.source.VectorTile`
|
#### Removal of `opaque` option for `ol.source.VectorTile`
|
||||||
|
|
||||||
|
|||||||
@@ -1,148 +0,0 @@
|
|||||||
# v3.16.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v3.16.0 release includes features and fixes from 95 pull requests since the v3.15.1 release. New features and improvements include:
|
|
||||||
|
|
||||||
* Add `ol.source.ImageArcGISRest` for ArcGIS REST image layer support (#3880)
|
|
||||||
* New `finishCondition` option for `ol.interaction.Draw` to control which action should finish a geometry when drawing (#5261)
|
|
||||||
* New filter API for `ol.format.WFS#writeGetFeature` for WFS queries with OGC filters (#5252)
|
|
||||||
* New `renderMode` option for `ol.layer.VectorTile` to balance between rendering performance and rendering quality (#5177)
|
|
||||||
* More flexibility for configuring attribution logos by allowing HTML elements (#5274)
|
|
||||||
* UTFGrid updates, now supporting Mapbox API v4 (#5329)
|
|
||||||
* New `condition` option for `ol.interaction.Modify` for better reliability when combining with other interactions (#5320)
|
|
||||||
|
|
||||||
In addition to these new features, the code base has been simplified and refactored in the process of removing the dependency on Closure Library and Compiler.
|
|
||||||
|
|
||||||
## Upgrade notes
|
|
||||||
|
|
||||||
#### Rendering change for tile sources
|
|
||||||
|
|
||||||
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
|
|
||||||
|
|
||||||
#### Move of typedefs out of code and into separate file
|
|
||||||
|
|
||||||
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
|
|
||||||
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
|
|
||||||
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
|
|
||||||
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
|
|
||||||
|
|
||||||
#### Removal of `opaque` option for `ol.source.VectorTile`
|
|
||||||
|
|
||||||
This option is no longer needed, so it was removed from the API.
|
|
||||||
|
|
||||||
#### XHR loading for `ol.source.TileUTFGrid`
|
|
||||||
|
|
||||||
The `ol.source.TileUTFGrid` now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new `jsonp` option on the source. See the examples below for detail.
|
|
||||||
|
|
||||||
```js
|
|
||||||
// To work with the v4 API
|
|
||||||
var v4source = new ol.source.TileUTFGrid({
|
|
||||||
url: 'https://api.tiles.mapbox.com/v4/example.json?access_token=' + YOUR_KEY_HERE
|
|
||||||
});
|
|
||||||
|
|
||||||
// To work with the v3 API
|
|
||||||
var v3source = new ol.source.TileUTFGrid({
|
|
||||||
jsonp: true, // <--- this is required for v3
|
|
||||||
url: 'http://api.tiles.mapbox.com/v3/example.json'
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## Full list of changes
|
|
||||||
|
|
||||||
* [#5377](https://github.com/openlayers/ol3/pull/5377) - Fix link to jspdf.min.js in export-pdf example ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5372](https://github.com/openlayers/ol3/pull/5372) - Update jquery to version 2.2.4 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5364](https://github.com/openlayers/ol3/pull/5364) - Make it so things don't flash so much when you change the tile source URL. ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5368](https://github.com/openlayers/ol3/pull/5368) - Move WFS typedefs to typedefs.js ([@probins](https://github.com/probins))
|
|
||||||
* [#5369](https://github.com/openlayers/ol3/pull/5369) - format/igc: Remove duplicate regex exec() call ([@Turbo87](https://github.com/Turbo87))
|
|
||||||
* [#5363](https://github.com/openlayers/ol3/pull/5363) - Convert all typedefs to CamelCase ([@probins](https://github.com/probins))
|
|
||||||
* [#5362](https://github.com/openlayers/ol3/pull/5362) - Update vector-tile to version 1.2.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5352](https://github.com/openlayers/ol3/pull/5352) - Add getResolutions() to ol.View ([@marlowp](https://github.com/marlowp))
|
|
||||||
* [#5359](https://github.com/openlayers/ol3/pull/5359) - Move upgrade notes to correct place ([@probins](https://github.com/probins))
|
|
||||||
* [#5343](https://github.com/openlayers/ol3/pull/5343) - Rename non-api sub-namespace typedefs ([@probins](https://github.com/probins))
|
|
||||||
* [#5361](https://github.com/openlayers/ol3/pull/5361) - Fix url to maki icons ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5358](https://github.com/openlayers/ol3/pull/5358) - Handle multiple featureMember elements for different types (WFS format) ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5355](https://github.com/openlayers/ol3/pull/5355) - Fix navigation-controls example description ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5353](https://github.com/openlayers/ol3/pull/5353) - Add API definition to docs landing page ([@probins](https://github.com/probins))
|
|
||||||
* [#5356](https://github.com/openlayers/ol3/pull/5356) - Update rbush to version 1.4.3 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5354](https://github.com/openlayers/ol3/pull/5354) - Update eslint to version 2.10.2 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5347](https://github.com/openlayers/ol3/pull/5347) - Update eslint to version 2.10.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5344](https://github.com/openlayers/ol3/pull/5344) - Remove raster enum from test ([@probins](https://github.com/probins))
|
|
||||||
* [#5329](https://github.com/openlayers/ol3/pull/5329) - UTFGrid updates. ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5335](https://github.com/openlayers/ol3/pull/5335) - Move typedefs to separate file ([@probins](https://github.com/probins))
|
|
||||||
* [#5332](https://github.com/openlayers/ol3/pull/5332) - Warn when viewing an outdated example, and offer a redirect to latest ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5342](https://github.com/openlayers/ol3/pull/5342) - Fix incorrect source links ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5339](https://github.com/openlayers/ol3/pull/5339) - Use a div instead of alert for version warning ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5320](https://github.com/openlayers/ol3/pull/5320) - Add a 'condition' option to ol.interaction.Modify ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5333](https://github.com/openlayers/ol3/pull/5333) - Improve code readability with better comments ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5330](https://github.com/openlayers/ol3/pull/5330) - Fix source links, display version and warn about outdated docs ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5324](https://github.com/openlayers/ol3/pull/5324) - Remove unneeded goog.provides/requires for typedefs ([@probins](https://github.com/probins))
|
|
||||||
* [#5328](https://github.com/openlayers/ol3/pull/5328) - Use Node 6 on Travis. ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5313](https://github.com/openlayers/ol3/pull/5313) - Rastersource framestate extent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5326](https://github.com/openlayers/ol3/pull/5326) - Fix wording in tile-load-event example ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5327](https://github.com/openlayers/ol3/pull/5327) - Update closure-util to version 1.13.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5289](https://github.com/openlayers/ol3/pull/5289) - Update fs-extra to version 0.30.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5319](https://github.com/openlayers/ol3/pull/5319) - Remove outdated fixme from framestate.js. ([@probins](https://github.com/probins))
|
|
||||||
* [#5274](https://github.com/openlayers/ol3/pull/5274) - Allow using elements in logo attribution options ([@samuellapointe](https://github.com/samuellapointe))
|
|
||||||
* [#5162](https://github.com/openlayers/ol3/pull/5162) - Improve docs/examples for loadingstrategy ([@probins](https://github.com/probins))
|
|
||||||
* [#5314](https://github.com/openlayers/ol3/pull/5314) - Update browserify to version 13.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5315](https://github.com/openlayers/ol3/pull/5315) - Remove unused ol.TileCoordTransformType ([@probins](https://github.com/probins))
|
|
||||||
* [#5310](https://github.com/openlayers/ol3/pull/5310) - Get raster sources working again. ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5291](https://github.com/openlayers/ol3/pull/5291) - Allow once listeners to dispatch events of same type ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5309](https://github.com/openlayers/ol3/pull/5309) - Update metalsmith-layouts to version 1.6.5 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5052](https://github.com/openlayers/ol3/pull/5052) - Update fs-extra to version 0.26.7 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5306](https://github.com/openlayers/ol3/pull/5306) - Make olx.view.FitOptions.padding optional ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#5302](https://github.com/openlayers/ol3/pull/5302) - Remove use of goog.partial ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5304](https://github.com/openlayers/ol3/pull/5304) - Update sinon to version 1.17.4 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#4644](https://github.com/openlayers/ol3/pull/4644) - Remove check-requires script ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5298](https://github.com/openlayers/ol3/pull/5298) - Update eslint to version 2.9.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5296](https://github.com/openlayers/ol3/pull/5296) - Document handling of KML MultiGeometries ([@probins](https://github.com/probins))
|
|
||||||
* [#5293](https://github.com/openlayers/ol3/pull/5293) - Block removePoint while dragging ([@giohappy](https://github.com/giohappy))
|
|
||||||
* [#5285](https://github.com/openlayers/ol3/pull/5285) - Add more tests for the scaleline control ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#5287](https://github.com/openlayers/ol3/pull/5287) - Add and fix vectortile tests ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5288](https://github.com/openlayers/ol3/pull/5288) - Expose removeVertex_ as removePoint ([@giohappy](https://github.com/giohappy))
|
|
||||||
* [#5286](https://github.com/openlayers/ol3/pull/5286) - Skip unnecessary render functions ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5177](https://github.com/openlayers/ol3/pull/5177) - Add render options for vector tile layers ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5278](https://github.com/openlayers/ol3/pull/5278) - Fix invalid generics type instantiation ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5044](https://github.com/openlayers/ol3/pull/5044) - Snap interaction now handle feature without geometry properly ([@fblackburn](https://github.com/fblackburn))
|
|
||||||
* [#5277](https://github.com/openlayers/ol3/pull/5277) - Type cleanup ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5275](https://github.com/openlayers/ol3/pull/5275) - Fix feature-layer association on replaced selections ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5252](https://github.com/openlayers/ol3/pull/5252) - Add filter option to ol.format.WFS#writeGetFeature ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5264](https://github.com/openlayers/ol3/pull/5264) - Fix for close draw polygon error ([@matjos](https://github.com/matjos))
|
|
||||||
* [#5267](https://github.com/openlayers/ol3/pull/5267) - Use ol.functions instead of goog.functions ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5266](https://github.com/openlayers/ol3/pull/5266) - Document ol.colorlike ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5261](https://github.com/openlayers/ol3/pull/5261) - add finishCondition to ol.interaction.Draw ([@giohappy](https://github.com/giohappy))
|
|
||||||
* [#5259](https://github.com/openlayers/ol3/pull/5259) - Include squash commit merges in changelog ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5257](https://github.com/openlayers/ol3/pull/5257) - Add readFeatures and readProjection as MVT experimental API ([@bjornharrtell](https://github.com/bjornharrtell))
|
|
||||||
* [#3880](https://github.com/openlayers/ol3/pull/3880) - Add ol.source.ImageArcGISRest ([Anna Lambrechtsen](https://github.com/search?q=Anna Lambrechtsen&type=Users))
|
|
||||||
* [#5239](https://github.com/openlayers/ol3/pull/5239) - Update eslint to version 2.8.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5230](https://github.com/openlayers/ol3/pull/5230) - Reuse frame state arrays ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5213](https://github.com/openlayers/ol3/pull/5213) - Remove unused ol.source.Source#setProjection function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5223](https://github.com/openlayers/ol3/pull/5223) - Create tmpSize_ before calling calculateTileRanges_ ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5225](https://github.com/openlayers/ol3/pull/5225) - Remove unused ol.extent.transform2D function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5212](https://github.com/openlayers/ol3/pull/5212) - KML: fix GeometryCollection write ([@probins](https://github.com/probins))
|
|
||||||
* [#5228](https://github.com/openlayers/ol3/pull/5228) - Add 'layers' option to Translate interaction ([@adube](https://github.com/adube))
|
|
||||||
* [#5221](https://github.com/openlayers/ol3/pull/5221) - Update jquery, bootstrap and proj4js in examples ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5227](https://github.com/openlayers/ol3/pull/5227) - Add a temporary ol.TileCoord in ol.renderer.canvas.TileLayer ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5222](https://github.com/openlayers/ol3/pull/5222) - Remove unused private variables in ol.renderer.canvas.Map ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5220](https://github.com/openlayers/ol3/pull/5220) - Externs cleanup ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5224](https://github.com/openlayers/ol3/pull/5224) - Fix jsdoc tags indentation ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5218](https://github.com/openlayers/ol3/pull/5218) - Add @api annotation to setConfig. ([@aisaacs](https://github.com/aisaacs))
|
|
||||||
* [#5215](https://github.com/openlayers/ol3/pull/5215) - Add an optional feature filter to getClosestFeatureToCoordinate ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5132](https://github.com/openlayers/ol3/pull/5132) - Remove goog.string ([@nicholas-l](https://github.com/nicholas-l))
|
|
||||||
* [#5206](https://github.com/openlayers/ol3/pull/5206) - Minor correction of StyleFunction docs ([@probins](https://github.com/probins))
|
|
||||||
* [#4932](https://github.com/openlayers/ol3/pull/4932) - Remove undefined parameters to ol.format.WMSGetFeatureInfo#readFeatures_ ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5207](https://github.com/openlayers/ol3/pull/5207) - Update clean-css to version 3.4.12 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5201](https://github.com/openlayers/ol3/pull/5201) - Small clarification for vector source loader docs ([@probins](https://github.com/probins))
|
|
||||||
* [#5200](https://github.com/openlayers/ol3/pull/5200) - Fix typo in rotate control for css classList ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#5178](https://github.com/openlayers/ol3/pull/5178) - Remove goog.global ([Nicholas Latham](https://github.com/search?q=Nicholas Latham&type=Users))
|
|
||||||
* [#5189](https://github.com/openlayers/ol3/pull/5189) - Add rendering tests to ensure correct circle and polygon rendering ([Andreas Hocevar](https://github.com/search?q=Andreas Hocevar&type=Users))
|
|
||||||
* [#5183](https://github.com/openlayers/ol3/pull/5183) - Update istanbul to version 0.4.3 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5187](https://github.com/openlayers/ol3/pull/5187) - Remove goog.functions.and from ol.interaction.Modify ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5176](https://github.com/openlayers/ol3/pull/5176) - Update jquery to version 2.2.3 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5173](https://github.com/openlayers/ol3/pull/5173) - Use ol.dom.createCanvasContext2D ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5171](https://github.com/openlayers/ol3/pull/5171) - Move olx.source.AttributionOption out of externs/olx.js ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5170](https://github.com/openlayers/ol3/pull/5170) - Update eslint to version 2.7.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5167](https://github.com/openlayers/ol3/pull/5167) - Remove FastClick from mobile-full-screen example ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5166](https://github.com/openlayers/ol3/pull/5166) - Remove jquery dependency from measure example ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5164](https://github.com/openlayers/ol3/pull/5164) - Cartodb cleanup ([@fredj](https://github.com/fredj))
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
# v3.17.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v3.17.0 release includes features and fixes from 60 pull requests since the v3.16.0 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library.
|
|
||||||
|
|
||||||
## Upgrade notes
|
|
||||||
|
|
||||||
#### `ol.source.MapQuest` removal
|
|
||||||
|
|
||||||
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
|
|
||||||
|
|
||||||
#### `ol.interaction.ModifyEvent` changes
|
|
||||||
|
|
||||||
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
|
|
||||||
|
|
||||||
#### Removal of ol.raster namespace
|
|
||||||
|
|
||||||
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
|
|
||||||
* `ol.raster.Operation` to `ol.RasterOperation`
|
|
||||||
* `ol.raster.OperationType` to `ol.RasterOperationType`
|
|
||||||
|
|
||||||
#### All typedefs now in ol namespace
|
|
||||||
|
|
||||||
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
|
|
||||||
* ol.events.ConditionType to ol.EventsConditionType
|
|
||||||
* ol.events.EventTargetLike to ol.EventTargetLike
|
|
||||||
* ol.events.Key to ol.EventsKey
|
|
||||||
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
|
|
||||||
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
|
|
||||||
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
|
|
||||||
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
|
|
||||||
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
|
|
||||||
* ol.interaction.SnapResultType to ol.SnapResultType
|
|
||||||
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
|
|
||||||
* ol.proj.ProjectionLike to ol.ProjectionLike
|
|
||||||
* ol.style.AtlasBlock to ol.AtlasBlock
|
|
||||||
* ol.style.AtlasInfo to ol.AtlasInfo
|
|
||||||
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
|
|
||||||
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
|
|
||||||
* ol.style.ImageOptions to ol.StyleImageOptions
|
|
||||||
* ol.style.GeometryFunction to ol.StyleGeometryFunction
|
|
||||||
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
|
|
||||||
* ol.style.StyleFunction to ol.StyleFunction
|
|
||||||
|
|
||||||
## Full list of changes
|
|
||||||
|
|
||||||
* [#5539](https://github.com/openlayers/ol3/pull/5539) - Remove outdated comments re goog.dom ([@probins](https://github.com/probins))
|
|
||||||
* [#5543](https://github.com/openlayers/ol3/pull/5543) - Update rbush to 2.0.1 ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5540](https://github.com/openlayers/ol3/pull/5540) - Remove MapQuest source ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#5538](https://github.com/openlayers/ol3/pull/5538) - Replace remaining goog.inherits ([@probins](https://github.com/probins))
|
|
||||||
* [#5536](https://github.com/openlayers/ol3/pull/5536) - Update to layer-extent example ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5482](https://github.com/openlayers/ol3/pull/5482) - Fix for regression in tile layer extent ([@ischneider](https://github.com/ischneider))
|
|
||||||
* [#5475](https://github.com/openlayers/ol3/pull/5475) - Remove goog.provide from enums only used internally or in olx.js ([@probins](https://github.com/probins))
|
|
||||||
* [#5424](https://github.com/openlayers/ol3/pull/5424) - Don't dispatch select event if no feature is selected or deselected ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5522](https://github.com/openlayers/ol3/pull/5522) - Add 'condition' option to ol.interaction.DragPanOptions in olx.js ([@SamuelBerger](https://github.com/SamuelBerger))
|
|
||||||
* [#5443](https://github.com/openlayers/ol3/pull/5443) - Remove olx.source.WMTSOptions#maxZoom option ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5497](https://github.com/openlayers/ol3/pull/5497) - Update istanbul to version 0.4.4 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5523](https://github.com/openlayers/ol3/pull/5523) - Update closure-util to version 1.15.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5508](https://github.com/openlayers/ol3/pull/5508) - Fix problems with ol.format.WFS in compiled mode ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5512](https://github.com/openlayers/ol3/pull/5512) - Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5513](https://github.com/openlayers/ol3/pull/5513) - Add getters for min and max resolution of the view ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#5471](https://github.com/openlayers/ol3/pull/5471) - Fix GPX write of xsi ns ([@probins](https://github.com/probins))
|
|
||||||
* [#5134](https://github.com/openlayers/ol3/pull/5134) - Remove goog.dom ([@nicholas-l](https://github.com/nicholas-l))
|
|
||||||
* [#5511](https://github.com/openlayers/ol3/pull/5511) - Do not optimize lines away entirely ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5509](https://github.com/openlayers/ol3/pull/5509) - Make it easier to work with tile ranges in custom source implementations ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5498](https://github.com/openlayers/ol3/pull/5498) - Update eslint to version 2.13.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5495](https://github.com/openlayers/ol3/pull/5495) - Get rid of goog.isFunction ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5499](https://github.com/openlayers/ol3/pull/5499) - Update glob to version 7.0.5 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5125](https://github.com/openlayers/ol3/pull/5125) - Remove goog style ([@nicholas-l](https://github.com/nicholas-l))
|
|
||||||
* [#5494](https://github.com/openlayers/ol3/pull/5494) - Remove goog.global ([@probins](https://github.com/probins))
|
|
||||||
* [#5492](https://github.com/openlayers/ol3/pull/5492) - Update eslint to version 2.13.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5490](https://github.com/openlayers/ol3/pull/5490) - Update glob to version 7.0.4 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5460](https://github.com/openlayers/ol3/pull/5460) - Update eslint to version 2.12.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5479](https://github.com/openlayers/ol3/pull/5479) - Update slimerjs to version 0.906.2 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5474](https://github.com/openlayers/ol3/pull/5474) - Update clean-css to version 3.4.18 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5450](https://github.com/openlayers/ol3/pull/5450) - Remove sub-namespaces from all remaining typedefs ([@probins](https://github.com/probins))
|
|
||||||
* [#5465](https://github.com/openlayers/ol3/pull/5465) - Fix custom icon positions and rotation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5469](https://github.com/openlayers/ol3/pull/5469) - Fix typo ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#5453](https://github.com/openlayers/ol3/pull/5453) - Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5208](https://github.com/openlayers/ol3/pull/5208) - Stop GPX writing rtept properties ([@probins](https://github.com/probins))
|
|
||||||
* [#5452](https://github.com/openlayers/ol3/pull/5452) - Update eslint-config-openlayers to version 5.0.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5432](https://github.com/openlayers/ol3/pull/5432) - Remove use of goog.uri ([@bjornharrtell](https://github.com/bjornharrtell))
|
|
||||||
* [#5449](https://github.com/openlayers/ol3/pull/5449) - Make example data/ paths absolute for source view and JSFiddle ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5399](https://github.com/openlayers/ol3/pull/5399) - Remove ol.raster namespace ([@probins](https://github.com/probins))
|
|
||||||
* [#5270](https://github.com/openlayers/ol3/pull/5270) - Load erroneous image in ol.Image#load and ol.ImageTile#load ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5194](https://github.com/openlayers/ol3/pull/5194) - Get rid of goog.inherits and goog.base ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5427](https://github.com/openlayers/ol3/pull/5427) - Document typedefs and enums used by API symbols ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5438](https://github.com/openlayers/ol3/pull/5438) - Don't make ol.format.ogc.filter.Filter inherit from ol.Object ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5433](https://github.com/openlayers/ol3/pull/5433) - Update clean-css to version 3.4.17 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5434](https://github.com/openlayers/ol3/pull/5434) - Fix externs in closure compiler tutorial ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5426](https://github.com/openlayers/ol3/pull/5426) - Fix icon example to anchor popup to feature location ([@frankrowe](https://github.com/frankrowe))
|
|
||||||
* [#5421](https://github.com/openlayers/ol3/pull/5421) - Correct typo in config/jsdoc/api/readme.md ([@probins](https://github.com/probins))
|
|
||||||
* [#5417](https://github.com/openlayers/ol3/pull/5417) - Update clean-css to version 3.4.16 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5413](https://github.com/openlayers/ol3/pull/5413) - Update clean-css to version 3.4.15 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5410](https://github.com/openlayers/ol3/pull/5410) - Update eslint to version 2.11.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5408](https://github.com/openlayers/ol3/pull/5408) - Update pbf to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5404](https://github.com/openlayers/ol3/pull/5404) - Update eslint to version 2.11.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5402](https://github.com/openlayers/ol3/pull/5402) - Pass in srsName option to writeTransaction ([@anzhihun](https://github.com/anzhihun))
|
|
||||||
* [#5393](https://github.com/openlayers/ol3/pull/5393) - Update mocha to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5394](https://github.com/openlayers/ol3/pull/5394) - Update resemblejs to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5390](https://github.com/openlayers/ol3/pull/5390) - Fix the requestEncoding automatic selection ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5392](https://github.com/openlayers/ol3/pull/5392) - Update closure-util to version 1.14.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5388](https://github.com/openlayers/ol3/pull/5388) - Update mocha to version 2.5.2 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5382](https://github.com/openlayers/ol3/pull/5382) - Handle UTC midnight wrap around, fixes #5371 ([@twpayne](https://github.com/twpayne))
|
|
||||||
* [#5381](https://github.com/openlayers/ol3/pull/5381) - Update mocha to version 2.5.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5383](https://github.com/openlayers/ol3/pull/5383) - Update clean-css to version 3.4.13 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# v3.17.1
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v3.17.1 release is a patch release that addresses a regression in the v3.17.0 release. See the [v3.17.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.17.0) for details on upgrading from v3.16.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#5548](https://github.com/openlayers/ol3/pull/5548) - Fix CHANGETYPE in ol.control.FullScreen ([@GaborFarkas](https://github.com/GaborFarkas))
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
# v3.18.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v3.18.0 release includes features and fixes from almost 120 pull requests since the v3.17.1 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library. New features include:
|
|
||||||
|
|
||||||
* Addition of `Intersects` and `Within` filters to `ol.format.ogc.filter` [#5668](https://github.com/openlayers/ol3/pull/5668)
|
|
||||||
* New `overlaps` option for `ol.source.Vector` and `ol.source.VectorTile` to improve rendering performance for polygon topologies [#5196](https://github.com/openlayers/ol3/pull/5196)
|
|
||||||
* New `rotateWithView` option for `ol.style.Text` to control appearance of text on rotated views [#5050](https://github.com/openlayers/ol3/pull/5050)
|
|
||||||
* Add a `#scale()` method to `ol.geom.Geometry` and subclasses [#5685](https://github.com/openlayers/ol3/pull/5685)
|
|
||||||
* Parse `id` of features in `ol.format.MVT` [#5613](https://github.com/openlayers/ol3/pull/5613)
|
|
||||||
|
|
||||||
## Upgrade notes
|
|
||||||
|
|
||||||
#### Changes in the way assertions are handled
|
|
||||||
|
|
||||||
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
|
||||||
|
|
||||||
#### Removal of `ol.ENABLE_NAMED_COLORS`
|
|
||||||
|
|
||||||
This option was previously needed to use named colors with the WebGL renderer but is no longer needed.
|
|
||||||
|
|
||||||
#### KML format now uses URL()
|
|
||||||
|
|
||||||
The URL constructor is supported by all modern browsers, but not by older ones, such as IE. To use the KML format in such older browsers, a URL polyfill will have to be loaded before use.
|
|
||||||
|
|
||||||
#### Changes only relevant to those who compile their applications together with the Closure Compiler
|
|
||||||
|
|
||||||
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
|
|
||||||
|
|
||||||
* rename `ol.CollectionEventType` to `ol.Collection.EventType`
|
|
||||||
* rename `ol.CollectionEvent` to `ol.Collection.Event`
|
|
||||||
* rename `ol.ViewHint` to `ol.View.Hint`
|
|
||||||
* rename `ol.ViewProperty` to `ol.View.Property`
|
|
||||||
* rename `ol.render.webgl.imagereplay.shader.Default.Locations` to `ol.render.webgl.imagereplay.defaultshader.Locations`
|
|
||||||
* rename `ol.render.webgl.imagereplay.shader.DefaultFragment` to `ol.render.webgl.imagereplay.defaultshader.Fragment`
|
|
||||||
* rename `ol.render.webgl.imagereplay.shader.DefaultVertex` to `ol.render.webgl.imagereplay.defaultshader.Vertex`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.Default.Locations` to `ol.renderer.webgl.defaultmapshader.Locations`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.DefaultFragment` to `ol.renderer.webgl.defaultmapshader.Fragment`
|
|
||||||
* rename `ol.renderer.webgl.map.shader.DefaultVertex` to `ol.renderer.webgl.defaultmapshader.Vertex`
|
|
||||||
* rename `ol.renderer.webgl.tilelayer.shader.Fragment` to `ol.renderer.webgl.tilelayershader.Fragment`
|
|
||||||
* rename `ol.renderer.webgl.tilelayer.shader.Locations` to `ol.renderer.webgl.tilelayershader.Locations`
|
|
||||||
* rename `ol.renderer.webgl.tilelayer.shader.Vertex` to `ol.renderer.webgl.tilelayershader.Vertex`
|
|
||||||
* rename `ol.webgl.WebGLContextEventType` to `ol.webgl.ContextEventType`
|
|
||||||
* rename `ol.webgl.shader.Fragment` to `ol.webgl.Fragment`
|
|
||||||
* rename `ol.webgl.shader.Vertex` to `ol.webgl.Vertex`
|
|
||||||
|
|
||||||
## Full list of changes
|
|
||||||
|
|
||||||
* [#5782](https://github.com/openlayers/ol3/pull/5782) - Compare URLs in an IE compatible way ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5778](https://github.com/openlayers/ol3/pull/5778) - Use Mapzen instead of openstreetmap.us tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5774](https://github.com/openlayers/ol3/pull/5774) - Update glob to version 7.0.6 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5708](https://github.com/openlayers/ol3/pull/5708) - Remove unnecessary closePath() instructions ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5196](https://github.com/openlayers/ol3/pull/5196) - Batch polygon and circle fills and strokes ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5768](https://github.com/openlayers/ol3/pull/5768) - Enable extent clipping for vector layers ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#4753](https://github.com/openlayers/ol3/pull/4753) - Export ol.geom.Geometry#containsCoordinate function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5050](https://github.com/openlayers/ol3/pull/5050) - Add rotateWithView option to ol.style.Text ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5767](https://github.com/openlayers/ol3/pull/5767) - Accept feature without geometry in ol.interaction.Modify ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5334](https://github.com/openlayers/ol3/pull/5334) - Load the examples resources with HTTPS ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5766](https://github.com/openlayers/ol3/pull/5766) - Use HTTPS to access tiles at tileserver.maptiler.com in examples ([@klokantech](https://github.com/klokantech))
|
|
||||||
* [#5765](https://github.com/openlayers/ol3/pull/5765) - Force a map render when the view is not updated ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5724](https://github.com/openlayers/ol3/pull/5724) - Fix clipping of the tile layer extent on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5764](https://github.com/openlayers/ol3/pull/5764) - Remove unnecessary map.render() calls ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#5763](https://github.com/openlayers/ol3/pull/5763) - Fix assert namespace ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5616](https://github.com/openlayers/ol3/pull/5616) - Fix event type and documentation of ol.events.condition.mouseOnly ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5755](https://github.com/openlayers/ol3/pull/5755) - Increase the size of the map in ol.layer.Tile rendering tests ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5757](https://github.com/openlayers/ol3/pull/5757) - Add ol.source.Cluster#setDistance function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5752](https://github.com/openlayers/ol3/pull/5752) - Set proper replay canvas size and offset for rotated view ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5754](https://github.com/openlayers/ol3/pull/5754) - Update istanbul to version 0.4.5 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5727](https://github.com/openlayers/ol3/pull/5727) - Add missing goog require ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5273](https://github.com/openlayers/ol3/pull/5273) - Take the pixelRatio into account when computing the gutter ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5753](https://github.com/openlayers/ol3/pull/5753) - Update proj4 to version 2.3.15 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5741](https://github.com/openlayers/ol3/pull/5741) - Point to the English workshop ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#5721](https://github.com/openlayers/ol3/pull/5721) - Update metalsmith to version 2.2.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5733](https://github.com/openlayers/ol3/pull/5733) - Fix #5730 - Ignore null/undef. values in uri.appendParams ([@adube](https://github.com/adube))
|
|
||||||
* [#5736](https://github.com/openlayers/ol3/pull/5736) - Show `resultType` attribute in docs ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5735](https://github.com/openlayers/ol3/pull/5735) - Update eslint to version 3.3.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5731](https://github.com/openlayers/ol3/pull/5731) - Added a pixelRatio adjust to the canvasTileLayer 'forEachLayerAtPixel… ([@Benjaki2](https://github.com/Benjaki2))
|
|
||||||
* [#5732](https://github.com/openlayers/ol3/pull/5732) - Add missing curly braces in type annotations ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5728](https://github.com/openlayers/ol3/pull/5728) - Update closure-util to version 1.15.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5717](https://github.com/openlayers/ol3/pull/5717) - Update phantomjs-prebuilt to version 2.1.12 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5725](https://github.com/openlayers/ol3/pull/5725) - Remove tilerange assert from tilegrid/wmts ([@probins](https://github.com/probins))
|
|
||||||
* [#5723](https://github.com/openlayers/ol3/pull/5723) - Update eslint to version 3.3.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5702](https://github.com/openlayers/ol3/pull/5702) - Add rule to identify missing requires ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5670](https://github.com/openlayers/ol3/pull/5670) - Added image data value to 'forEachLayerAtPixel' method callback ([@Benjaki2](https://github.com/Benjaki2))
|
|
||||||
* [#5720](https://github.com/openlayers/ol3/pull/5720) - Fix typo in tilegrid/wmts ([@probins](https://github.com/probins))
|
|
||||||
* [#5715](https://github.com/openlayers/ol3/pull/5715) - Create a check-example task for smarter example checking with PhantomJS ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5714](https://github.com/openlayers/ol3/pull/5714) - Add FAQ entry about renderBuffer ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#5713](https://github.com/openlayers/ol3/pull/5713) - Check examples with http protocol instead of file ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5689](https://github.com/openlayers/ol3/pull/5689) - Fix cursor change in translate interaction ([@pgiraud](https://github.com/pgiraud))
|
|
||||||
* [#5165](https://github.com/openlayers/ol3/pull/5165) - Remove goog.addSingletonGetter function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5701](https://github.com/openlayers/ol3/pull/5701) - Update phantomjs-prebuilt to version 2.1.11 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5698](https://github.com/openlayers/ol3/pull/5698) - Custom rule to identify unused goog.require() calls ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5699](https://github.com/openlayers/ol3/pull/5699) - Update mocha to version 3.0.2 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5697](https://github.com/openlayers/ol3/pull/5697) - Re-enable ESLint config ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5693](https://github.com/openlayers/ol3/pull/5693) - Reorganize files so they are named like their default export ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5694](https://github.com/openlayers/ol3/pull/5694) - layer.Base in Map not required ([@probins](https://github.com/probins))
|
|
||||||
* [#5695](https://github.com/openlayers/ol3/pull/5695) - Remove unneeded requires in renderers ([@probins](https://github.com/probins))
|
|
||||||
* [#5692](https://github.com/openlayers/ol3/pull/5692) - Small text fix ([@bngsudheer](https://github.com/bngsudheer))
|
|
||||||
* [#5682](https://github.com/openlayers/ol3/pull/5682) - Update mocha to version 3.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5619](https://github.com/openlayers/ol3/pull/5619) - Remove goog.asserts.* ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5685](https://github.com/openlayers/ol3/pull/5685) - Add a method to scale geometries ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#5674](https://github.com/openlayers/ol3/pull/5674) - Support fractional zoom levels in ol.View#getZoom and #setZoom ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5681](https://github.com/openlayers/ol3/pull/5681) - Remove extra goog.require ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5680](https://github.com/openlayers/ol3/pull/5680) - Update phantomjs-prebuilt to version 2.1.10 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5668](https://github.com/openlayers/ol3/pull/5668) - Added Intersects and Within filters into ol.format.wfs ([@cpsTinK](https://github.com/cpsTinK))
|
|
||||||
* [#5675](https://github.com/openlayers/ol3/pull/5675) - Remove unused goog.provide ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5673](https://github.com/openlayers/ol3/pull/5673) - Add missing semicolon ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5587](https://github.com/openlayers/ol3/pull/5587) - Lazily create KML style defaults ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5599](https://github.com/openlayers/ol3/pull/5599) - Allow subpixel center on view ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5630](https://github.com/openlayers/ol3/pull/5630) - chore(build): guard against unterminated scripts ([@tlvince](https://github.com/tlvince))
|
|
||||||
* [#5669](https://github.com/openlayers/ol3/pull/5669) - Fix Github links to specific lines on jsdoc pages ([@dtreiter](https://github.com/dtreiter))
|
|
||||||
* [#5667](https://github.com/openlayers/ol3/pull/5667) - Do not return undefined from ol.proj.get ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5665](https://github.com/openlayers/ol3/pull/5665) - Update eslint to version 3.2.2 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5632](https://github.com/openlayers/ol3/pull/5632) - Improve docs for the ol.LoadingStrategy type ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5641](https://github.com/openlayers/ol3/pull/5641) - De-randomize the listener map property ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5664](https://github.com/openlayers/ol3/pull/5664) - Update eslint to version 3.2.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5658](https://github.com/openlayers/ol3/pull/5658) - Update marked to version 0.3.6 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5657](https://github.com/openlayers/ol3/pull/5657) - Update phantomjs-prebuilt to version 2.1.9 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5652](https://github.com/openlayers/ol3/pull/5652) - Make XHR work for file:// urls ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5653](https://github.com/openlayers/ol3/pull/5653) - Fix namespace in filter docs ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5651](https://github.com/openlayers/ol3/pull/5651) - Update coveralls to version 2.11.12 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5649](https://github.com/openlayers/ol3/pull/5649) - Fix DateTime parsing with non-Zulu times ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5648](https://github.com/openlayers/ol3/pull/5648) - Update sinon to version 1.17.5 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5646](https://github.com/openlayers/ol3/pull/5646) - Update phantomjs-prebuilt to version 2.1.8 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5644](https://github.com/openlayers/ol3/pull/5644) - Update browserify to version 13.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5640](https://github.com/openlayers/ol3/pull/5640) - Add example for usage of HERE Map Tile API ([@chrismayer](https://github.com/chrismayer))
|
|
||||||
* [#5579](https://github.com/openlayers/ol3/pull/5579) - Update jquery to version 3.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5636](https://github.com/openlayers/ol3/pull/5636) - Update clean-css to version 3.4.19 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5634](https://github.com/openlayers/ol3/pull/5634) - Update async to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5622](https://github.com/openlayers/ol3/pull/5622) - Update TileWMS.coordKeyPrefix_ on setUrls ([@rrutkows](https://github.com/rrutkows))
|
|
||||||
* [#5611](https://github.com/openlayers/ol3/pull/5611) - Fix broken link to Google JavaScript Style Guide ([@ischas](https://github.com/ischas))
|
|
||||||
* [#5620](https://github.com/openlayers/ol3/pull/5620) - Replace goog.getUid with ol.getUid ([@probins](https://github.com/probins))
|
|
||||||
* [#5614](https://github.com/openlayers/ol3/pull/5614) - Replace goog.abstractMethod ([@probins](https://github.com/probins))
|
|
||||||
* [#5613](https://github.com/openlayers/ol3/pull/5613) - Parse MVT id property ([@drnextgis](https://github.com/drnextgis))
|
|
||||||
* [#5612](https://github.com/openlayers/ol3/pull/5612) - Update vector-tile to version 1.3.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5609](https://github.com/openlayers/ol3/pull/5609) - Update eslint to version 3.1.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5605](https://github.com/openlayers/ol3/pull/5605) - Remove goog.isObject not in assertions ([@probins](https://github.com/probins))
|
|
||||||
* [#5603](https://github.com/openlayers/ol3/pull/5603) - Update eslint to version 3.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5597](https://github.com/openlayers/ol3/pull/5597) - Avoid unnecessary getImageData calls in hit detection ([@schmidtk](https://github.com/schmidtk))
|
|
||||||
* [#5429](https://github.com/openlayers/ol3/pull/5429) - Remove enums from tests ([@probins](https://github.com/probins))
|
|
||||||
* [#5516](https://github.com/openlayers/ol3/pull/5516) - Remove goog.Uri from KML format ([@probins](https://github.com/probins))
|
|
||||||
* [#5598](https://github.com/openlayers/ol3/pull/5598) - Clarify that default source.Vector loader only handles features ([@probins](https://github.com/probins))
|
|
||||||
* [#5595](https://github.com/openlayers/ol3/pull/5595) - Use tile keys instead of coord keys ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5594](https://github.com/openlayers/ol3/pull/5594) - Add renderBuffer option for ol.source.ImageVector ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5592](https://github.com/openlayers/ol3/pull/5592) - Update coveralls to version 2.11.11 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#5593](https://github.com/openlayers/ol3/pull/5593) - Update async to version 2.0.0 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#4194](https://github.com/openlayers/ol3/pull/4194) - Remove usage of goog.color and closure named colors ([@bjornharrtell](https://github.com/bjornharrtell))
|
|
||||||
* [#5583](https://github.com/openlayers/ol3/pull/5583) - Fix dead link for change event in API docs ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5560](https://github.com/openlayers/ol3/pull/5560) - Get rid of goog.isArrayLike ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5573](https://github.com/openlayers/ol3/pull/5573) - Determine ol.global in a way that works in more environments ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5558](https://github.com/openlayers/ol3/pull/5558) - Remove goog.Uri from tests ([@probins](https://github.com/probins))
|
|
||||||
* [#5578](https://github.com/openlayers/ol3/pull/5578) - Add polyfills to copy/paste code ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5577](https://github.com/openlayers/ol3/pull/5577) - Fix olx.source.OSMOptions#url default value documentation ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5576](https://github.com/openlayers/ol3/pull/5576) - Use the word "documentation" ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5575](https://github.com/openlayers/ol3/pull/5575) - Add a bit more info about the library to the README ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5574](https://github.com/openlayers/ol3/pull/5574) - Add paragraph about supported browsers and polyfills ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5570](https://github.com/openlayers/ol3/pull/5570) - Upgrade JSTS in example to 1.2.0 ([@bjornharrtell](https://github.com/bjornharrtell))
|
|
||||||
* [#5566](https://github.com/openlayers/ol3/pull/5566) - Fix ol.style.Image#getAnchor documentation ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5546](https://github.com/openlayers/ol3/pull/5546) - Remove useless target argument from ol.Event and subclass constructors ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5565](https://github.com/openlayers/ol3/pull/5565) - Reinsert goog.provide for enums in olx.js ([@probins](https://github.com/probins))
|
|
||||||
* [#5561](https://github.com/openlayers/ol3/pull/5561) - Add unit tests for ol.View.createCenterConstraint ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5563](https://github.com/openlayers/ol3/pull/5563) - Return if a vertex was removed in ol.interaction.Modify#removeVertex_ ([@fredj](https://github.com/fredj))
|
|
||||||
* [#5533](https://github.com/openlayers/ol3/pull/5533) - Make sure reprojected tiles are recreated on updateParams ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5534](https://github.com/openlayers/ol3/pull/5534) - Fix ScaleLine control documentation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5541](https://github.com/openlayers/ol3/pull/5541) - Replace goog.isNumber ([@probins](https://github.com/probins))
|
|
||||||
* [#5552](https://github.com/openlayers/ol3/pull/5552) - Replace goog.webgl. ([@probins](https://github.com/probins))
|
|
||||||
* [#5550](https://github.com/openlayers/ol3/pull/5550) - Remove use of ol.vec.Mat4 calls remaining after #5482 ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5507](https://github.com/openlayers/ol3/pull/5507) - Remove use of goog.vec.* ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# v3.18.1
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v3.18.1 release is a patch release that addresses two regressions in the v3.18.0 release. See the [v3.18.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.18.0) for details on upgrading from v3.17.x.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#5798](https://github.com/openlayers/ol3/pull/5798) - Move to 90° along the circle, not 0° ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#5790](https://github.com/openlayers/ol3/pull/5790) - Fix vector tile rotation on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# v3.18.2
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v3.18.2 release is a patch release that addresses a regression in the v3.18.1 release. See the [v3.18.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.18.0) for details on upgrading from v3.17.x.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#5828](https://github.com/openlayers/ol3/pull/5828) - Always close polygon rings ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -24,12 +24,15 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false"
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
"jscomp_off": [
|
||||||
|
"unnecessaryCasts",
|
||||||
|
"useOfGoogBase",
|
||||||
"lintChecks",
|
"lintChecks",
|
||||||
"analyzerChecks",
|
"analyzerChecks",
|
||||||
"missingProvide",
|
"missingProvide",
|
||||||
|
|||||||
@@ -24,12 +24,15 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false"
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
"jscomp_off": [
|
||||||
|
"unnecessaryCasts",
|
||||||
|
"useOfGoogBase",
|
||||||
"lintChecks",
|
"lintChecks",
|
||||||
"analyzerChecks"
|
"analyzerChecks"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||||
{{{ extraHead.local }}}
|
{{{ extraHead.local }}}
|
||||||
{{{ css.tag }}}
|
{{{ css.tag }}}
|
||||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList"></script>
|
||||||
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
|
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
|
||||||
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
||||||
</div>
|
</div>
|
||||||
<form method="POST" id="jsfiddle-form" target="_blank" action="https://jsfiddle.net/api/post/library/pure/">
|
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/library/pure/">
|
||||||
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
||||||
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
||||||
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
||||||
@@ -73,8 +73,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||||
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
|
||||||
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
|
||||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ exports.defineTags = function(dictionary) {
|
|||||||
canHaveType: false,
|
canHaveType: false,
|
||||||
canHaveName: false,
|
canHaveName: false,
|
||||||
onTagged: function(doclet, tag) {
|
onTagged: function(doclet, tag) {
|
||||||
includeTypes(doclet);
|
|
||||||
var level = tag.text || "experimental";
|
var level = tag.text || "experimental";
|
||||||
if (levels.indexOf(level) >= 0) {
|
if (levels.indexOf(level) >= 0) {
|
||||||
doclet.stability = level;
|
doclet.stability = level;
|
||||||
@@ -26,15 +25,11 @@ exports.defineTags = function(dictionary) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Based on @api annotations, and assuming that items with no @api annotation
|
* Based on @stability annotations, and assuming that items with no @stability
|
||||||
* should not be documented, this plugin removes undocumented symbols
|
* annotation should not be documented, this plugin removes undocumented symbols
|
||||||
* from the documentation.
|
* from the documentation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var api = [];
|
|
||||||
var classes = {};
|
|
||||||
var types = {};
|
|
||||||
|
|
||||||
function hasApiMembers(doclet) {
|
function hasApiMembers(doclet) {
|
||||||
return doclet.longname.split('#')[0] == this.longname;
|
return doclet.longname.split('#')[0] == this.longname;
|
||||||
}
|
}
|
||||||
@@ -76,30 +71,8 @@ function includeAugments(doclet) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function extractTypes(item) {
|
var api = [];
|
||||||
item.type.names.forEach(function(type) {
|
var classes = {};
|
||||||
var match = type.match(/^(.*<)?([^>]*)>?$/);
|
|
||||||
if (match) {
|
|
||||||
types[match[2]] = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function includeTypes(doclet) {
|
|
||||||
if (doclet.params && doclet.kind != 'class') {
|
|
||||||
doclet.params.forEach(extractTypes);
|
|
||||||
}
|
|
||||||
if (doclet.returns) {
|
|
||||||
doclet.returns.forEach(extractTypes);
|
|
||||||
}
|
|
||||||
if (doclet.isEnum) {
|
|
||||||
types[doclet.meta.code.name] = true;
|
|
||||||
}
|
|
||||||
if (doclet.type && doclet.meta.code.type == 'MemberExpression') {
|
|
||||||
// types in olx.js
|
|
||||||
extractTypes(doclet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.handlers = {
|
exports.handlers = {
|
||||||
|
|
||||||
@@ -107,9 +80,6 @@ exports.handlers = {
|
|||||||
var doclet = e.doclet;
|
var doclet = e.doclet;
|
||||||
// Keep track of api items - needed in parseComplete to determine classes
|
// Keep track of api items - needed in parseComplete to determine classes
|
||||||
// with api members.
|
// with api members.
|
||||||
if (doclet.meta.filename == 'olx.js' && doclet.kind == 'typedef') {
|
|
||||||
doclet.undocumented = false;
|
|
||||||
}
|
|
||||||
if (doclet.stability) {
|
if (doclet.stability) {
|
||||||
api.push(doclet);
|
api.push(doclet);
|
||||||
}
|
}
|
||||||
@@ -150,7 +120,7 @@ exports.handlers = {
|
|||||||
// constructor from the docs.
|
// constructor from the docs.
|
||||||
doclet._hideConstructor = true;
|
doclet._hideConstructor = true;
|
||||||
includeAugments(doclet);
|
includeAugments(doclet);
|
||||||
} else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
|
} else if (!doclet._hideConstructor) {
|
||||||
// Remove all other undocumented symbols
|
// Remove all other undocumented symbols
|
||||||
doclet.undocumented = true;
|
doclet.undocumented = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ exports.handlers = {
|
|||||||
newDoclet: function(e) {
|
newDoclet: function(e) {
|
||||||
var doclet = e.doclet;
|
var doclet = e.doclet;
|
||||||
if (doclet.meta.filename == 'olx.js') {
|
if (doclet.meta.filename == 'olx.js') {
|
||||||
|
// do nothing if not marked @api
|
||||||
|
if (!doclet.stability) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (doclet.kind == 'typedef') {
|
if (doclet.kind == 'typedef') {
|
||||||
lastOlxTypedef = doclet;
|
lastOlxTypedef = doclet;
|
||||||
olxTypeNames.push(doclet.longname);
|
olxTypeNames.push(doclet.longname);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ The second line tells the Closure compiler the type of the argument.
|
|||||||
|
|
||||||
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
|
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
|
||||||
|
|
||||||
The `@api` annotation can be used in conjunction with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
|
The `@api` annotation can be used in conjunciton with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ $(function () {
|
|||||||
var link = 'https://github.com/openlayers/ol3/blob/v' + currentVersion + '/' +
|
var link = 'https://github.com/openlayers/ol3/blob/v' + currentVersion + '/' +
|
||||||
textParts[0];
|
textParts[0];
|
||||||
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
|
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
|
||||||
'<a href="' + link + textParts[1].replace('line ', '#L') + '">' +
|
'<a href="' + link + textParts[1].replace('line ', '#l') + '">' +
|
||||||
textParts[1] + '</a>';
|
textParts[1] + '</a>';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import url(https://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400italic,700);
|
@import url(http://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400italic,700);
|
||||||
.navbar-inverse {
|
.navbar-inverse {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ var self = this;
|
|||||||
<?js
|
<?js
|
||||||
item.typedefs.forEach(function (v) {
|
item.typedefs.forEach(function (v) {
|
||||||
?>
|
?>
|
||||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
|
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||||
<?js= self.linkto(v.longname, v.name) ?>
|
<?js= self.linkto(v.longname, v.name) ?>
|
||||||
</li>
|
</li>
|
||||||
<?js
|
<?js
|
||||||
@@ -56,7 +56,7 @@ var self = this;
|
|||||||
|
|
||||||
item.methods.forEach(function (v) {
|
item.methods.forEach(function (v) {
|
||||||
?>
|
?>
|
||||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
|
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||||
<?js= self.linkto(v.longname, v.name) ?>
|
<?js= self.linkto(v.longname, v.name) ?>
|
||||||
</li>
|
</li>
|
||||||
<?js
|
<?js
|
||||||
@@ -73,7 +73,7 @@ var self = this;
|
|||||||
item.fires.forEach(function (v) {
|
item.fires.forEach(function (v) {
|
||||||
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
|
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
|
||||||
?>
|
?>
|
||||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability != 'stable') ? 'unstable' : '' ?>">
|
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability != 'stable' ? 'unstable' : '') ?>">
|
||||||
<?js= self.linkto(v.longname, v.name) ?>
|
<?js= self.linkto(v.longname, v.name) ?>
|
||||||
</li>
|
</li>
|
||||||
<?js
|
<?js
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
var setter = prop.readonly ? 'no' : 'yes';
|
var setter = prop.readonly ? 'no' : 'yes';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr class="<?js= (prop.stability && prop.stability !== 'stable') ? 'unstable' : '' ?>">
|
<tr class="<?js= prop.stability !== 'stable' ? 'unstable' : '' ?>">
|
||||||
<td class="name"><code><?js= prop.name ?></code></td>
|
<td class="name"><code><?js= prop.name ?></code></td>
|
||||||
<td class="type">
|
<td class="type">
|
||||||
<?js if (prop.type && prop.type.names) {?>
|
<?js if (prop.type && prop.type.names) {?>
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
var data = obj;
|
var data = obj;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
if (data.stability && data.stability != 'stable') { ?>
|
if (data.stability != 'stable') { ?>
|
||||||
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
|
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<section>
|
<section>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<?js if (children.length > 0) { ?>
|
<?js if (children.length > 0) { ?>
|
||||||
<ul><?js
|
<ul><?js
|
||||||
@@ -10,10 +10,10 @@
|
|||||||
<?js } ?>
|
<?js } ?>
|
||||||
|
|
||||||
<h2><?js= header ?></h2>
|
<h2><?js= header ?></h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
<?js= content ?>
|
<?js= content ?>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -15,12 +15,15 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false"
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
"jscomp_off": [
|
||||||
|
"unnecessaryCasts",
|
||||||
|
"useOfGoogBase",
|
||||||
"lintChecks",
|
"lintChecks",
|
||||||
"analyzerChecks"
|
"analyzerChecks"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,226 +0,0 @@
|
|||||||
---
|
|
||||||
title: Errors
|
|
||||||
layout: doc.hbs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Errors
|
|
||||||
|
|
||||||
### 1
|
|
||||||
|
|
||||||
The view center is not defined.
|
|
||||||
|
|
||||||
### 2
|
|
||||||
|
|
||||||
The view resolution is not defined.
|
|
||||||
|
|
||||||
### 3
|
|
||||||
|
|
||||||
The view rotation is not defined.
|
|
||||||
|
|
||||||
### 4
|
|
||||||
|
|
||||||
`image` and `src` cannot be provided at the same time.
|
|
||||||
|
|
||||||
### 5
|
|
||||||
|
|
||||||
`imgSize` must be set when `image` is provided.
|
|
||||||
|
|
||||||
### 6
|
|
||||||
|
|
||||||
A defined and non-empty `src` or `image` must be provided.
|
|
||||||
|
|
||||||
### 7
|
|
||||||
|
|
||||||
`format` must be set when `url` is set.
|
|
||||||
|
|
||||||
### 8
|
|
||||||
|
|
||||||
Unknown `serverType` configured.
|
|
||||||
|
|
||||||
### 9
|
|
||||||
|
|
||||||
`url` must be configured or set using `#setUrl()`.
|
|
||||||
|
|
||||||
### 10
|
|
||||||
|
|
||||||
The default `geometryFunction` can only handle `ol.geom.Point` geometries.
|
|
||||||
|
|
||||||
### 11
|
|
||||||
|
|
||||||
`options.featureTypes` should be an Array.
|
|
||||||
|
|
||||||
### 12
|
|
||||||
|
|
||||||
`options.geometryName` must also be provided when `options.bbox` is set.
|
|
||||||
|
|
||||||
### 13
|
|
||||||
|
|
||||||
Invalid corner. Valid corners are `top-left`, `top-right`, `bottom-right` and `bottom-left`.
|
|
||||||
|
|
||||||
### 14
|
|
||||||
|
|
||||||
Invalid color. Valid colors are all [CSS colors](https://developer.mozilla.org/en-US/docs/Web/CSS/color).
|
|
||||||
|
|
||||||
### 15
|
|
||||||
|
|
||||||
Tried to get a value for a key that does not exist in the cache.
|
|
||||||
|
|
||||||
### 16
|
|
||||||
|
|
||||||
Tried to set a value for a key that is used already.
|
|
||||||
|
|
||||||
### 17
|
|
||||||
|
|
||||||
`resolutions` must be sorted in descending order.
|
|
||||||
|
|
||||||
### 18
|
|
||||||
|
|
||||||
Either `origin` or `origins` must be configured, never both.
|
|
||||||
|
|
||||||
### 19
|
|
||||||
|
|
||||||
Number of `tileSizes` and `resolutions` must be equal.
|
|
||||||
|
|
||||||
### 20
|
|
||||||
|
|
||||||
Number of `origins` and `resolutions` must be equal.
|
|
||||||
|
|
||||||
### 22
|
|
||||||
|
|
||||||
Either `tileSize` or `tileSizes` must be configured, never both.
|
|
||||||
|
|
||||||
### 23
|
|
||||||
|
|
||||||
The passed `ol.TileCoord`s must all have the same `z` value.
|
|
||||||
|
|
||||||
### 24
|
|
||||||
|
|
||||||
Invalid extent or geometry provided as `geometry`.
|
|
||||||
|
|
||||||
### 25
|
|
||||||
|
|
||||||
Cannot fit empty extent provided as `geometry`.
|
|
||||||
|
|
||||||
### 26
|
|
||||||
|
|
||||||
Features for `deletes` must have an id set by the feature reader or `ol.Feature#setId()`.
|
|
||||||
|
|
||||||
### 27
|
|
||||||
|
|
||||||
Features for `updates` must have an id set by the feature reader or `ol.Feature#setId()`.
|
|
||||||
|
|
||||||
### 28
|
|
||||||
|
|
||||||
`renderMode` must be `'image'`, `'hybrid'` or `'vector'`.
|
|
||||||
|
|
||||||
### 29
|
|
||||||
|
|
||||||
`x` must be greater than `0`.
|
|
||||||
|
|
||||||
### 30
|
|
||||||
|
|
||||||
The passed `feature` was already added to the source.
|
|
||||||
|
|
||||||
### 31
|
|
||||||
|
|
||||||
Tried to enqueue an `element` that was already added to the queue.
|
|
||||||
|
|
||||||
### 32
|
|
||||||
|
|
||||||
Transformation matrix cannot be inverted.
|
|
||||||
|
|
||||||
### 33
|
|
||||||
|
|
||||||
Invalid `units`. `'degrees'`, `'imperial'`, `'nautical'`, `'metric'` or `'us'` required.
|
|
||||||
|
|
||||||
### 34
|
|
||||||
|
|
||||||
Invalid geometry layout. Must be `XY`, `XYZ`, `XYM` or `XYZM`.
|
|
||||||
|
|
||||||
### 35
|
|
||||||
|
|
||||||
Unknown GeoJSON object type. Expected `"Feature"` or `"FeatureCollection"`.
|
|
||||||
|
|
||||||
### 36
|
|
||||||
|
|
||||||
Unknown SRS type. Expected `"name"` or `"EPSG"`.
|
|
||||||
|
|
||||||
### 37
|
|
||||||
|
|
||||||
Unknown geometry type found. Expected `'Point'`, `'LineString'`, `'Polygon'` or `'GeometryCollection'`.
|
|
||||||
|
|
||||||
### 38
|
|
||||||
|
|
||||||
`styleMapValue` has an unknown type.
|
|
||||||
|
|
||||||
### 39
|
|
||||||
|
|
||||||
Unknown geometry type found. Expected `'GeometryCollection'`, `'MultiPoint'`, `'MultiLineString'` or `'MultiPolygon'`.
|
|
||||||
|
|
||||||
### 40
|
|
||||||
|
|
||||||
Expected `feature` to have a geometry.
|
|
||||||
|
|
||||||
### 41
|
|
||||||
|
|
||||||
Expected an `ol.style.Style` or an array of `ol.style.Style`.
|
|
||||||
|
|
||||||
### 42
|
|
||||||
|
|
||||||
Expected an `ol.Feature`, but got an `ol.RenderFeature`.
|
|
||||||
|
|
||||||
### 43
|
|
||||||
|
|
||||||
Expected `layers` to be an array or an `ol.Collection`.
|
|
||||||
|
|
||||||
### 44
|
|
||||||
|
|
||||||
`logo.href` should be a string.
|
|
||||||
|
|
||||||
### 45
|
|
||||||
|
|
||||||
`logo.src` should be a string.
|
|
||||||
|
|
||||||
### 46
|
|
||||||
|
|
||||||
Incorrect format for `renderer` option.
|
|
||||||
|
|
||||||
### 47
|
|
||||||
|
|
||||||
Expected `controls` to be an array or an `ol.Collection`.
|
|
||||||
|
|
||||||
### 48
|
|
||||||
|
|
||||||
Expected `interactions` to be an array or an `ol.Collection`.
|
|
||||||
|
|
||||||
### 49
|
|
||||||
|
|
||||||
Expected `overlays` to be an array or an `ol.Collection`.
|
|
||||||
|
|
||||||
### 50
|
|
||||||
|
|
||||||
Cannot determine Rest Service from url.
|
|
||||||
|
|
||||||
### 51
|
|
||||||
|
|
||||||
Either `url` or `tileJSON` options must be provided.
|
|
||||||
|
|
||||||
### 52
|
|
||||||
|
|
||||||
Unknown `serverType` configured.
|
|
||||||
|
|
||||||
### 53
|
|
||||||
|
|
||||||
Unknown `tierSizeCalculation` configured.
|
|
||||||
|
|
||||||
### 54
|
|
||||||
|
|
||||||
Hex color should have 3 or 6 digits.
|
|
||||||
|
|
||||||
### 55
|
|
||||||
|
|
||||||
The `{-y}` placeholder requires a tile grid with extent.
|
|
||||||
|
|
||||||
### 56
|
|
||||||
|
|
||||||
`mapBrowserEvent` must originate from a pointer event.
|
|
||||||
19
doc/faq.md
19
doc/faq.md
@@ -20,7 +20,6 @@ Table of contents:
|
|||||||
* [Why is the order of a coordinate [lon,lat], and not [lat,lon]?](#why-is-the-order-of-a-coordinate-lon-lat-and-not-lat-lon-)
|
* [Why is the order of a coordinate [lon,lat], and not [lat,lon]?](#why-is-the-order-of-a-coordinate-lon-lat-and-not-lat-lon-)
|
||||||
* [Why aren't there any features in my source?](#why-aren-t-there-any-features-in-my-source-)
|
* [Why aren't there any features in my source?](#why-aren-t-there-any-features-in-my-source-)
|
||||||
* [How do I force a re-render of the map?](#how-do-i-force-a-re-render-of-the-map-)
|
* [How do I force a re-render of the map?](#how-do-i-force-a-re-render-of-the-map-)
|
||||||
* [Why are my features not found?](#why-are-my-features-not-found-)
|
|
||||||
* [How do I create a custom build of OpenLayers?](#how-do-i-create-a-custom-build-of-openlayers-)
|
* [How do I create a custom build of OpenLayers?](#how-do-i-create-a-custom-build-of-openlayers-)
|
||||||
* [Do I need to write my own code using Closure library?](#do-i-need-to-write-my-own-code-using-closure-library-)
|
* [Do I need to write my own code using Closure library?](#do-i-need-to-write-my-own-code-using-closure-library-)
|
||||||
* [Do I need to compress my code with Closure compiler?](#do-i-need-to-compress-my-code-with-closure-compiler-)
|
* [Do I need to compress my code with Closure compiler?](#do-i-need-to-compress-my-code-with-closure-compiler-)
|
||||||
@@ -317,24 +316,6 @@ map.render();
|
|||||||
map.renderSync();
|
map.renderSync();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Why are my features not found?
|
|
||||||
|
|
||||||
You are using `ol.Map#forEachFeatureAtPixel` or `ol.Map#hasFeatureAtPixel`, but
|
|
||||||
it sometimes does not work for large icons or labels? The *hit detection* only
|
|
||||||
checks features that are within a certain distance of the given position. For large
|
|
||||||
icons, the actual geometry of a feature might be too far away and is not considered.
|
|
||||||
|
|
||||||
In this case, set the `renderBuffer` property of `ol.layer.Vector` (the default
|
|
||||||
value is 100px):
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var vectorLayer = new ol.layer.Vector({
|
|
||||||
...
|
|
||||||
renderBuffer: 200
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
The recommended value is the size of the largest symbol, line width or label.
|
|
||||||
|
|
||||||
## How do I create a custom build of OpenLayers?
|
## How do I create a custom build of OpenLayers?
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ If you're eager to get your first OpenLayers 3 map on a page, dive into the [qui
|
|||||||
|
|
||||||
For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/).
|
For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/).
|
||||||
|
|
||||||
Make sure to also check out the [OpenLayers 3 workshop](/workshop/en/).
|
Make sure to also check out the [OpenLayers 3 workshop](/workshop/).
|
||||||
|
|
||||||
Find additional reference material in the [API docs](../apidoc).
|
Find additional reference material in the [API docs](../apidoc).
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Below you'll find a complete working example. Create a new file, copy in the co
|
|||||||
target: 'map',
|
target: 'map',
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
@@ -60,12 +60,6 @@ To include a map a web page you will need 3 things:
|
|||||||
|
|
||||||
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
||||||
|
|
||||||
**Optional:** If the application is intended to run on old platforms like Internet Explorer or Android 4.x, another script needs to be included before OpenLayers:
|
|
||||||
|
|
||||||
```xml
|
|
||||||
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### `<div>` to contain the map
|
### `<div>` to contain the map
|
||||||
|
|
||||||
@@ -91,7 +85,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
|
|||||||
target: 'map',
|
target: 'map',
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
@@ -101,7 +95,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
With this JavaScript code, a map object is created with an OSM layer zoomed on the African East coast. Let's break this down:
|
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
|
||||||
|
|
||||||
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
|
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
|
||||||
|
|
||||||
@@ -120,14 +114,14 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
|
|||||||
```js
|
```js
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
Layers in OpenLayers 3 are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles. You can consult the list of [available layer sources here](/en/{{ latest }}/apidoc/ol.source.html)
|
Layers in OpenLayers 3 are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles. You can consult the list of [available layer sources here](/en/{{ latest }}/apidoc/ol.source.html)
|
||||||
|
|
||||||
The next part of the `Map` object is the `View`. The view allows to specify the center, resolution, and rotation of the map. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
|
The next part of the `Map` object is the `View`. The view allow to specify the center, resolution, and rotation of the map. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -160,16 +160,15 @@ The minimum config file looks like this:
|
|||||||
"closure_entry_point": "app",
|
"closure_entry_point": "app",
|
||||||
"externs": [
|
"externs": [
|
||||||
"node_modules/openlayers/externs/bingmaps.js",
|
"node_modules/openlayers/externs/bingmaps.js",
|
||||||
"node_modules/openlayers/externs/cartodb.js",
|
|
||||||
"node_modules/openlayers/externs/closure-compiler.js",
|
"node_modules/openlayers/externs/closure-compiler.js",
|
||||||
"node_modules/openlayers/externs/esrijson.js",
|
|
||||||
"node_modules/openlayers/externs/geojson.js",
|
"node_modules/openlayers/externs/geojson.js",
|
||||||
"node_modules/openlayers/externs/proj4js.js",
|
"node_modules/openlayers/externs/proj4js.js",
|
||||||
"node_modules/openlayers/externs/tilejson.js",
|
"node_modules/openlayers/externs/tilejson.js",
|
||||||
"node_modules/openlayers/externs/topojson.js"
|
"node_modules/openlayers/externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false",
|
"goog.DEBUG=false",
|
||||||
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
@@ -211,16 +210,16 @@ Here is a version of `config.json` with more compilation checks enabled:
|
|||||||
"closure_entry_point": "app",
|
"closure_entry_point": "app",
|
||||||
"externs": [
|
"externs": [
|
||||||
"node_modules/openlayers/externs/bingmaps.js",
|
"node_modules/openlayers/externs/bingmaps.js",
|
||||||
"node_modules/openlayers/externs/cartodb.js",
|
|
||||||
"node_modules/openlayers/externs/closure-compiler.js",
|
"node_modules/openlayers/externs/closure-compiler.js",
|
||||||
"node_modules/openlayers/externs/esrijson.js",
|
|
||||||
"node_modules/openlayers/externs/geojson.js",
|
"node_modules/openlayers/externs/geojson.js",
|
||||||
"node_modules/openlayers/externs/proj4js.js",
|
"node_modules/openlayers/externs/proj4js.js",
|
||||||
"node_modules/openlayers/externs/tilejson.js",
|
"node_modules/openlayers/externs/tilejson.js",
|
||||||
"node_modules/openlayers/externs/topojson.js"
|
"node_modules/openlayers/externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.DEBUG=false",
|
||||||
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
@@ -231,7 +230,8 @@ Here is a version of `config.json` with more compilation checks enabled:
|
|||||||
"*"
|
"*"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
"jscomp_off": [
|
||||||
"unknownDefines",
|
"unknownDefines"
|
||||||
|
"useOfGoogBase",
|
||||||
"lintChecks",
|
"lintChecks",
|
||||||
"analyzerChecks"
|
"analyzerChecks"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Creating a custom build requires writing a build configuration file. The format
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"extra_annotation_name": [
|
"extra_annotation_name": [
|
||||||
"api", "observable"
|
"api", "observable"
|
||||||
@@ -156,6 +156,7 @@ Setting some of these to `false` means that the portions of the code relating to
|
|||||||
|
|
||||||
You might have noticed that the build file you've just created is considerably smaller than the full build, but it can be reduced further. This is because all three renderers and all layer types are included by default. We only need one renderer, and only need the tile layer, so can exclude the others by setting these properties with `define`s. So add the following to the define section of the config above:
|
You might have noticed that the build file you've just created is considerably smaller than the full build, but it can be reduced further. This is because all three renderers and all layer types are included by default. We only need one renderer, and only need the tile layer, so can exclude the others by setting these properties with `define`s. So add the following to the define section of the config above:
|
||||||
```
|
```
|
||||||
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false",
|
"ol.ENABLE_WEBGL=false",
|
||||||
"ol.ENABLE_PROJ4JS=false",
|
"ol.ENABLE_PROJ4JS=false",
|
||||||
"ol.ENABLE_IMAGE=false",
|
"ol.ENABLE_IMAGE=false",
|
||||||
@@ -190,7 +191,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
|||||||
"ol.format.KML",
|
"ol.format.KML",
|
||||||
"ol.layer.Heatmap#getSource",
|
"ol.layer.Heatmap#getSource",
|
||||||
"ol.source.Vector#on",
|
"ol.source.Vector#on",
|
||||||
"ol.source.Vector.Event#feature",
|
"ol.source.VectorEvent#feature",
|
||||||
"ol.Feature#get",
|
"ol.Feature#get",
|
||||||
"ol.Feature#set",
|
"ol.Feature#set",
|
||||||
"ol.layer.Tile",
|
"ol.layer.Tile",
|
||||||
@@ -206,10 +207,11 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
|||||||
"externs/oli.js"
|
"externs/oli.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
|
"ol.ENABLE_DOM=false",
|
||||||
"ol.ENABLE_WEBGL=false",
|
"ol.ENABLE_WEBGL=false",
|
||||||
"ol.ENABLE_PROJ4JS=false",
|
"ol.ENABLE_PROJ4JS=false",
|
||||||
"ol.ENABLE_IMAGE=false",
|
"ol.ENABLE_IMAGE=false",
|
||||||
"ol.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
"manage_closure_dependencies": true
|
"manage_closure_dependencies": true
|
||||||
@@ -217,7 +219,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.Vector.Event` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
|
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.VectorEvent` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
|
||||||
|
|
||||||
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
|
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ Although Closure library functions are widely used within OL3, none of them are
|
|||||||
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
|
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
|
||||||
|
|
||||||
## Renderers and Browser Support
|
## Renderers and Browser Support
|
||||||
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support both raster data from tile/image servers, and vector data; WebGL however only supports Point vectors and does not support labels. Clearly only those browsers that [support Canvas](http://caniuse.com/canvas) can use the Canvas renderer. Equally, the WebGL renderer can only be used on those devices and [browsers](http://caniuse.com/webgl) that support WebGL.
|
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support both raster data from tile/image servers, and vector data; WebGL however only supports Point vectors and does not support labels. Clearly only those browsers that [support Canvas](http://caniuse.com/canvas) can use the Canvas renderer. Equally, the WebGL renderer can only be used on those devices and [browsers](http://caniuse.com/webgl) that support WebGL. Internet Explorer versions before 9 are not supported at all.
|
||||||
|
|
||||||
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io) for `requestAnimationFrame` and `Element.prototype.classList` are required, and using the KML format requires a polyfill for `URL`.
|
|
||||||
|
|
||||||
The library is intended for use on both desktop/laptop and mobile devices.
|
The library is intended for use on both desktop/laptop and mobile devices.
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
// Improve user experience by loading tiles while animating. Will make
|
// Improve user experience by loading tiles while animating. Will make
|
||||||
// animations stutter on mobile or slow devices.
|
// animations stutter on mobile or slow devices.
|
||||||
loadTilesWhileAnimating: true,
|
loadTilesWhileAnimating: true,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Image');
|
goog.require('ol.layer.Image');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.ImageArcGISRest');
|
goog.require('ol.source.ImageArcGISRest');
|
||||||
|
|
||||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||||
@@ -10,11 +10,10 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
|||||||
|
|
||||||
var layers = [
|
var layers = [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
}),
|
}),
|
||||||
new ol.layer.Image({
|
new ol.layer.Image({
|
||||||
source: new ol.source.ImageArcGISRest({
|
source: new ol.source.ImageArcGISRest({
|
||||||
ratio: 1,
|
|
||||||
params: {},
|
params: {},
|
||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.TileArcGISRest');
|
goog.require('ol.source.TileArcGISRest');
|
||||||
|
|
||||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||||
@@ -9,7 +9,7 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
|||||||
|
|
||||||
var layers = [
|
var layers = [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
}),
|
}),
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
controls: ol.control.defaults({attribution: false}).extend([attribution]),
|
controls: ol.control.defaults({attribution: false}).extend([attribution]),
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
|
|||||||
}
|
}
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: layers,
|
layers: layers,
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
// Improve user experience by loading tiles while dragging/zooming. Will make
|
// Improve user experience by loading tiles while dragging/zooming. Will make
|
||||||
// zooming choppy on mobile or slow devices.
|
// zooming choppy on mobile or slow devices.
|
||||||
loadTilesWhileInteracting: true,
|
loadTilesWhileInteracting: true,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ var map = new ol.Map({
|
|||||||
source: vectorSource
|
source: vectorSource
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: 'canvas',
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-8730000, 5930000],
|
center: [-8730000, 5930000],
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
layout: example.html
|
|
||||||
title: Styling feature with CanvasGradient or CanvasPattern
|
|
||||||
shortdesc: Example showing the countries vector layer styled with patterns and gradients.
|
|
||||||
docs: >
|
|
||||||
First this example creates a reusable [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
|
|
||||||
and a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient). The countries are loaded from
|
|
||||||
a GeoJSON file. A style function determines for each country whether to use a fill with the pregenerated
|
|
||||||
CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles).
|
|
||||||
tags: "canvas, gradient, pattern, style"
|
|
||||||
---
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
goog.require('ol.Map');
|
|
||||||
goog.require('ol.View');
|
|
||||||
goog.require('ol.format.GeoJSON');
|
|
||||||
goog.require('ol.layer.Vector');
|
|
||||||
goog.require('ol.proj');
|
|
||||||
goog.require('ol.source.Vector');
|
|
||||||
goog.require('ol.style.Fill');
|
|
||||||
goog.require('ol.style.Stroke');
|
|
||||||
goog.require('ol.style.Style');
|
|
||||||
|
|
||||||
// Will contain ol.Style instances key by country.
|
|
||||||
var styleLookup = {};
|
|
||||||
|
|
||||||
// Generate a rainbow gradient
|
|
||||||
var gradient = (function() {
|
|
||||||
var canvas = document.createElement('canvas');
|
|
||||||
var context = canvas.getContext('2d');
|
|
||||||
var grad = context.createLinearGradient(0,0,1000,0);
|
|
||||||
grad.addColorStop(0, 'red');
|
|
||||||
grad.addColorStop(1 / 6, 'orange');
|
|
||||||
grad.addColorStop(2 / 6, 'yellow');
|
|
||||||
grad.addColorStop(3 / 6, 'green');
|
|
||||||
grad.addColorStop(4 / 6, 'aqua');
|
|
||||||
grad.addColorStop(5 / 6, 'blue');
|
|
||||||
grad.addColorStop(1, 'purple');
|
|
||||||
return grad;
|
|
||||||
}());
|
|
||||||
|
|
||||||
// Generate a canvasPattern with two circles
|
|
||||||
var pattern = (function() {
|
|
||||||
var canvas = document.createElement('canvas');
|
|
||||||
var context = canvas.getContext('2d');
|
|
||||||
canvas.width = 11;
|
|
||||||
canvas.height = 11;
|
|
||||||
context.fillStyle = 'rgba(102, 0, 102, 0.5)';
|
|
||||||
context.beginPath();
|
|
||||||
context.arc(5, 5, 4, 0, 2 * Math.PI);
|
|
||||||
context.fill();
|
|
||||||
context.fillStyle = 'rgb(55, 0, 170)';
|
|
||||||
context.beginPath();
|
|
||||||
context.arc(5, 5, 2, 0, 2 * Math.PI);
|
|
||||||
context.fill();
|
|
||||||
return context.createPattern(canvas, 'repeat');
|
|
||||||
}());
|
|
||||||
|
|
||||||
// Generate a background style that all features will reuse
|
|
||||||
var backgroundStyle = new ol.style.Style({
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: '#333',
|
|
||||||
width: 2
|
|
||||||
}),
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: '#fff'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The styling function for the vector layer, will return an array of styles
|
|
||||||
* which either contains the aboove gradient or pattern.
|
|
||||||
*
|
|
||||||
* @param {ol.Feature} feature the feature to style.
|
|
||||||
* @return {Array<ol.style.Style>} the styles to use for the feature.
|
|
||||||
*/
|
|
||||||
var getStackedStyle = function(feature) {
|
|
||||||
var id = feature.getId();
|
|
||||||
if (!styleLookup[id]) {
|
|
||||||
var patternOrGradient;
|
|
||||||
if (id > 'J') { // some shall get the gradient, others the pattern.
|
|
||||||
patternOrGradient = gradient;
|
|
||||||
} else {
|
|
||||||
patternOrGradient = pattern;
|
|
||||||
}
|
|
||||||
// Store the style in the lookup, next call will just return the stored
|
|
||||||
// style for the feature.
|
|
||||||
styleLookup[id] = [
|
|
||||||
// 1. Use the common background style
|
|
||||||
// (white fill and blackish stroke)
|
|
||||||
backgroundStyle,
|
|
||||||
// 2. On top of that, draw the pattern or gradient
|
|
||||||
new ol.style.Style({
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: patternOrGradient
|
|
||||||
})
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
return styleLookup[id];
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create a vector layer that makes use of the style function above…
|
|
||||||
var vectorLayer = new ol.layer.Vector({
|
|
||||||
source: new ol.source.Vector({
|
|
||||||
url: 'data/geojson/countries.geojson',
|
|
||||||
format: new ol.format.GeoJSON()
|
|
||||||
}),
|
|
||||||
style: getStackedStyle
|
|
||||||
});
|
|
||||||
|
|
||||||
// … finally create a map with that layer.
|
|
||||||
var map = new ol.Map({
|
|
||||||
layers: [
|
|
||||||
vectorLayer
|
|
||||||
],
|
|
||||||
target: 'map',
|
|
||||||
view: new ol.View({
|
|
||||||
center: ol.proj.fromLonLat([7, 52]),
|
|
||||||
zoom: 3
|
|
||||||
})
|
|
||||||
});
|
|
||||||
@@ -20,6 +20,7 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
goog.require('ol.format.GeoJSON');
|
goog.require('ol.format.GeoJSON');
|
||||||
|
goog.require('ol.geom.Point');
|
||||||
|
goog.require('ol.geom.SimpleGeometry');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|||||||
@@ -7,7 +7,3 @@ docs: >
|
|||||||
tags: "cluster, vector"
|
tags: "cluster, vector"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<form>
|
|
||||||
<label>cluster distance</label>
|
|
||||||
<input id="distance" type="range" min="0" max="100" step="1" value="40"/>
|
|
||||||
</form>
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ goog.require('ol.geom.Point');
|
|||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.Cluster');
|
goog.require('ol.source.Cluster');
|
||||||
goog.require('ol.source.OSM');
|
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');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
@@ -14,8 +14,6 @@ goog.require('ol.style.Style');
|
|||||||
goog.require('ol.style.Text');
|
goog.require('ol.style.Text');
|
||||||
|
|
||||||
|
|
||||||
var distance = document.getElementById('distance');
|
|
||||||
|
|
||||||
var count = 20000;
|
var count = 20000;
|
||||||
var features = new Array(count);
|
var features = new Array(count);
|
||||||
var e = 4500000;
|
var e = 4500000;
|
||||||
@@ -29,7 +27,7 @@ var source = new ol.source.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var clusterSource = new ol.source.Cluster({
|
var clusterSource = new ol.source.Cluster({
|
||||||
distance: parseInt(distance.value, 10),
|
distance: 40,
|
||||||
source: source
|
source: source
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,18 +62,15 @@ var clusters = new ol.layer.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [raster, clusters],
|
layers: [raster, clusters],
|
||||||
|
renderer: 'canvas',
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 2
|
zoom: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
distance.addEventListener('input', function() {
|
|
||||||
clusterSource.setDistance(parseInt(distance.value, 10));
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ var twoPi = 2 * Math.PI;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an RGB pixel into an HCL pixel.
|
* Convert an RGB pixel into an HCL pixel.
|
||||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
* @param {ol.raster.Pixel} pixel A pixel in RGB space.
|
||||||
* @return {Array.<number>} A pixel in HCL space.
|
* @return {ol.raster.Pixel} A pixel in HCL space.
|
||||||
*/
|
*/
|
||||||
function rgb2hcl(pixel) {
|
function rgb2hcl(pixel) {
|
||||||
var red = rgb2xyz(pixel[0]);
|
var red = rgb2xyz(pixel[0]);
|
||||||
@@ -57,8 +57,8 @@ function rgb2hcl(pixel) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an HCL pixel into an RGB pixel.
|
* Convert an HCL pixel into an RGB pixel.
|
||||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
* @param {ol.raster.Pixel} pixel A pixel in HCL space.
|
||||||
* @return {Array.<number>} A pixel in RGB space.
|
* @return {ol.raster.Pixel} A pixel in RGB space.
|
||||||
*/
|
*/
|
||||||
function hcl2rgb(pixel) {
|
function hcl2rgb(pixel) {
|
||||||
var h = pixel[0];
|
var h = pixel[0];
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ logoElement.href = 'http://www.osgeo.org/';
|
|||||||
logoElement.target = '_blank';
|
logoElement.target = '_blank';
|
||||||
|
|
||||||
var logoImage = document.createElement('img');
|
var logoImage = document.createElement('img');
|
||||||
logoImage.src = 'https://www.osgeo.org/sites/all/themes/osgeo/logo.png';
|
logoImage.src = 'http://www.osgeo.org/sites/all/themes/osgeo/logo.png';
|
||||||
|
|
||||||
logoElement.appendChild(logoImage);
|
logoElement.appendChild(logoImage);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
goog.require('ol');
|
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
@@ -150,7 +149,7 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
|
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
new ol.layer.Vector({
|
new ol.layer.Vector({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ docs: >
|
|||||||
<p>The example loads TopoJSON geometries and uses d3 (<code>d3.geo.path</code>) to render these geometries to a canvas element that is then used as the image of an ol3 image layer.</p>
|
<p>The example loads TopoJSON geometries and uses d3 (<code>d3.geo.path</code>) to render these geometries to a canvas element that is then used as the image of an ol3 image layer.</p>
|
||||||
tags: "d3"
|
tags: "d3"
|
||||||
resources:
|
resources:
|
||||||
- https://d3js.org/d3.v3.min.js
|
- http://d3js.org/d3.v3.min.js
|
||||||
- https://d3js.org/topojson.v1.min.js
|
- http://d3js.org/topojson.v1.min.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.interaction');
|
goog.require('ol.interaction');
|
||||||
goog.require('ol.interaction.DragRotateAndZoom');
|
goog.require('ol.interaction.DragRotateAndZoom');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
@@ -12,9 +12,10 @@ var map = new ol.Map({
|
|||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ goog.require('ol.interaction.Draw');
|
|||||||
goog.require('ol.interaction.Modify');
|
goog.require('ol.interaction.Modify');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.OSM');
|
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');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
@@ -14,7 +14,7 @@ goog.require('ol.style.Stroke');
|
|||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ goog.require('ol.geom.Polygon');
|
|||||||
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.source.OSM');
|
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');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
@@ -12,7 +12,7 @@ goog.require('ol.style.Stroke');
|
|||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
});
|
});
|
||||||
|
|
||||||
var source = new ol.source.Vector({wrapX: false});
|
var source = new ol.source.Vector({wrapX: false});
|
||||||
@@ -38,6 +38,7 @@ var vector = new ol.layer.Vector({
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-11000000, 4600000],
|
center: [-11000000, 4600000],
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.geom.MultiPoint');
|
goog.require('ol.geom.MultiPoint');
|
||||||
goog.require('ol.geom.Point');
|
goog.require('ol.geom.Point');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.style.Circle');
|
goog.require('ol.style.Circle');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
goog.require('ol.style.Stroke');
|
goog.require('ol.style.Stroke');
|
||||||
@@ -13,9 +14,10 @@ goog.require('ol.style.Style');
|
|||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -13,12 +13,6 @@ goog.require('ol.style.Stroke');
|
|||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
|
|
||||||
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
|
|
||||||
var scale;
|
|
||||||
var scaleFunction = function(coordinate) {
|
|
||||||
return [coordinate[0] * scale, coordinate[1] * scale];
|
|
||||||
};
|
|
||||||
|
|
||||||
var styleCache = {};
|
var styleCache = {};
|
||||||
var styleFunction = function(feature) {
|
var styleFunction = function(feature) {
|
||||||
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
|
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
|
||||||
@@ -27,23 +21,23 @@ var styleFunction = function(feature) {
|
|||||||
var name = feature.get('name');
|
var name = feature.get('name');
|
||||||
var magnitude = parseFloat(name.substr(2));
|
var magnitude = parseFloat(name.substr(2));
|
||||||
var size = parseInt(10 + 40 * (magnitude - 5), 10);
|
var size = parseInt(10 + 40 * (magnitude - 5), 10);
|
||||||
scale = size / 10;
|
|
||||||
var style = styleCache[size];
|
var style = styleCache[size];
|
||||||
if (!style) {
|
if (!style) {
|
||||||
var canvas =
|
var canvas =
|
||||||
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
||||||
var vectorContext = ol.render.toContext(
|
var vectorContext = ol.render.toContext(
|
||||||
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
||||||
{size: [size, size], pixelRatio: 1});
|
{size: [size + 2, size + 2], pixelRatio: size / 10});
|
||||||
vectorContext.setStyle(new ol.style.Style({
|
vectorContext.setStyle(new ol.style.Style({
|
||||||
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
|
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||||
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1})
|
||||||
}));
|
}));
|
||||||
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)]));
|
vectorContext.drawGeometry(new ol.geom.Polygon(
|
||||||
|
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
|
||||||
style = new ol.style.Style({
|
style = new ol.style.Style({
|
||||||
image: new ol.style.Icon({
|
image: new ol.style.Icon({
|
||||||
img: canvas,
|
img: canvas,
|
||||||
imgSize: [size, size],
|
imgSize: [canvas.width, canvas.height],
|
||||||
rotation: 1.2
|
rotation: 1.2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ docs: >
|
|||||||
Example of exporting a map as a PDF using the <a href="https://github.com/MrRio/jsPDF" target="_blank">jsPDF</a> library.
|
Example of exporting a map as a PDF using the <a href="https://github.com/MrRio/jsPDF" target="_blank">jsPDF</a> library.
|
||||||
tags: "export, pdf, openstreetmap"
|
tags: "export, pdf, openstreetmap"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.min.js
|
- http://mrrio.github.io/jsPDF/dist/jspdf.min.js
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
layout: example.html
|
|
||||||
title: Extent Interaction
|
|
||||||
shortdesc: Using an Extent interaction to draw an extent.
|
|
||||||
docs: >
|
|
||||||
<p>This example shows how to use an <code>Extent</code> interaction to draw a modifiable extent.</p>
|
|
||||||
<p>Use <code>Shift+Drag</code> to draw an extent.
|
|
||||||
<code>Shift+Drag</code> on the corners or edges of the extent to resize it. <code>Shift+Click</code> off the extent to remove it.
|
|
||||||
</p>
|
|
||||||
tags: "Extent, interaction, box"
|
|
||||||
---
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
goog.require('ol.Map');
|
|
||||||
goog.require('ol.View');
|
|
||||||
goog.require('ol.events.condition');
|
|
||||||
goog.require('ol.format.GeoJSON');
|
|
||||||
goog.require('ol.interaction.Extent');
|
|
||||||
goog.require('ol.layer.Tile');
|
|
||||||
goog.require('ol.layer.Vector');
|
|
||||||
goog.require('ol.source.OSM');
|
|
||||||
goog.require('ol.source.Vector');
|
|
||||||
|
|
||||||
var vectorSource = new ol.source.Vector({
|
|
||||||
url: 'data/geojson/countries.geojson',
|
|
||||||
format: new ol.format.GeoJSON()
|
|
||||||
});
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
|
||||||
layers: [
|
|
||||||
new ol.layer.Tile({
|
|
||||||
source: new ol.source.OSM()
|
|
||||||
}),
|
|
||||||
new ol.layer.Vector({
|
|
||||||
source: vectorSource
|
|
||||||
})
|
|
||||||
],
|
|
||||||
target: 'map',
|
|
||||||
view: new ol.View({
|
|
||||||
center: [0, 0],
|
|
||||||
zoom: 2
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
var extent = new ol.interaction.Extent({
|
|
||||||
condition: ol.events.condition.platformModifierKeyOnly
|
|
||||||
});
|
|
||||||
map.addInteraction(extent);
|
|
||||||
extent.setActive(false);
|
|
||||||
|
|
||||||
//Enable interaction by holding shift
|
|
||||||
this.addEventListener('keydown', function(event) {
|
|
||||||
if (event.keyCode == 16) {
|
|
||||||
extent.setActive(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.addEventListener('keyup', function(event) {
|
|
||||||
if (event.keyCode == 16) {
|
|
||||||
extent.setActive(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -28,6 +28,7 @@ var map = new ol.Map({
|
|||||||
collapsible: false
|
collapsible: false
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// NOCOMPILE
|
// NOCOMPILE
|
||||||
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ var view = new ol.View({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
layers: [wmsLayer],
|
layers: [wmsLayer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ var view = new ol.View({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
layers: [wmsLayer],
|
layers: [wmsLayer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: 'canvas',
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.fromLonLat([4.8, 47.75]),
|
center: ol.proj.fromLonLat([4.8, 47.75]),
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
layout: example.html
|
|
||||||
title: HERE Map Tile API
|
|
||||||
shortdesc: Example of a map with map tiles from HERE.
|
|
||||||
docs: >
|
|
||||||
<p><a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile">HERE Map Tile API</a> used with <code>ol.source.XYZ</code>.</p>
|
|
||||||
<p>Be sure to respect the <a href="https://legal.here.com/en/terms/serviceterms/us/">HERE Service Terms</a> when using their tile API.</p>
|
|
||||||
tags: "here, here-maps, here-tile-api"
|
|
||||||
cloak:
|
|
||||||
a2qhegvZZFIuJDkkqjhQ: Your HERE Maps appId from https://developer.here.com/
|
|
||||||
lPJ3iaFLJDhD8fIAyU582A: Your HERE Maps appCode from https://developer.here.com/
|
|
||||||
---
|
|
||||||
<div id="map" class="map"></div>
|
|
||||||
<select id="layer-select">
|
|
||||||
<option value="normal.day" selected>Normal Day</option>
|
|
||||||
<option value="normal.day.transit">Normal Day Transit</option>
|
|
||||||
<option value="pedestrian.day">Pedestrian Day</option>
|
|
||||||
<option value="terrain.day">Terrain Day</option>
|
|
||||||
<option value="satellite.day">Satellite Day</option>
|
|
||||||
<option value="hybrid.day">Hybrid Day</option>
|
|
||||||
</select>
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
goog.require('ol.Map');
|
|
||||||
goog.require('ol.View');
|
|
||||||
goog.require('ol.layer.Tile');
|
|
||||||
goog.require('ol.source.XYZ');
|
|
||||||
|
|
||||||
var appId = 'a2qhegvZZFIuJDkkqjhQ';
|
|
||||||
var appCode = 'lPJ3iaFLJDhD8fIAyU582A';
|
|
||||||
var hereLayers = [
|
|
||||||
{
|
|
||||||
base: 'base',
|
|
||||||
type: 'maptile',
|
|
||||||
scheme: 'normal.day',
|
|
||||||
app_id: appId,
|
|
||||||
app_code: appCode
|
|
||||||
},
|
|
||||||
{
|
|
||||||
base: 'base',
|
|
||||||
type: 'maptile',
|
|
||||||
scheme: 'normal.day.transit',
|
|
||||||
app_id: appId,
|
|
||||||
app_code: appCode
|
|
||||||
},
|
|
||||||
{
|
|
||||||
base: 'base',
|
|
||||||
type: 'maptile',
|
|
||||||
scheme: 'pedestrian.day',
|
|
||||||
app_id: appId,
|
|
||||||
app_code: appCode
|
|
||||||
},
|
|
||||||
{
|
|
||||||
base: 'aerial',
|
|
||||||
type: 'maptile',
|
|
||||||
scheme: 'terrain.day',
|
|
||||||
app_id: appId,
|
|
||||||
app_code: appCode
|
|
||||||
},
|
|
||||||
{
|
|
||||||
base: 'aerial',
|
|
||||||
type: 'maptile',
|
|
||||||
scheme: 'satellite.day',
|
|
||||||
app_id: appId,
|
|
||||||
app_code: appCode
|
|
||||||
},
|
|
||||||
{
|
|
||||||
base: 'aerial',
|
|
||||||
type: 'maptile',
|
|
||||||
scheme: 'hybrid.day',
|
|
||||||
app_id: appId,
|
|
||||||
app_code: appCode
|
|
||||||
}
|
|
||||||
];
|
|
||||||
var urlTpl = 'https://{1-4}.{base}.maps.cit.api.here.com' +
|
|
||||||
'/{type}/2.1/maptile/newest/{scheme}/{z}/{x}/{y}/256/png' +
|
|
||||||
'?app_id={app_id}&app_code={app_code}';
|
|
||||||
var layers = [];
|
|
||||||
var i, ii;
|
|
||||||
for (i = 0, ii = hereLayers.length; i < ii; ++i) {
|
|
||||||
var layerDesc = hereLayers[i];
|
|
||||||
layers.push(new ol.layer.Tile({
|
|
||||||
visible: false,
|
|
||||||
preload: Infinity,
|
|
||||||
source: new ol.source.XYZ({
|
|
||||||
url: createUrl(urlTpl, layerDesc),
|
|
||||||
attributions: 'Map Tiles © 2016 ' +
|
|
||||||
'<a href="http://developer.here.com">HERE</a>'
|
|
||||||
})
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
|
||||||
layers: layers,
|
|
||||||
// Improve user experience by loading tiles while dragging/zooming. Will make
|
|
||||||
// zooming choppy on mobile or slow devices.
|
|
||||||
loadTilesWhileInteracting: true,
|
|
||||||
target: 'map',
|
|
||||||
view: new ol.View({
|
|
||||||
center: [921371.9389, 6358337.7609],
|
|
||||||
zoom: 10
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
function createUrl(tpl, layerDesc) {
|
|
||||||
return tpl
|
|
||||||
.replace('{base}', layerDesc.base)
|
|
||||||
.replace('{type}', layerDesc.type)
|
|
||||||
.replace('{scheme}', layerDesc.scheme)
|
|
||||||
.replace('{app_id}', layerDesc.app_id)
|
|
||||||
.replace('{app_code}', layerDesc.app_code);
|
|
||||||
}
|
|
||||||
|
|
||||||
var select = document.getElementById('layer-select');
|
|
||||||
function onChange() {
|
|
||||||
var scheme = select.value;
|
|
||||||
for (var i = 0, ii = layers.length; i < ii; ++i) {
|
|
||||||
layers[i].setVisible(hereLayers[i].scheme === scheme);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
select.addEventListener('change', onChange);
|
|
||||||
onChange();
|
|
||||||
@@ -55,12 +55,13 @@ var vectorLayer = new ol.layer.Vector({
|
|||||||
|
|
||||||
var rasterLayer = new ol.layer.Tile({
|
var rasterLayer = new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json',
|
||||||
crossOrigin: ''
|
crossOrigin: ''
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
layers: [rasterLayer, vectorLayer],
|
layers: [rasterLayer, vectorLayer],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ var vector = new ol.layer.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
renderer: common.getRendererFromQueryString('webgl'),
|
||||||
layers: [vector],
|
layers: [vector],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -39,12 +39,13 @@ var vectorLayer = new ol.layer.Vector({
|
|||||||
|
|
||||||
var rasterLayer = new ol.layer.Tile({
|
var rasterLayer = new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json',
|
||||||
crossOrigin: ''
|
crossOrigin: ''
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
layers: [rasterLayer, vectorLayer],
|
layers: [rasterLayer, vectorLayer],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
@@ -58,8 +59,7 @@ var element = document.getElementById('popup');
|
|||||||
var popup = new ol.Overlay({
|
var popup = new ol.Overlay({
|
||||||
element: element,
|
element: element,
|
||||||
positioning: 'bottom-center',
|
positioning: 'bottom-center',
|
||||||
stopEvent: false,
|
stopEvent: false
|
||||||
offset: [0, -50]
|
|
||||||
});
|
});
|
||||||
map.addOverlay(popup);
|
map.addOverlay(popup);
|
||||||
|
|
||||||
@@ -70,8 +70,7 @@ map.on('click', function(evt) {
|
|||||||
return feature;
|
return feature;
|
||||||
});
|
});
|
||||||
if (feature) {
|
if (feature) {
|
||||||
var coordinates = feature.getGeometry().getCoordinates();
|
popup.setPosition(evt.coordinate);
|
||||||
popup.setPosition(coordinates);
|
|
||||||
$(element).popover({
|
$(element).popover({
|
||||||
'placement': 'top',
|
'placement': 'top',
|
||||||
'html': true,
|
'html': true,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
@@ -154,7 +155,7 @@ map.on('click', function(evt) {
|
|||||||
var stroke = new ol.style.Stroke({
|
var stroke = new ol.style.Stroke({
|
||||||
color: 'rgba(255,0,0,0.9)',
|
color: 'rgba(255,0,0,0.9)',
|
||||||
width: 1
|
width: 1
|
||||||
});
|
})
|
||||||
var style = new ol.style.Style({
|
var style = new ol.style.Style({
|
||||||
stroke: stroke,
|
stroke: stroke,
|
||||||
image: new ol.style.Circle({
|
image: new ol.style.Circle({
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Image({source: source})
|
new ol.layer.Image({source: source})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-10997148, 4569099],
|
center: [-10997148, 4569099],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
|
|||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.ImageVector');
|
goog.require('ol.source.ImageVector');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
goog.require('ol.style.Stroke');
|
goog.require('ol.style.Stroke');
|
||||||
@@ -15,7 +15,7 @@ goog.require('ol.style.Style');
|
|||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
}),
|
}),
|
||||||
new ol.layer.Image({
|
new ol.layer.Image({
|
||||||
source: new ol.source.ImageVector({
|
source: new ol.source.ImageVector({
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ docs: >
|
|||||||
with OpenLayers 3.
|
with OpenLayers 3.
|
||||||
tags: "vector, jsts, buffer"
|
tags: "vector, jsts, buffer"
|
||||||
resources:
|
resources:
|
||||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.2.0/jsts.min.js
|
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.0.2/jsts.min.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
// NOCOMPILE
|
// NOCOMPILE
|
||||||
// this example uses JSTS for which we don't have an externs file.
|
// this example uses JSTS for which we don't have an externs file.
|
||||||
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.format.GeoJSON');
|
goog.require('ol.format.GeoJSON');
|
||||||
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.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +39,9 @@ var vectorLayer = new ol.layer.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var rasterLayer = new ol.layer.Tile({
|
var rasterLayer = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({
|
||||||
|
layer: 'osm'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (!ol.has.WEBGL) {
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [osm],
|
layers: [osm],
|
||||||
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
renderer: 'webgl',
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ title: Limited Layer Extent
|
|||||||
shortdesc: Restricting layer rendering to a limited extent.
|
shortdesc: Restricting layer rendering to a limited extent.
|
||||||
docs: >
|
docs: >
|
||||||
This example uses the <code>layer.setExtent()</code> method to
|
This example uses the <code>layer.setExtent()</code> method to
|
||||||
modify the extent of the overlay layer. Use the controls above
|
modify the extent of the overlay layer. Use the controls below
|
||||||
to limit rendering based on an extent (approximate country bounds).
|
to limit rendering based on an extent.
|
||||||
tags: "extent, tilejson"
|
tags: "extent, tilejson"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<button type="button" class="btn btn-default" id="India">India</button>
|
<button type="button" class="btn btn-default" id="northwest">northwest</button>
|
||||||
<button type="button" class="btn btn-default" id="Argentina">Argentina</button>
|
<button type="button" class="btn btn-default" id="northeast">northeast</button>
|
||||||
<button type="button" class="btn btn-default" id="Nigeria">Nigeria</button>
|
<button type="button" class="btn btn-default" id="southeast">southeast</button>
|
||||||
<button type="button" class="btn btn-default" id="Sweden">Sweden</button>
|
<button type="button" class="btn btn-default" id="southwest">southwest</button>
|
||||||
|
<button type="button" class="btn btn-default" id="world">world</button>
|
||||||
|
|||||||
@@ -9,29 +9,33 @@ function transform(extent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var extents = {
|
var extents = {
|
||||||
India: transform([68.17665, 7.96553, 97.40256, 35.49401]),
|
northwest: transform([-180, 0, 0, 85]),
|
||||||
Argentina: transform([-73.41544, -55.25, -53.62835, -21.83231]),
|
northeast: transform([0, 0, 180, 85]),
|
||||||
Nigeria: transform([2.6917, 4.24059, 14.57718, 13.86592]),
|
southeast: transform([0, -85, 180, 0]),
|
||||||
Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625])
|
southwest: transform([-180, -85, 0, 0]),
|
||||||
|
world: transform([-180, -85, 180, 85])
|
||||||
};
|
};
|
||||||
|
|
||||||
var base = new ol.layer.Tile({
|
var base = new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||||
|
'mapbox.world-black.json',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var overlay = new ol.layer.Tile({
|
var overlay = new ol.layer.Tile({
|
||||||
extent: extents.India,
|
extent: extents.northwest,
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||||
|
'mapbox.world-glass.json',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [base, overlay],
|
layers: [base, overlay],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ resources:
|
|||||||
<div id="layertree">
|
<div id="layertree">
|
||||||
<h5>Click on layer nodes below to change their properties.</h5>
|
<h5>Click on layer nodes below to change their properties.</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li><span>OSM layer</span>
|
<li><span>OpenAerial layer</span>
|
||||||
<fieldset id="layer0">
|
<fieldset id="layer0">
|
||||||
<label class="checkbox" for="visible0">
|
<label class="checkbox" for="visible0">
|
||||||
<input id="visible0" class="visible" type="checkbox"/>visibility
|
<input id="visible0" class="visible" type="checkbox"/>visibility
|
||||||
|
|||||||
@@ -3,30 +3,33 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.layer.Group');
|
goog.require('ol.layer.Group');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.TileJSON');
|
goog.require('ol.source.TileJSON');
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
}), new ol.layer.Group({
|
}), new ol.layer.Group({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||||
|
'mapbox.20110804-hoa-foodinsecurity-3month.json',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||||
|
'mapbox.world-borders-light.json',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.fromLonLat([37.40570, 8.81566]),
|
center: ol.proj.fromLonLat([37.40570, 8.81566]),
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
|
|
||||||
var source = new ol.source.OSM();
|
var source = new ol.source.MapQuest({layer: 'sat'});
|
||||||
|
|
||||||
var layer = new ol.layer.Tile();
|
var layer = new ol.layer.Tile();
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ goog.require('ol.geom.Point');
|
|||||||
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.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
goog.require('ol.style.Icon');
|
goog.require('ol.style.Icon');
|
||||||
goog.require('ol.style.Stroke');
|
goog.require('ol.style.Stroke');
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
});
|
});
|
||||||
|
|
||||||
var source = new ol.source.Vector();
|
var source = new ol.source.Vector();
|
||||||
@@ -53,6 +53,7 @@ var vector = new ol.layer.Vector({
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-11000000, 4600000],
|
center: [-11000000, 4600000],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable openlayers-internal/no-unused-requires */
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.format.MVT');
|
goog.require('ol.format.MVT');
|
||||||
@@ -31,7 +31,7 @@ for (var z = zoomOffset / reuseZoomLevels; z <= 22 / reuseZoomLevels; ++z) {
|
|||||||
resolutions.push(156543.03392804097 / Math.pow(2, z * reuseZoomLevels));
|
resolutions.push(156543.03392804097 / Math.pow(2, z * reuseZoomLevels));
|
||||||
}
|
}
|
||||||
function tileUrlFunction(tileCoord) {
|
function tileUrlFunction(tileCoord) {
|
||||||
return ('https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
return ('http://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
||||||
'{z}/{x}/{y}.vector.pbf?access_token=' + key)
|
'{z}/{x}/{y}.vector.pbf?access_token=' + key)
|
||||||
.replace('{z}', String(tileCoord[0] * reuseZoomLevels + zoomOffset))
|
.replace('{z}', String(tileCoord[0] * reuseZoomLevels + zoomOffset))
|
||||||
.replace('{x}', String(tileCoord[1]))
|
.replace('{x}', String(tileCoord[1]))
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable openlayers-internal/no-unused-requires */
|
goog.require('ol.Attribution');
|
||||||
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.format.MVT');
|
goog.require('ol.format.MVT');
|
||||||
@@ -10,7 +9,6 @@ goog.require('ol.style.Icon');
|
|||||||
goog.require('ol.style.Stroke');
|
goog.require('ol.style.Stroke');
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
goog.require('ol.style.Text');
|
goog.require('ol.style.Text');
|
||||||
goog.require('ol.tilegrid');
|
|
||||||
|
|
||||||
|
|
||||||
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||||
@@ -25,7 +23,7 @@ var map = new ol.Map({
|
|||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
||||||
tilePixelRatio: 16,
|
tilePixelRatio: 16,
|
||||||
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
url: 'http://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
||||||
'{z}/{x}/{y}.vector.pbf?access_token=' + key
|
'{z}/{x}/{y}.vector.pbf?access_token=' + key
|
||||||
}),
|
}),
|
||||||
style: createMapboxStreetsV6Style()
|
style: createMapboxStreetsV6Style()
|
||||||
|
|||||||
14
examples/mapquest.html
Normal file
14
examples/mapquest.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: MapQuest
|
||||||
|
shortdesc: Example of a MapQuest map.Shows how to create custom controls.
|
||||||
|
docs: >
|
||||||
|
Example of a MapQuest map.
|
||||||
|
tags: "mapquest"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<select id="layer-select">
|
||||||
|
<option value="Aerial">Aerial</option>
|
||||||
|
<option value="AerialWithLabels">Aerial with labels</option>
|
||||||
|
<option value="Road" selected>Road</option>
|
||||||
|
</select>
|
||||||
56
examples/mapquest.js
Normal file
56
examples/mapquest.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.layer.Group');
|
||||||
|
goog.require('ol.layer.Tile');
|
||||||
|
goog.require('ol.proj');
|
||||||
|
goog.require('ol.source.MapQuest');
|
||||||
|
|
||||||
|
|
||||||
|
var layers = [
|
||||||
|
new ol.layer.Tile({
|
||||||
|
style: 'Road',
|
||||||
|
source: new ol.source.MapQuest({layer: 'osm'})
|
||||||
|
}),
|
||||||
|
new ol.layer.Tile({
|
||||||
|
style: 'Aerial',
|
||||||
|
visible: false,
|
||||||
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
|
}),
|
||||||
|
new ol.layer.Group({
|
||||||
|
style: 'AerialWithLabels',
|
||||||
|
visible: false,
|
||||||
|
layers: [
|
||||||
|
new ol.layer.Tile({
|
||||||
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
|
}),
|
||||||
|
new ol.layer.Tile({
|
||||||
|
source: new ol.source.MapQuest({layer: 'hyb'})
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: layers,
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: ol.proj.transform(
|
||||||
|
[-73.979378, 40.702222], 'EPSG:4326', 'EPSG:3857'),
|
||||||
|
zoom: 9
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var select = document.getElementById('layer-select');
|
||||||
|
|
||||||
|
function onChange() {
|
||||||
|
var style = select.value;
|
||||||
|
var i, ii;
|
||||||
|
for (i = 0, ii = layers.length; i < ii; ++i) {
|
||||||
|
layers[i].set('visible', (layers[i].get('style') == style));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
select.addEventListener('change', onChange);
|
||||||
|
|
||||||
|
onChange();
|
||||||
@@ -9,7 +9,7 @@ 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.proj');
|
||||||
goog.require('ol.source.OSM');
|
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');
|
||||||
goog.require('ol.style.Fill');
|
goog.require('ol.style.Fill');
|
||||||
@@ -20,7 +20,7 @@ goog.require('ol.style.Style');
|
|||||||
var wgs84Sphere = new ol.Sphere(6378137);
|
var wgs84Sphere = new ol.Sphere(6378137);
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
});
|
});
|
||||||
|
|
||||||
var source = new ol.source.Vector();
|
var source = new ol.source.Vector();
|
||||||
|
|||||||
@@ -18,13 +18,15 @@ var map = new ol.Map({
|
|||||||
}),
|
}),
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileJSON({
|
source: new ol.source.TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
|
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||||
|
'mapbox.natural-earth-hypso-bathy.json',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
}),
|
}),
|
||||||
minResolution: 2000,
|
minResolution: 2000,
|
||||||
maxResolution: 20000
|
maxResolution: 20000
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ goog.require('ol.interaction.Modify');
|
|||||||
goog.require('ol.interaction.Select');
|
goog.require('ol.interaction.Select');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({
|
||||||
|
layer: 'sat'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ layout: example.html
|
|||||||
title: OSM Vector Tiles
|
title: OSM Vector Tiles
|
||||||
shortdesc: Using OpenStreetMap vector tiles.
|
shortdesc: Using OpenStreetMap vector tiles.
|
||||||
docs: >
|
docs: >
|
||||||
A simple vector tiles map with Mapzen vector tiles. **Note**: TopoJSON vector tiles are not optimized for rendering - they might clip geometries exactly at the tile boundary instead of adding a buffer, and use geographic coordinates instead of tile relative pixel coordinates in view projection.
|
A simple vector tiles map with OpenStreetMap vector tiles. **Note**: The tiles used in this example are not optimized for rendering - they clip tiles exactly at the tile boundary instead of adding a buffer, and use geographic coordinates instead of tile relative pixel coordinates in view projection.
|
||||||
tags: "vector, tiles, osm, mapzen"
|
tags: "vector, tiles, osm"
|
||||||
cloak:
|
|
||||||
vector-tiles-5eJz6JX: Your Mapzen API key from https://mapzen.com/developers
|
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
goog.require('ol.Attribution');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.format.TopoJSON');
|
goog.require('ol.format.TopoJSON');
|
||||||
@@ -8,14 +7,8 @@ goog.require('ol.source.VectorTile');
|
|||||||
goog.require('ol.style.Fill');
|
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');
|
||||||
goog.require('ol.tilegrid');
|
|
||||||
|
|
||||||
|
|
||||||
var key = 'vector-tiles-5eJz6JX';
|
|
||||||
|
|
||||||
var attribution = [new ol.Attribution({
|
|
||||||
html: '© OpenStreetMap contributors, Who’s On First, Natural Earth, and openstreetmapdata.com'
|
|
||||||
})];
|
|
||||||
var format = new ol.format.TopoJSON();
|
var format = new ol.format.TopoJSON();
|
||||||
var tileGrid = ol.tilegrid.createXYZ({maxZoom: 19});
|
var tileGrid = ol.tilegrid.createXYZ({maxZoom: 19});
|
||||||
var roadStyleCache = {};
|
var roadStyleCache = {};
|
||||||
@@ -24,6 +17,7 @@ var roadColor = {
|
|||||||
'minor_road': '#ccb',
|
'minor_road': '#ccb',
|
||||||
'highway': '#f39'
|
'highway': '#f39'
|
||||||
};
|
};
|
||||||
|
var landuseStyleCache = {};
|
||||||
var buildingStyle = new ol.style.Style({
|
var buildingStyle = new ol.style.Style({
|
||||||
fill: new ol.style.Fill({
|
fill: new ol.style.Fill({
|
||||||
color: '#666',
|
color: '#666',
|
||||||
@@ -39,10 +33,10 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.VectorTile({
|
new ol.layer.VectorTile({
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: attribution,
|
|
||||||
format: format,
|
format: format,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
url: 'https://vector.mapzen.com/osm/water/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'http://{a-c}.tile.openstreetmap.us/' +
|
||||||
|
'vectiles-water-areas/{z}/{x}/{y}.topojson'
|
||||||
}),
|
}),
|
||||||
style: new ol.style.Style({
|
style: new ol.style.Style({
|
||||||
fill: new ol.style.Fill({
|
fill: new ol.style.Fill({
|
||||||
@@ -52,10 +46,10 @@ var map = new ol.Map({
|
|||||||
}),
|
}),
|
||||||
new ol.layer.VectorTile({
|
new ol.layer.VectorTile({
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: attribution,
|
|
||||||
format: format,
|
format: format,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
url: 'https://vector.mapzen.com/osm/roads/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'http://{a-c}.tile.openstreetmap.us/' +
|
||||||
|
'vectiles-highroad/{z}/{x}/{y}.topojson'
|
||||||
}),
|
}),
|
||||||
style: function(feature) {
|
style: function(feature) {
|
||||||
var kind = feature.get('kind');
|
var kind = feature.get('kind');
|
||||||
@@ -86,14 +80,55 @@ var map = new ol.Map({
|
|||||||
}),
|
}),
|
||||||
new ol.layer.VectorTile({
|
new ol.layer.VectorTile({
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: attribution,
|
|
||||||
format: format,
|
format: format,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
url: 'https://vector.mapzen.com/osm/buildings/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'http://{a-c}.tile.openstreetmap.us/' +
|
||||||
|
'vectiles-buildings/{z}/{x}/{y}.topojson'
|
||||||
}),
|
}),
|
||||||
style: function(f, resolution) {
|
style: function(f, resolution) {
|
||||||
return (resolution < 10) ? buildingStyle : null;
|
return (resolution < 10) ? buildingStyle : null;
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
new ol.layer.VectorTile({
|
||||||
|
source: new ol.source.VectorTile({
|
||||||
|
format: format,
|
||||||
|
tileGrid: tileGrid,
|
||||||
|
url: 'http://{a-c}.tile.openstreetmap.us/' +
|
||||||
|
'vectiles-land-usages/{z}/{x}/{y}.topojson'
|
||||||
|
}),
|
||||||
|
visible: false,
|
||||||
|
style: function(feature) {
|
||||||
|
var kind = feature.get('kind');
|
||||||
|
var styleKey = kind;
|
||||||
|
var style = landuseStyleCache[styleKey];
|
||||||
|
if (!style) {
|
||||||
|
var color, width;
|
||||||
|
color = {
|
||||||
|
'parking': '#ddd',
|
||||||
|
'industrial': '#aaa',
|
||||||
|
'urban area': '#aaa',
|
||||||
|
'park': '#76C759',
|
||||||
|
'school': '#DA10E7',
|
||||||
|
'garden': '#76C759',
|
||||||
|
'pitch': '#D58F8D',
|
||||||
|
'scrub': '#3E7D28',
|
||||||
|
'residential': '#4C9ED9'
|
||||||
|
}[kind];
|
||||||
|
width = kind == 'highway' ? 1.5 : 1;
|
||||||
|
style = new ol.style.Style({
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: color,
|
||||||
|
width: width
|
||||||
|
}),
|
||||||
|
fill: new ol.style.Fill({
|
||||||
|
color: color,
|
||||||
|
opacity: 0.5
|
||||||
|
})
|
||||||
|
});
|
||||||
|
landuseStyleCache[styleKey] = style;
|
||||||
|
}
|
||||||
|
return style;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: Overlay
|
|||||||
shortdesc: Demonstrates overlays.
|
shortdesc: Demonstrates overlays.
|
||||||
docs: >
|
docs: >
|
||||||
<p>The popups are created using <a href="http://getbootstrap.com/javascript/#popovers">Popovers</a> from Bootstrap.</p>
|
<p>The popups are created using <a href="http://getbootstrap.com/javascript/#popovers">Popovers</a> from Bootstrap.</p>
|
||||||
tags: "overlay, popup, bootstrap, popover"
|
tags: "overlay, popup, bootstrap, popover, mapquest, openaerial"
|
||||||
resources:
|
resources:
|
||||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||||
|
|||||||
@@ -4,15 +4,16 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.coordinate');
|
goog.require('ol.coordinate');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.MapQuest');
|
||||||
|
|
||||||
|
|
||||||
var layer = new ol.layer.Tile({
|
var layer = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
|
renderer: common.getRendererFromQueryString(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user