Compare commits
1 Commits
v4.6.5
...
v4.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa7aee5ab3 |
@@ -1,3 +1,2 @@
|
|||||||
examples/Jugl.js
|
examples/Jugl.js
|
||||||
examples/resources/
|
examples/resources/
|
||||||
build/package/**/*webgl*
|
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE.md
vendored
8
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,8 +0,0 @@
|
|||||||
Thank you for your interest in making OpenLayers better!
|
|
||||||
|
|
||||||
To keep this project manageable for maintainers, we ask you to please check all boxes below before submitting an issue.
|
|
||||||
|
|
||||||
- [ ] I am submitting a bug or feature request, not a usage question. Go to https://stackoverflow.com/questions/tagged/openlayers for questions.
|
|
||||||
- [ ] I have searched GitHub to see if a similar bug or feature request has already been reported.
|
|
||||||
- [ ] I have verified that the issue is present in the latest version of OpenLayers (see 'LATEST' on https://openlayers.org/).
|
|
||||||
- [ ] If reporting a bug, I have created a [CodePen](https://codepen.io) or prepared a stack trace (using the latest version and unminified code, so e.g. `ol-debug.js`, not `ol.js`) that shows the issue.
|
|
||||||
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,9 +0,0 @@
|
|||||||
Thank you for your interest in making OpenLayers better!
|
|
||||||
|
|
||||||
In order to get your proposed changes merged into the master branch, we ask you to please make sure the following boxes are checked *before* submitting your pull request.
|
|
||||||
|
|
||||||
- [ ] This pull request addresses an issue that has been marked with the 'Pull request accepted' label & I have added the link to that issue.
|
|
||||||
- [ ] It contains one or more small, incremental, logically separate commits, with no merge commits.
|
|
||||||
- [ ] I have used clear commit messages.
|
|
||||||
- [ ] Existing tests pass for me locally & I have added or updated tests for new or changed functionality.
|
|
||||||
- [ ] The work herein is covered by a valid [Contributor License Agreement (CLA)](https://github.com/openlayers/cla).
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
/build/
|
/build/
|
||||||
/coverage/
|
|
||||||
/dist/
|
|
||||||
/node_modules/
|
/node_modules/
|
||||||
|
/dist/
|
||||||
|
/coverage/
|
||||||
|
|||||||
34
.travis.yml
34
.travis.yml
@@ -1,22 +1,30 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
node_js:
|
node_js:
|
||||||
- '8'
|
- "6"
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
|
env:
|
||||||
|
- DISPLAY=:99.0
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- "npm prune"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- rm src/ol/renderer/webgl/*shader.js
|
- "rm src/ol/renderer/webgl/*shader.js"
|
||||||
- rm src/ol/renderer/webgl/*shader/locations.js
|
- "sh -e /etc/init.d/xvfb start"
|
||||||
script: make ci
|
- "npm ls"
|
||||||
|
|
||||||
|
script: "make ci"
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- cat coverage/lcov.info | coveralls
|
- "make test-coverage"
|
||||||
|
- "cat coverage/lcov.info | ./node_modules/.bin/coveralls"
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
addons:
|
|
||||||
hosts:
|
|
||||||
- travis.dev
|
|
||||||
jwt:
|
|
||||||
# This is the encrypted SAUCE_ACCESS_KEY
|
|
||||||
secure: bb2Ibzu9RLe6ZlIG7JVcuH7IoLMxa/i3LTM7t8mbsPjVOGs5ycyJ7M9MbvqB/F2EzbeV4XB2c9ufI4TkaLYceY5kdWjfZVN8iasr+GFqKMv1uR4i6bpu8KmHJ+blxwfY1QOQ/cGwEx+fbeycMtpTc3Y3GyXaPlCQLhbZvesMg88=
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Thanks for your interest in contributing to OpenLayers.
|
|||||||
|
|
||||||
## Asking Questions
|
## Asking Questions
|
||||||
|
|
||||||
Please ask questions about using the library on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers).
|
Please ask questions about using the library on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
|
||||||
|
|
||||||
When you want to get involved and discuss new features or changes, please use [the mailing list](https://groups.google.com/forum/#!forum/openlayers-dev).
|
When you want to get involved and discuss new features or changes, please use [the mailing list](https://groups.google.com/forum/#!forum/openlayers-dev).
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ The minimum requirements are:
|
|||||||
|
|
||||||
* GNU Make
|
* GNU Make
|
||||||
* Git
|
* Git
|
||||||
* [Node.js](http://nodejs.org/) (version 8 and above)
|
* [Node.js](http://nodejs.org/) (higher than 0.12.x)
|
||||||
* Python 2.6 or 2.7
|
* Python 2.6 or 2.7
|
||||||
* Java 7 (JRE and JDK)
|
* Java 7 (JRE and JDK)
|
||||||
|
|
||||||
|
|||||||
73
Makefile
73
Makefile
@@ -3,10 +3,12 @@ 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 %shader.glsl,%shader.js,$(SRC_GLSL))
|
||||||
SRC_SHADERLOCATIONS_JS := $(patsubst %shader.glsl,%shader/locations.js,$(SRC_GLSL))
|
SRC_JS := $(filter-out $(SRC_SHADER_JS),$(shell find src -name '*.js'))
|
||||||
SRC_JS := $(filter-out $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS),$(shell find src -name '*.js'))
|
|
||||||
SRC_JSDOC = $(shell find src -type f -name '*.jsdoc')
|
SRC_JSDOC = $(shell find src -type f -name '*.jsdoc')
|
||||||
|
|
||||||
|
SPEC_JS := $(shell find test/spec -type f -name '*.js')
|
||||||
|
SPEC_RENDERING_JS := $(shell find test_rendering/spec -name '*.js')
|
||||||
|
|
||||||
EXAMPLES := $(shell find examples -type f)
|
EXAMPLES := $(shell find examples -type f)
|
||||||
EXAMPLES_HTML := $(filter-out examples/index.html,$(shell find examples -maxdepth 1 -type f -name '*.html'))
|
EXAMPLES_HTML := $(filter-out examples/index.html,$(shell find examples -maxdepth 1 -type f -name '*.html'))
|
||||||
EXAMPLES_JS := $(patsubst %.html,%.js,$(EXAMPLES_HTML))
|
EXAMPLES_JS := $(patsubst %.html,%.js,$(EXAMPLES_HTML))
|
||||||
@@ -54,6 +56,7 @@ help:
|
|||||||
@echo "Other less frequently used targets are:"
|
@echo "Other less frequently used targets are:"
|
||||||
@echo
|
@echo
|
||||||
@echo "- build Build ol.js, ol-debug.js, ol.js.map and ol.css"
|
@echo "- build Build ol.js, ol-debug.js, ol.js.map and ol.css"
|
||||||
|
@echo "- lint Check the code with the linter"
|
||||||
@echo "- ci Run the full continuous integration process"
|
@echo "- ci Run the full continuous integration process"
|
||||||
@echo "- apidoc Build the API documentation using JSDoc"
|
@echo "- apidoc Build the API documentation using JSDoc"
|
||||||
@echo "- cleanall Remove all the build artefacts"
|
@echo "- cleanall Remove all the build artefacts"
|
||||||
@@ -67,7 +70,7 @@ apidoc: build/timestamps/jsdoc-$(BRANCH)-timestamp
|
|||||||
build: build/ol.css build/ol.js build/ol-debug.js build/ol.js.map
|
build: build/ol.css build/ol.js build/ol-debug.js build/ol.js.map
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: build/ol.js test
|
check: lint build/ol.js test
|
||||||
|
|
||||||
.PHONY: check-examples
|
.PHONY: check-examples
|
||||||
check-examples: $(CHECK_EXAMPLE_TIMESTAMPS)
|
check-examples: $(CHECK_EXAMPLE_TIMESTAMPS)
|
||||||
@@ -83,18 +86,21 @@ check-deps:
|
|||||||
done ;\
|
done ;\
|
||||||
|
|
||||||
.PHONY: ci
|
.PHONY: ci
|
||||||
ci: build test package compile-examples check-examples apidoc
|
ci: lint build test test-rendering compile-examples check-examples apidoc
|
||||||
|
|
||||||
.PHONY: compile-examples
|
.PHONY: compile-examples
|
||||||
compile-examples: build/compiled-examples/all.combined.js
|
compile-examples: build/compiled-examples/all.combined.js
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
rm -f build/timestamps/eslint-timestamp
|
||||||
rm -f build/timestamps/check-*-timestamp
|
rm -f build/timestamps/check-*-timestamp
|
||||||
rm -f build/ol.css
|
rm -f build/ol.css
|
||||||
rm -f build/ol.js
|
rm -f build/ol.js
|
||||||
rm -f build/ol.js.map
|
rm -f build/ol.js.map
|
||||||
rm -f build/ol-debug.js
|
rm -f build/ol-debug.js
|
||||||
|
rm -f build/test_requires.js
|
||||||
|
rm -f build/test_rendering_requires.js
|
||||||
rm -rf build/examples
|
rm -rf build/examples
|
||||||
rm -rf build/compiled-examples
|
rm -rf build/compiled-examples
|
||||||
rm -rf build/package
|
rm -rf build/package
|
||||||
@@ -113,19 +119,34 @@ examples: $(BUILD_EXAMPLES)
|
|||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: build/timestamps/node-modules-timestamp
|
install: build/timestamps/node-modules-timestamp
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint: build/timestamps/eslint-timestamp
|
||||||
|
|
||||||
.PHONY: npm-install
|
.PHONY: npm-install
|
||||||
npm-install: build/timestamps/node-modules-timestamp
|
npm-install: build/timestamps/node-modules-timestamp
|
||||||
|
|
||||||
.PHONY: shaders
|
.PHONY: shaders
|
||||||
shaders: $(SRC_SHADER_JS $(SRC_SHADERLOCATIONS_JS)
|
shaders: $(SRC_SHADER_JS)
|
||||||
|
|
||||||
.PHONY: serve
|
.PHONY: serve
|
||||||
serve:
|
serve: build/test_requires.js build/test_rendering_requires.js
|
||||||
node tasks/serve.js
|
node tasks/serve.js
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: build/timestamps/node-modules-timestamp
|
test: build/timestamps/node-modules-timestamp build/test_requires.js
|
||||||
npm test
|
node tasks/test.js
|
||||||
|
|
||||||
|
.PHONY: test-coverage
|
||||||
|
test-coverage: build/timestamps/node-modules-timestamp
|
||||||
|
node tasks/test-coverage.js
|
||||||
|
|
||||||
|
.PHONY: test-rendering
|
||||||
|
test-rendering: build/timestamps/node-modules-timestamp \
|
||||||
|
build/test_rendering_requires.js
|
||||||
|
@rm -rf build/slimerjs-profile
|
||||||
|
@mkdir -p build/slimerjs-profile
|
||||||
|
@cp -r test_rendering/slimerjs-profile/* build/slimerjs-profile/
|
||||||
|
node tasks/test-rendering.js
|
||||||
|
|
||||||
.PHONY: host-examples
|
.PHONY: host-examples
|
||||||
host-examples: $(BUILD_HOSTED_EXAMPLES) \
|
host-examples: $(BUILD_HOSTED_EXAMPLES) \
|
||||||
@@ -168,7 +189,7 @@ build/compiled-examples/all.js: $(EXAMPLES_JS)
|
|||||||
@python bin/combine-examples.py $^ > $@
|
@python bin/combine-examples.py $^ > $@
|
||||||
|
|
||||||
build/compiled-examples/all.combined.js: config/examples-all.json build/compiled-examples/all.js \
|
build/compiled-examples/all.combined.js: config/examples-all.json build/compiled-examples/all.js \
|
||||||
$(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS) \
|
$(SRC_JS) $(SRC_SHADER_JS) \
|
||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
node tasks/build.js $< $@
|
node tasks/build.js $< $@
|
||||||
@@ -179,14 +200,14 @@ build/compiled-examples/%.json: config/example.json build/examples/%.js \
|
|||||||
@sed -e 's|{{id}}|$*|' $< > $@
|
@sed -e 's|{{id}}|$*|' $< > $@
|
||||||
|
|
||||||
build/compiled-examples/%.combined.js: build/compiled-examples/%.json \
|
build/compiled-examples/%.combined.js: build/compiled-examples/%.json \
|
||||||
$(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS)\
|
$(SRC_JS) $(SRC_SHADER_JS) \
|
||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
node tasks/build.js $< $@
|
node tasks/build.js $< $@
|
||||||
|
|
||||||
build/timestamps/jsdoc-$(BRANCH)-timestamp: config/jsdoc/api/index.md \
|
build/timestamps/jsdoc-$(BRANCH)-timestamp: config/jsdoc/api/index.md \
|
||||||
config/jsdoc/api/conf.json $(SRC_JS) \
|
config/jsdoc/api/conf.json $(SRC_JS) \
|
||||||
$(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS) \
|
$(SRC_SHADER_JS) \
|
||||||
$(shell find config/jsdoc/api/template -type f) \
|
$(shell find config/jsdoc/api/template -type f) \
|
||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@@ -227,6 +248,14 @@ $(BUILD_HOSTED)/build/ol-deps.js: host-libraries
|
|||||||
--root_with_prefix "$(BUILD_HOSTED)/closure-library/third_party ../../third_party" \
|
--root_with_prefix "$(BUILD_HOSTED)/closure-library/third_party ../../third_party" \
|
||||||
--output_file $@
|
--output_file $@
|
||||||
|
|
||||||
|
build/timestamps/eslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \
|
||||||
|
$(TASKS_JS) $(EXAMPLES_JS) \
|
||||||
|
build/timestamps/node-modules-timestamp
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
@echo "Running eslint..."
|
||||||
|
@./node_modules/.bin/eslint --quiet tasks test test_rendering src examples
|
||||||
|
@touch $@
|
||||||
|
|
||||||
build/timestamps/node-modules-timestamp: package.json
|
build/timestamps/node-modules-timestamp: package.json
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
npm install
|
npm install
|
||||||
@@ -237,7 +266,7 @@ build/ol.css: css/ol.css build/timestamps/node-modules-timestamp
|
|||||||
@echo "Running cleancss..."
|
@echo "Running cleancss..."
|
||||||
@./node_modules/.bin/cleancss $< > $@
|
@./node_modules/.bin/cleancss $< > $@
|
||||||
|
|
||||||
build/ol.js: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS) \
|
build/ol.js: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) \
|
||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
node tasks/build.js $< $@
|
node tasks/build.js $< $@
|
||||||
@@ -247,12 +276,12 @@ build/ol.js: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS)
|
|||||||
@$(STAT_COMPRESSED) /tmp/ol.js.gz
|
@$(STAT_COMPRESSED) /tmp/ol.js.gz
|
||||||
@rm /tmp/ol.js.gz
|
@rm /tmp/ol.js.gz
|
||||||
|
|
||||||
build/ol.js.map: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS) \
|
build/ol.js.map: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) \
|
||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
node tasks/build.js $< $@
|
node tasks/build.js $< $@
|
||||||
|
|
||||||
build/ol-debug.js: config/ol-debug.json $(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERLOCATIONS_JS) \
|
build/ol-debug.js: config/ol-debug.json $(SRC_JS) $(SRC_SHADER_JS) \
|
||||||
build/timestamps/node-modules-timestamp
|
build/timestamps/node-modules-timestamp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
node tasks/build.js $< $@
|
node tasks/build.js $< $@
|
||||||
@@ -262,12 +291,16 @@ build/ol-debug.js: config/ol-debug.json $(SRC_JS) $(SRC_SHADER_JS) $(SRC_SHADERL
|
|||||||
@$(STAT_COMPRESSED) /tmp/ol-debug.js.gz
|
@$(STAT_COMPRESSED) /tmp/ol-debug.js.gz
|
||||||
@rm /tmp/ol-debug.js.gz
|
@rm /tmp/ol-debug.js.gz
|
||||||
|
|
||||||
%shader.js: %shader.glsl src/ol/webgl/shader.mustache tasks/glslunit.js build/timestamps/node-modules-timestamp
|
build/test_requires.js: $(SPEC_JS) $(SRC_JS)
|
||||||
@node tasks/glslunit.js --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shader.mustache > $@
|
|
||||||
|
|
||||||
%shader/locations.js: %shader.glsl src/ol/webgl/shaderlocations.mustache tasks/glslunit.js build/timestamps/node-modules-timestamp
|
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
@node tasks/glslunit.js --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shaderlocations.mustache > $@
|
@node tasks/generate-requires.js $^ > $@
|
||||||
|
|
||||||
|
build/test_rendering_requires.js: $(SPEC_RENDERING_JS)
|
||||||
|
@mkdir -p $(@D)
|
||||||
|
@node tasks/generate-requires.js $^ > $@
|
||||||
|
|
||||||
|
%shader.js: %shader.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 > $@
|
||||||
|
|
||||||
.PHONY: package
|
.PHONY: package
|
||||||
package:
|
package:
|
||||||
@@ -275,6 +308,4 @@ package:
|
|||||||
@cp -r package build
|
@cp -r package build
|
||||||
@cd ./src && cp -r ol/* ../build/package
|
@cd ./src && cp -r ol/* ../build/package
|
||||||
@rm build/package/typedefs.js
|
@rm build/package/typedefs.js
|
||||||
@cp css/ol.css build/package
|
|
||||||
./node_modules/.bin/jscodeshift --transform transforms/module.js build/package
|
./node_modules/.bin/jscodeshift --transform transforms/module.js build/package
|
||||||
npm run lint-package
|
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -9,16 +9,9 @@
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Use one of the following methods to use OpenLayers in your project:
|
- Download the [latest release](https://openlayers.org/download/)
|
||||||
|
- Install with npm: `npm install openlayers`
|
||||||
* For use with webpack, Rollup, Browserify, or other module bundlers, install the [`ol` package](https://www.npmjs.com/package/ol):
|
- Clone the repo: `git clone git@github.com:openlayers/openlayers.git`
|
||||||
```
|
|
||||||
npm install ol
|
|
||||||
```
|
|
||||||
|
|
||||||
* If you just want to add a `<script>` tag to test things out, you can link directly to one of the full builds from [cdnjs](https://cdnjs.com/libraries/openlayers) (not recommended for production)
|
|
||||||
|
|
||||||
* For use with Closure Library (rare), install the [`openlayers` package](https://npmjs.com/package/openlayers) and read the [tutorial](http://openlayers.org/en/latest/doc/tutorials/closure.html).
|
|
||||||
|
|
||||||
## Supported Browsers
|
## Supported Browsers
|
||||||
|
|
||||||
@@ -38,5 +31,6 @@ Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in
|
|||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
- Need help? Find it on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers)
|
- Need help? Find it on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3)
|
||||||
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
|
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
|
||||||
|
- Discuss with openlayers users on IRC in `#openlayers` at `chat.freenode`
|
||||||
|
|||||||
120
bin/pyglslunit.py
Normal file
120
bin/pyglslunit.py
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
from optparse import OptionParser
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ESCAPE_SEQUENCE = {
|
||||||
|
'\\': '\\\\',
|
||||||
|
'\n': '\\n',
|
||||||
|
'\t': '\\t'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def js_escape(s):
|
||||||
|
return ''.join(ESCAPE_SEQUENCE.get(c, c) for c in s)
|
||||||
|
|
||||||
|
|
||||||
|
def glsl_compress(s, shortNames):
|
||||||
|
# strip leading whitespace
|
||||||
|
s = re.sub(r'\A\s+', '', s)
|
||||||
|
# strip trailing whitespace
|
||||||
|
s = re.sub(r'\s+\Z', '', s)
|
||||||
|
# strip multi-line comments
|
||||||
|
s = re.sub(r'/\*.*?\*/', '', s)
|
||||||
|
# strip single line comments
|
||||||
|
s = re.sub(r'//.*?\n', '', s)
|
||||||
|
# replace multiple whitespace with a single space
|
||||||
|
s = re.sub(r'\s+', ' ', s)
|
||||||
|
# remove whitespace between non-word tokens
|
||||||
|
s = re.sub(r'(\S)\s+([^\w])', r'\1\2', s)
|
||||||
|
s = re.sub(r'([^\w])\s+(\S)', r'\1\2', s)
|
||||||
|
# replace original names with short names
|
||||||
|
for originalName, shortName in shortNames.items():
|
||||||
|
s = s.replace(originalName, shortName)
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
option_parser = OptionParser()
|
||||||
|
option_parser.add_option('--input')
|
||||||
|
option_parser.add_option('--output')
|
||||||
|
options, args = option_parser.parse_args(argv[1:])
|
||||||
|
|
||||||
|
context = {}
|
||||||
|
nextShortName = ord('a')
|
||||||
|
shortNames = {}
|
||||||
|
|
||||||
|
common, vertex, fragment = [], [], []
|
||||||
|
attributes, uniforms, varyings = {}, {}, {}
|
||||||
|
block = None
|
||||||
|
for line in open(options.input, 'rU'):
|
||||||
|
if line.startswith('//!'):
|
||||||
|
m = re.match(r'//!\s+NAMESPACE=(\S+)\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
context['namespace'] = m.group(1)
|
||||||
|
continue
|
||||||
|
m = re.match(r'//!\s+CLASS=(\S+)\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
context['className'] = m.group(1)
|
||||||
|
continue
|
||||||
|
m = re.match(r'//!\s+COMMON\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
block = common
|
||||||
|
continue
|
||||||
|
m = re.match(r'//!\s+VERTEX\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
block = vertex
|
||||||
|
continue
|
||||||
|
m = re.match(r'//!\s+FRAGMENT\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
block = fragment
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
if block is None:
|
||||||
|
assert line.rstrip() == ''
|
||||||
|
else:
|
||||||
|
block.append(line)
|
||||||
|
m = re.match(r'attribute\s+\S+\s+(\S+);\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
attribute = m.group(1)
|
||||||
|
if attribute not in attributes:
|
||||||
|
shortName = chr(nextShortName)
|
||||||
|
nextShortName += 1
|
||||||
|
attributes[attribute] = {'originalName': attribute, 'shortName': shortName}
|
||||||
|
shortNames[attribute] = shortName
|
||||||
|
m = re.match(r'uniform\s+\S+\s+(\S+);\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
uniform = m.group(1)
|
||||||
|
if uniform not in uniforms:
|
||||||
|
shortName = chr(nextShortName)
|
||||||
|
nextShortName += 1
|
||||||
|
uniforms[uniform] = {'originalName': uniform, 'shortName': shortName}
|
||||||
|
shortNames[uniform] = shortName
|
||||||
|
m = re.match(r'varying\s+\S+\s+(\S+);\s*\Z', line)
|
||||||
|
if m:
|
||||||
|
varying = m.group(1)
|
||||||
|
if varying not in varyings:
|
||||||
|
shortName = chr(nextShortName)
|
||||||
|
nextShortName += 1
|
||||||
|
shortNames[varying] = shortName
|
||||||
|
|
||||||
|
context['getOriginalFragmentSource'] = js_escape(''.join(common + fragment))
|
||||||
|
context['getOriginalVertexSource'] = js_escape(''.join(common + vertex))
|
||||||
|
context['getFragmentSource'] = glsl_compress(''.join(common + fragment), shortNames)
|
||||||
|
context['getVertexSource'] = glsl_compress(''.join(common + vertex), shortNames)
|
||||||
|
context['getAttributes'] = [attributes[a] for a in sorted(attributes.keys())]
|
||||||
|
context['getUniforms'] = [uniforms[u] for u in sorted(uniforms.keys())]
|
||||||
|
|
||||||
|
if options.output and options.output != '-':
|
||||||
|
output = open(options.output, 'wb')
|
||||||
|
else:
|
||||||
|
output = sys.stdout
|
||||||
|
json.dump(context, output)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main(sys.argv))
|
||||||
@@ -1,244 +1,11 @@
|
|||||||
## Upgrade notes
|
## Upgrade notes
|
||||||
|
|
||||||
### v4.6.0
|
### Next release
|
||||||
|
|
||||||
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
|
|
||||||
|
|
||||||
To update your applications, simply replace `exceedLength` with `overflow`.
|
|
||||||
|
|
||||||
#### Deprecation of `ol.source.ImageVector`
|
|
||||||
|
|
||||||
Rendering vector sources as image is now directly supported by `ol.layer.Vector` with the new `renderMode: 'image'` configuration option. Change code like this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
new ol.layer.Image({
|
|
||||||
source: new ol.source.ImageVector({
|
|
||||||
style: myStyle,
|
|
||||||
source: new ol.source.Vector({
|
|
||||||
url: 'my/data.json',
|
|
||||||
format: new ol.format.GeoJSON()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
|
||||||
```
|
|
||||||
to:
|
|
||||||
|
|
||||||
```js
|
|
||||||
new ol.layer.Vector({
|
|
||||||
renderMode: 'image',
|
|
||||||
style: myStyle,
|
|
||||||
source: new ol.source.Vector({
|
|
||||||
url: 'my/data.json',
|
|
||||||
format: new ol.format.GeoJSON()
|
|
||||||
})
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### v4.5.0
|
|
||||||
|
|
||||||
#### Removed GeoJSON crs workaround for GeoServer
|
|
||||||
|
|
||||||
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed.
|
|
||||||
|
|
||||||
#### Deprecation of `ol.Attribution`
|
|
||||||
|
|
||||||
`ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.XYZ({
|
|
||||||
attributions: [
|
|
||||||
new ol.Attribution({html: 'some attribution'})
|
|
||||||
]
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.XYZ({
|
|
||||||
attributions: 'some attribution'
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
In addition to passing a string or an array of strings for the `attributions` option, you can also pass a function that will get called with the current frame state.
|
|
||||||
```js
|
|
||||||
var source = new ol.source.XYZ({
|
|
||||||
attributions: function(frameState) {
|
|
||||||
// inspect the frame state and return attributions
|
|
||||||
return 'some attribution'; // or ['multiple', 'attributions'] or null
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### v4.4.0
|
|
||||||
|
|
||||||
#### Behavior change for polygon labels
|
|
||||||
|
|
||||||
Polygon labels are now only rendered when the label does not exceed the polygon at the label position. To get the old behavior, configure your `ol.style.Text` with `exceedLength: true`.
|
|
||||||
|
|
||||||
#### Minor change for custom `tileLoadFunction` with `ol.source.VectorTile`
|
|
||||||
|
|
||||||
It is no longer necessary to set the projection on the tile. Instead, the `readFeatures` method must be called with the tile's extent as `extent` option and the view's projection as `featureProjection`.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
tile.setLoader(function() {
|
|
||||||
var data = // ... fetch data
|
|
||||||
var format = tile.getFormat();
|
|
||||||
tile.setFeatures(format.readFeatures(data));
|
|
||||||
tile.setProjection(format.readProjection(data));
|
|
||||||
// uncomment the line below for ol.format.MVT only
|
|
||||||
//tile.setExtent(format.getLastExtent());
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
tile.setLoader(function() {
|
|
||||||
var data = // ... fetch data
|
|
||||||
var format = tile.getFormat();
|
|
||||||
tile.setFeatures(format.readFeatures(data, {
|
|
||||||
featureProjection: map.getView().getProjection(),
|
|
||||||
// uncomment the line below for ol.format.MVT only
|
|
||||||
//extent: tile.getExtent()
|
|
||||||
}));
|
|
||||||
);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Deprecation of `ol.DeviceOrientation`
|
|
||||||
|
|
||||||
`ol.DeviceOrientation` is deprecated and will be removed in the next major version.
|
|
||||||
The device-orientation example has been updated to use the (gyronorm.js)[https://github.com/dorukeker/gyronorm.js] library.
|
|
||||||
|
|
||||||
|
|
||||||
### v4.3.0
|
|
||||||
|
|
||||||
#### `ol.source.VectorTile` no longer requires a `tileGrid` option
|
|
||||||
|
|
||||||
By default, the `ol.source.VectorTile` constructor creates an XYZ tile grid (in Web Mercator) for 512 pixel tiles and assumes a max zoom level of 22. If you were creating a vector tile source with an explicit `tileGrid` option, you can now remove this.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.VectorTile({
|
|
||||||
tileGrid: ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 22}),
|
|
||||||
url: url
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.VectorTile({
|
|
||||||
url: url
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need to change the max zoom level, you can pass the source a `maxZoom` option. If you need to change the tile size, you can pass the source a `tileSize` option. If you need a completely custom tile grid, you can still pass the source a `tileGrid` option.
|
|
||||||
|
|
||||||
#### `ol.interaction.Modify` deletes with `alt` key only
|
|
||||||
|
|
||||||
To delete features with the modify interaction, press the `alt` key while clicking on an existing vertex. If you want to configure the modify interaction with a different delete condition, use the `deleteCondition` option. For example, to allow deletion on a single click with no modifier keys, configure the interaction like this:
|
|
||||||
```js
|
|
||||||
var interaction = new ol.interaction.Modify({
|
|
||||||
source: source,
|
|
||||||
deleteCondition: function(event) {
|
|
||||||
return ol.events.condition.noModifierKeys(event) && ol.events.condition.singleClick(event);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
The motivation for this change is to make the modify, draw, and snap interactions all work well together. Previously, the use of these interactions with the default configuration would make it so you couldn't reliably add new vertices (click with no modifier) and delete existing vertices (click with no modifier).
|
|
||||||
|
|
||||||
#### `ol.source.VectorTile` no longer has a `tilePixelRatio` option
|
|
||||||
|
|
||||||
The `tilePixelRatio` option was only used for tiles in projections with `tile-pixels` as units. For tiles read with `ol.format.MVT` and the default tile loader, or tiles with the default pixel size of 4096 pixels, no changes are necessary. For the very rare cases that do not fall under these categories, a custom `tileLoadFunction` now needs to be configured on the `ol.source.VectorTile`. In addition to calling `tile.setFeatures()` and `tile.setProjection()`, it also needs to contain code like the following:
|
|
||||||
```js
|
|
||||||
var extent = tile.getFormat() instanceof ol.format.MVT ?
|
|
||||||
tile.getLastExtent() :
|
|
||||||
[0, 0, tilePixelRatio * tileSize, tilePixelRatio * tileSize];
|
|
||||||
tile.setExtent(extent);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `ol.animate` now takes the shortest arc for rotation animation
|
|
||||||
|
|
||||||
Usually rotation animations should animate along the shortest arc. There are rare occasions where a spinning animation effect is desired. So if you previously had something like
|
|
||||||
```js
|
|
||||||
map.getView().animate({
|
|
||||||
rotation: 2 * Math.PI,
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
```
|
|
||||||
we recommend to split the animation into two parts and use different easing functions. The code below results in the same effect as the snippet above did with previous versions:
|
|
||||||
```js
|
|
||||||
map.getView().animate({
|
|
||||||
rotation: Math.PI,
|
|
||||||
easing: ol.easing.easeIn
|
|
||||||
}, {
|
|
||||||
rotation: 2 * Math.PI,
|
|
||||||
easing: ol.easing.easeOut
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### v4.2.0
|
|
||||||
|
|
||||||
#### Return values of two `ol.style.RegularShape` getters have changed
|
|
||||||
|
|
||||||
To provide a more consistent behaviour the following getters now return the same value that was given to constructor:
|
|
||||||
|
|
||||||
`ol.style.RegularShape#getPoints` does not return the double amount of points anymore if a radius2 is set.
|
|
||||||
|
|
||||||
`ol.style.RegularShape#getRadius2` will return `undefined` if no radius2 is set.
|
|
||||||
|
|
||||||
### v4.1.0
|
|
||||||
|
|
||||||
#### Adding duplicate layers to a map throws
|
|
||||||
|
|
||||||
Previously, you could do this:
|
|
||||||
```js
|
|
||||||
map.addLayer(layer);
|
|
||||||
map.addLayer(layer);
|
|
||||||
```
|
|
||||||
|
|
||||||
However, after adding a duplicate layer, things failed if you tried to remove that layer.
|
|
||||||
|
|
||||||
Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map.
|
|
||||||
|
|
||||||
#### Simpler `constrainResolution` configuration
|
|
||||||
|
|
||||||
The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`
|
|
||||||
can now be set directly with an option in `ol.interaction.defaults`:
|
|
||||||
```js
|
|
||||||
ol.interaction.defaults({
|
|
||||||
constrainResolution: true
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
### v4.0.0
|
|
||||||
|
|
||||||
#### Simpler `ol.source.Zoomify` `url` configuration
|
|
||||||
|
|
||||||
Instead specifying a base url, the `url` for the `ol.source.Zoomify` source can now be a template. The `{TileGroup}`, `{x}`, `{y}`, `{z}` and placeholders must be included in the `url` in this case. the `url` can now also include subdomain placeholders:
|
|
||||||
```js
|
|
||||||
new ol.source.Zoomify({
|
|
||||||
url: 'https://{a-f}.example.com/cgi-bin/iipsrv.fcgi?zoomify=/a/b/{TileGroup}/{z}-{x}-{y}.jpg'
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Removal of deprecated methods
|
#### Removal of deprecated methods
|
||||||
|
|
||||||
The deprecated `ol.animation` functions and `map.beforeRender()` method have been removed. Use `view.animate()` instead.
|
The deprecated `ol.animation` functions and `map.beforeRender()` method have been removed. Use `view.animate()` instead.
|
||||||
|
|
||||||
The `unByKey()` method has been removed from `ol.Observable` instances. Use the `ol.Observable.unByKey()` static function instead.
|
|
||||||
```js
|
|
||||||
var key = map.on('moveend', function() { ...});
|
|
||||||
map.unByKey(key);
|
|
||||||
```
|
|
||||||
New code:
|
|
||||||
```js
|
|
||||||
var key = map.on('moveend', function() { ...});
|
|
||||||
ol.Observable.unByKey(key);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Simplified `ol.View#fit()` API
|
#### Simplified `ol.View#fit()` API
|
||||||
|
|
||||||
In most cases, it is no longer necessary to provide an `ol.Size` (previously the 2nd argument) to `ol.View#fit()`. By default, the size of the first map that uses the view will be used. If you want to specify a different size, it goes in the options now (previously the 3rd argument, now the 2nd).
|
In most cases, it is no longer necessary to provide an `ol.Size` (previously the 2nd argument) to `ol.View#fit()`. By default, the size of the first map that uses the view will be used. If you want to specify a different size, it goes in the options now (previously the 3rd argument, now the 2nd).
|
||||||
|
|||||||
@@ -1,183 +0,0 @@
|
|||||||
# 4.0.0
|
|
||||||
|
|
||||||
Starting with this version, OpenLayers introduces [Semantic Versioning](http://semver.org). Unlike the switch from v2.x to v3.x, which marked a complete rewrite of the library with an entirely new API, major version increments now simply mean that users should pay attention to the *'Breaking changes'* section of the upgrade notes.
|
|
||||||
|
|
||||||
For users of mainstream bundlers and minifiers, OpenLayers is now also available as a set of ES2015 modules. See https://npmjs.com/package/ol/. With that package, bundling only the needed parts of the library with an application is now completely hassle free.
|
|
||||||
|
|
||||||
Version 4.0.0 includes enhancements and fixes from 107 pull requests since the previous release.
|
|
||||||
|
|
||||||
Among these changes, [#6381](https://github.com/openlayers/openlayers/pull/6381) adds an example which shows how to use [geojson-vt](https://www.npmjs.com/package/geojson-vt) for highly efficient rendering of GeoJSON data as vector tiles.
|
|
||||||
|
|
||||||
Several improvements were made to `ol.source.Zoomify`, including projection support ([#6387](https://github.com/openlayers/openlayers/pull/6387)) and support for URL templates ([#6475](https://github.com/openlayers/openlayers/pull/6475)).
|
|
||||||
|
|
||||||
Also the `ol.source.ImageArcGISRest` saw some enhancements, including HiDPI/Retina support and a fix that avoids non-integer DPI values ([#6300](https://github.com/openlayers/openlayers/pull/6300) and [#6467](https://github.com/openlayers/openlayers/pull/6467)).
|
|
||||||
|
|
||||||
On the topic of drawing tools, @tst-ppenev completed an effort to make the `ol.interaction.Modify` interaction support modification of `ol.geom.Circle` geometries ([#6457](https://github.com/openlayers/openlayers/pull/6457)).
|
|
||||||
|
|
||||||
|
|
||||||
## Breaking changes
|
|
||||||
|
|
||||||
### Simplified `ol.View#fit()` API
|
|
||||||
|
|
||||||
In most cases, it is no longer necessary to provide an `ol.Size` (previously the 2nd argument) to `ol.View#fit()`. By default, the size of the first map that uses the view will be used. If you want to specify a different size, it goes in the options now (previously the 3rd argument, now the 2nd).
|
|
||||||
|
|
||||||
Most common use case - old API:
|
|
||||||
```js
|
|
||||||
map.getView().fit(extent, map.getSize());
|
|
||||||
```
|
|
||||||
Most common use case - new API:
|
|
||||||
```js
|
|
||||||
map.getView().fit(extent);
|
|
||||||
```
|
|
||||||
Advanced use - old API:
|
|
||||||
```js
|
|
||||||
map.getView().fit(extent, [200, 100], {padding: 10});
|
|
||||||
```
|
|
||||||
Advanced use - new API:
|
|
||||||
```js
|
|
||||||
map.getView().fit(extent, {size: [200, 100], padding 10});
|
|
||||||
```
|
|
||||||
|
|
||||||
### Removal of deprecated methods
|
|
||||||
|
|
||||||
The deprecated `ol.animation` functions and `map.beforeRender()` method have been removed. Use `view.animate()` instead.
|
|
||||||
|
|
||||||
The `unByKey()` method has been removed from `ol.Observable` instances. Use the `ol.Observable.unByKey()` static function instead.
|
|
||||||
```js
|
|
||||||
var key = map.on('moveend', function() { ...});
|
|
||||||
map.unByKey(key);
|
|
||||||
```
|
|
||||||
New code:
|
|
||||||
```js
|
|
||||||
var key = map.on('moveend', function() { ...});
|
|
||||||
ol.Observable.unByKey(key);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Upgrade notes
|
|
||||||
|
|
||||||
### Simpler `ol.source.Zoomify` `url` configuration
|
|
||||||
|
|
||||||
Instead specifying a base url, the `url` for the `ol.source.Zoomify` source can now be a template. The `{TileGroup}`, `{x}`, `{y}`, `{z}` and placeholders must be included in the `url` in this case. the `url` can now also include subdomain placeholders:
|
|
||||||
```js
|
|
||||||
new ol.source.Zoomify({
|
|
||||||
url: 'https://{a-f}.example.com/cgi-bin/iipsrv.fcgi?zoomify=/a/b/{TileGroup}/{z}-{x}-{y}.jpg'
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Removed build flags (`@define`)
|
|
||||||
|
|
||||||
The `ol.DEBUG`, `ol.ENABLE_TILE`, `ol.ENABLE_IMAGE`, `ol.ENABLE_VECTOR`, and `ol.ENABLE_VECTOR_TILE` build flags are no longer necessary and have been removed. If you were using these in a `define` array for a custom build, you can remove them.
|
|
||||||
|
|
||||||
If you leave `ol.ENABLE_WEBGL` set to `true` in your build, you should set `ol.DEBUG_WEBGL` to `false` to avoid including debuggable shader sources.
|
|
||||||
|
|
||||||
|
|
||||||
## List of all changes
|
|
||||||
|
|
||||||
* [#6477](https://github.com/openlayers/openlayers/pull/6477) - Save and restore context when rotating ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6475](https://github.com/openlayers/openlayers/pull/6475) - Use an url template for ol.source.Zoomify ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6478](https://github.com/openlayers/openlayers/pull/6478) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6472](https://github.com/openlayers/openlayers/pull/6472) - Use fixed pixel ratio for hit tolerance tests ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6468](https://github.com/openlayers/openlayers/pull/6468) - Remove console.assert in ol.structs.PriorityQueue tests ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6467](https://github.com/openlayers/openlayers/pull/6467) - Round the DPI value in ol.source.ImageArcGISRest ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6466](https://github.com/openlayers/openlayers/pull/6466) - Small XML error in KML test ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6410](https://github.com/openlayers/openlayers/pull/6410) - fixed the degreesToStringHDMS_() function to promote a seconds value … ([@rjackson64840](https://github.com/rjackson64840))
|
|
||||||
* [#6461](https://github.com/openlayers/openlayers/pull/6461) - Add button to edit examples in CodePen ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6320](https://github.com/openlayers/openlayers/pull/6320) - Use the 'openlayers' tag instead of 'openlayers-3' ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6460](https://github.com/openlayers/openlayers/pull/6460) - Remove ol.Observable#unByKey ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6463](https://github.com/openlayers/openlayers/pull/6463) - chore(package): update clean-css-cli to version 4.0.5 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6459](https://github.com/openlayers/openlayers/pull/6459) - Use ol.coordinate.distance ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6457](https://github.com/openlayers/openlayers/pull/6457) - Add Circle Modification ([@tst-ppenev](https://github.com/tst-ppenev))
|
|
||||||
* [#6455](https://github.com/openlayers/openlayers/pull/6455) - Make all @api annotations imply stability ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6452](https://github.com/openlayers/openlayers/pull/6452) - Remove deprecated methods ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6361](https://github.com/openlayers/openlayers/pull/6361) - Remove "margin" at the bottom of the canvas ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6450](https://github.com/openlayers/openlayers/pull/6450) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6302](https://github.com/openlayers/openlayers/pull/6302) - Publish a package for use with ES module bundlers ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6446](https://github.com/openlayers/openlayers/pull/6446) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6445](https://github.com/openlayers/openlayers/pull/6445) - Fix pinch zooming ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6444](https://github.com/openlayers/openlayers/pull/6444) - Disallow pinch zooming beyond min/max resolution ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6443](https://github.com/openlayers/openlayers/pull/6443) - goog.require cleanup ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6439](https://github.com/openlayers/openlayers/pull/6439) - Improve tile render performance ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6442](https://github.com/openlayers/openlayers/pull/6442) - Fix missing goog.require ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6441](https://github.com/openlayers/openlayers/pull/6441) - Update metalsmith-layouts to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6437](https://github.com/openlayers/openlayers/pull/6437) - Fit on circle ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6427](https://github.com/openlayers/openlayers/pull/6427) - Ensure WMS width and height are always integers ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6432](https://github.com/openlayers/openlayers/pull/6432) - Use ol.proj.EPSG3857.WORLD_EXTENT in ol.source.TileImage tests ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6424](https://github.com/openlayers/openlayers/pull/6424) - Update dependencies to enable Greenkeeper 🌴 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6422](https://github.com/openlayers/openlayers/pull/6422) - Don't listen twice to move and end events in ol.control.ZoomSlider ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6426](https://github.com/openlayers/openlayers/pull/6426) - Add rewrite_polyfills to custom builds tutorial ([@probins](https://github.com/probins))
|
|
||||||
* [#6365](https://github.com/openlayers/openlayers/pull/6365) - Make enums for draw and modify interactions public ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#6294](https://github.com/openlayers/openlayers/pull/6294) - Update code for closure-compiler v20170124 ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6413](https://github.com/openlayers/openlayers/pull/6413) - Accept ol.StyleFunction in ol.Feature#setStyle() ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6398](https://github.com/openlayers/openlayers/pull/6398) - Be more tolerant of map and position value ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6399](https://github.com/openlayers/openlayers/pull/6399) - Small doc fix in VectorTileOptions renderMode ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6396](https://github.com/openlayers/openlayers/pull/6396) - Show current year in attribution in "HERE Map Tile API" example ([@chrismayer](https://github.com/chrismayer))
|
|
||||||
* [#6390](https://github.com/openlayers/openlayers/pull/6390) - Tag deprecated functions with @deprecated ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6370](https://github.com/openlayers/openlayers/pull/6370) - Feature apidoc, fix events and observable properties ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6376](https://github.com/openlayers/openlayers/pull/6376) - Make ol.format.filter.or/and accept n filter conditions ([@tsauerwein](https://github.com/tsauerwein))
|
|
||||||
* [#6393](https://github.com/openlayers/openlayers/pull/6393) - Only stop animation when animating ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6387](https://github.com/openlayers/openlayers/pull/6387) - Add projection option to ol.source.Zoomify ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6386](https://github.com/openlayers/openlayers/pull/6386) - Snap : only listen to change event triggered by the feature ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6383](https://github.com/openlayers/openlayers/pull/6383) - Modify interaction: check if interaction is active before drawing modifying vertex ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6381](https://github.com/openlayers/openlayers/pull/6381) - geojson-vt integration example ([@drnextgis](https://github.com/drnextgis))
|
|
||||||
* [#6373](https://github.com/openlayers/openlayers/pull/6373) - Use the ol.DEBUG_WEBGL flag to debug shader sources ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6379](https://github.com/openlayers/openlayers/pull/6379) - Set the overview map target in ol.control.OverviewMap.setMap ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6375](https://github.com/openlayers/openlayers/pull/6375) - Use present in license text ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#6371](https://github.com/openlayers/openlayers/pull/6371) - Adjust copyright to include 2017 ([@kolosov-sergey](https://github.com/kolosov-sergey))
|
|
||||||
* [#6364](https://github.com/openlayers/openlayers/pull/6364) - Make sure moveTo is called after beginPath ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6285](https://github.com/openlayers/openlayers/pull/6285) - Make size argument of ol.View#calculateExtent() optional ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6357](https://github.com/openlayers/openlayers/pull/6357) - Fix GeoJSONCRSCode definition ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6362](https://github.com/openlayers/openlayers/pull/6362) - Remove empty file ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6358](https://github.com/openlayers/openlayers/pull/6358) - Ensure polygons without stroke are fully filled ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6356](https://github.com/openlayers/openlayers/pull/6356) - Bring custom builds tutorial up to date ([@probins](https://github.com/probins))
|
|
||||||
* [#6359](https://github.com/openlayers/openlayers/pull/6359) - When applying a pending fill, also apply a pending stroke ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6360](https://github.com/openlayers/openlayers/pull/6360) - Remove ol.array.flatten function ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6353](https://github.com/openlayers/openlayers/pull/6353) - API doc : add highlight style to the active anchor ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6355](https://github.com/openlayers/openlayers/pull/6355) - Remove test.geojson which was accidently committed in 57342a6 ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6349](https://github.com/openlayers/openlayers/pull/6349) - Better documentation for icon-color example ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6351](https://github.com/openlayers/openlayers/pull/6351) - Only consider pointerdown event if the last pointerup has been emitted ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6345](https://github.com/openlayers/openlayers/pull/6345) - Mitigate rounding errors in GetMap width/height calculation ([@giohappy](https://github.com/giohappy))
|
|
||||||
* [#6344](https://github.com/openlayers/openlayers/pull/6344) - No special raster reprojection handling for Chrome ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6339](https://github.com/openlayers/openlayers/pull/6339) - Code cleanup ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6337](https://github.com/openlayers/openlayers/pull/6337) - Constrain center in DragZoom interaction ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6336](https://github.com/openlayers/openlayers/pull/6336) - Remove unused ol.format.Feature.getExtensions function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6333](https://github.com/openlayers/openlayers/pull/6333) - Use API key for Thunderforest resources ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6300](https://github.com/openlayers/openlayers/pull/6300) - Add missing hidpi option for ol.source.ImageArcGISRest ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6109](https://github.com/openlayers/openlayers/pull/6109) - Export Map as PNG (IE issue) ([@NaveenKY](https://github.com/NaveenKY))
|
|
||||||
* [#6332](https://github.com/openlayers/openlayers/pull/6332) - Constrain the center in zoomByDelta ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6331](https://github.com/openlayers/openlayers/pull/6331) - Remove unused map parameter from ol.interaction.Interaction ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6326](https://github.com/openlayers/openlayers/pull/6326) - Add lineDashOffset to stroke style ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6328](https://github.com/openlayers/openlayers/pull/6328) - ol.geom.polygon documentation update on the coordinates format ([@quentin-ol](https://github.com/quentin-ol))
|
|
||||||
* [#6324](https://github.com/openlayers/openlayers/pull/6324) - Ensure resolution stays in range when pinching ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6329](https://github.com/openlayers/openlayers/pull/6329) - Fix WMTS theme location for sea-levels layer ([@thomasmoelhave](https://github.com/thomasmoelhave))
|
|
||||||
* [#6323](https://github.com/openlayers/openlayers/pull/6323) - Fix typo in Introduction ([@hdsnet](https://github.com/hdsnet))
|
|
||||||
* [#6305](https://github.com/openlayers/openlayers/pull/6305) - Moved hit Tolerance parameter to own example. ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
|
||||||
* [#6319](https://github.com/openlayers/openlayers/pull/6319) - Remove the '3' from OpenLayers ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6314](https://github.com/openlayers/openlayers/pull/6314) - WebGL conditional compilation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6313](https://github.com/openlayers/openlayers/pull/6313) - Remove ol.DEBUG ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6317](https://github.com/openlayers/openlayers/pull/6317) - Update sinon to version 1.17.7 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6312](https://github.com/openlayers/openlayers/pull/6312) - Make layers responsible for creating layer renderers ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6308](https://github.com/openlayers/openlayers/pull/6308) - Dedicated modules for shared enums ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6307](https://github.com/openlayers/openlayers/pull/6307) - Dedicated modules for enums ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6297](https://github.com/openlayers/openlayers/pull/6297) - Update resemblejs to version 2.2.3 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6296](https://github.com/openlayers/openlayers/pull/6296) - Fix #6295. Update reference link in sphere.js ([@jbelien](https://github.com/jbelien))
|
|
||||||
* [#6255](https://github.com/openlayers/openlayers/pull/6255) - Don't reset the css cursor if it's not needed ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6290](https://github.com/openlayers/openlayers/pull/6290) - Use interim tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6291](https://github.com/openlayers/openlayers/pull/6291) - Document olx.AtPixelOptions#hitTolerance default value ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6283](https://github.com/openlayers/openlayers/pull/6283) - Avoid modifying coordinate in forEachLayerAtCoordinate ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6278](https://github.com/openlayers/openlayers/pull/6278) - Add missing require for ol.View ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6280](https://github.com/openlayers/openlayers/pull/6280) - Continue loading tiles when image is not ready yet ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6277](https://github.com/openlayers/openlayers/pull/6277) - Name modules more like their provide ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6264](https://github.com/openlayers/openlayers/pull/6264) - Remove the requirement to provide a size to ol.View#fit() ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6274](https://github.com/openlayers/openlayers/pull/6274) - Update clean-css to version 3.4.23 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6269](https://github.com/openlayers/openlayers/pull/6269) - Update derequire to version 2.0.6 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6270](https://github.com/openlayers/openlayers/pull/6270) - Add a magnify example ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6261](https://github.com/openlayers/openlayers/pull/6261) - Fit Zoomify view to image extent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6259](https://github.com/openlayers/openlayers/pull/6259) - Simplify Zoomify example ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6260](https://github.com/openlayers/openlayers/pull/6260) - Enhance documentation for ol.View#fit ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#6258](https://github.com/openlayers/openlayers/pull/6258) - Set geometry name properly ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6251](https://github.com/openlayers/openlayers/pull/6251) - Take image pixel ratio into account for rendered resolution ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6244](https://github.com/openlayers/openlayers/pull/6244) - Enforces spacing around commas ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6246](https://github.com/openlayers/openlayers/pull/6246) - Re-render vector tiles when layer has changed ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6243](https://github.com/openlayers/openlayers/pull/6243) - Consistent spacing between keys and values in object literal ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6238](https://github.com/openlayers/openlayers/pull/6238) - Update eslint to version 3.12.1 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6236](https://github.com/openlayers/openlayers/pull/6236) - Update clean-css to version 3.4.22 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# 4.0.1
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v4.0.1 release is a patch release that addresses a regression in the v4.0.0 release. The fix makes pinch zooming work again properly when the two fingers are not placed on the screen at the same time.
|
|
||||||
|
|
||||||
See the [v4.0.0 release notes](https://github.com/openlayers/openlayers/releases/tag/v4.0.0) for details on upgrading from v3.20.x.
|
|
||||||
|
|
||||||
## Fix
|
|
||||||
|
|
||||||
* [#6486](https://github.com/openlayers/openlayers/pull/6486) - Do not set center when touches count has changed ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
# 4.1.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v4.1.0 release includes features and fixes from 91 pull requests.
|
|
||||||
|
|
||||||
#### Interactive overview map
|
|
||||||
|
|
||||||
The extent rectangle on the overview map can now be dragged to control the view for the main map.
|
|
||||||
|
|
||||||
#### Setting min and max zoom for a view
|
|
||||||
|
|
||||||
You can now change the min or max zoom for a view after it has been created. This can be useful if you want to limit how far out users can zoom based on changes in viewport width (use `view.setMinZoom()` for this).
|
|
||||||
|
|
||||||
#### Adding duplicate layers to a map throws
|
|
||||||
|
|
||||||
Previously, you could do this:
|
|
||||||
```js
|
|
||||||
map.addLayer(layer);
|
|
||||||
map.addLayer(layer);
|
|
||||||
```
|
|
||||||
|
|
||||||
However, after adding a duplicate layer, things failed if you tried to remove that layer.
|
|
||||||
|
|
||||||
Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map.
|
|
||||||
|
|
||||||
#### Simpler `constrainResolution` configuration
|
|
||||||
|
|
||||||
The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`
|
|
||||||
can now be set directly with an option in `ol.interaction.defaults`:
|
|
||||||
```js
|
|
||||||
ol.interaction.defaults({
|
|
||||||
constrainResolution: true
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## Detailed changes
|
|
||||||
|
|
||||||
* [#6675](https://github.com/openlayers/openlayers/pull/6675) - Reset cursor when translate interaction is removed or deactivated ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6707](https://github.com/openlayers/openlayers/pull/6707) - Set version when building ol package ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6706](https://github.com/openlayers/openlayers/pull/6706) - Add ol.source.Cluster#getDistance function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6695](https://github.com/openlayers/openlayers/pull/6695) - Unique layers ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6704](https://github.com/openlayers/openlayers/pull/6704) - Include typedefs.js in closure compiler tutorial build configurations ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6702](https://github.com/openlayers/openlayers/pull/6702) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6693](https://github.com/openlayers/openlayers/pull/6693) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6691](https://github.com/openlayers/openlayers/pull/6691) - Move eslint globals to to test/.eslintrc ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6689](https://github.com/openlayers/openlayers/pull/6689) - Add new constrainResolution option to olx.interaction.DefaultsOptions ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6692](https://github.com/openlayers/openlayers/pull/6692) - Improve docs for MouseWheelZoom constrainResolution ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6687](https://github.com/openlayers/openlayers/pull/6687) - Clip image only if the layer extent intersects the view extent ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6686](https://github.com/openlayers/openlayers/pull/6686) - Update finishCoordinate in ol.interaction.Draw#removeLastPoint ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6682](https://github.com/openlayers/openlayers/pull/6682) - Add example, docs and typedef for MouseWheelZoom's constrainResolution option ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6683](https://github.com/openlayers/openlayers/pull/6683) - Add this jsdoc tag to ol.interaction.DragBox.defaultBoxEndCondition ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6681](https://github.com/openlayers/openlayers/pull/6681) - Add constrainResolution in olx.interaction.PinchZoomOptions typedef ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6671](https://github.com/openlayers/openlayers/pull/6671) - Add constraintResolution option to MouseWheelZoom for zoom with trackpad ([@kaiCu](https://github.com/kaiCu))
|
|
||||||
* [#6680](https://github.com/openlayers/openlayers/pull/6680) - Remove ol.DRAG_BOX_HYSTERESIS_PIXELS define and add option ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6666](https://github.com/openlayers/openlayers/pull/6666) - Use the optional extent in ol.structs.RBush#getExtent ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6670](https://github.com/openlayers/openlayers/pull/6670) - fix(package): update browserify to version 14.3.0 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6664](https://github.com/openlayers/openlayers/pull/6664) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6659](https://github.com/openlayers/openlayers/pull/6659) - Add crossOrigin to examples using ol.style.Icon ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6658](https://github.com/openlayers/openlayers/pull/6658) - Fixes for raster source rendering ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6620](https://github.com/openlayers/openlayers/pull/6620) - Fix the parsing of flat coordinates in GML2 for 3D geometies ([@Jenselme](https://github.com/Jenselme))
|
|
||||||
* [#6657](https://github.com/openlayers/openlayers/pull/6657) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6644](https://github.com/openlayers/openlayers/pull/6644) - Allow minZoom and maxZoom to be set on a view ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6636](https://github.com/openlayers/openlayers/pull/6636) - Add test for the metric unit displayed in the scaleline ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6598](https://github.com/openlayers/openlayers/pull/6598) - Add support of micrometers to scaleline ([@hajjimurad](https://github.com/hajjimurad))
|
|
||||||
* [#6643](https://github.com/openlayers/openlayers/pull/6643) - Add common transforms by default ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6567](https://github.com/openlayers/openlayers/pull/6567) - Overlay visible before updating render position ([@nagytech](https://github.com/nagytech))
|
|
||||||
* [#6634](https://github.com/openlayers/openlayers/pull/6634) - Fix custom build when openlayers is installed from yarn package manager ([@Toilal](https://github.com/Toilal))
|
|
||||||
* [#6639](https://github.com/openlayers/openlayers/pull/6639) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6635](https://github.com/openlayers/openlayers/pull/6635) - Add missing externs to custom builds examples ([@Toilal](https://github.com/Toilal))
|
|
||||||
* [#6631](https://github.com/openlayers/openlayers/pull/6631) - Fix request image size caclulation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6627](https://github.com/openlayers/openlayers/pull/6627) - Change css selector for user-select none ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#6626](https://github.com/openlayers/openlayers/pull/6626) - Respect cacheSize for reprojected caches ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6623](https://github.com/openlayers/openlayers/pull/6623) - Fix outerWidth and outerHeight calculation in IE ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6625](https://github.com/openlayers/openlayers/pull/6625) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6622](https://github.com/openlayers/openlayers/pull/6622) - Fix proj4 type ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#6617](https://github.com/openlayers/openlayers/pull/6617) - Use GeoServer/GWC caching when possible ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6614](https://github.com/openlayers/openlayers/pull/6614) - Filter write util method ([@adube](https://github.com/adube))
|
|
||||||
* [#6616](https://github.com/openlayers/openlayers/pull/6616) - Fix closing tag in gml tests ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6612](https://github.com/openlayers/openlayers/pull/6612) - Add support for WFS 1.0.0 to ol.format.WFS#writeTransaction ([@Jenselme](https://github.com/Jenselme))
|
|
||||||
* [#5887](https://github.com/openlayers/openlayers/pull/5887) - Interactive overview map ([@felixveysseyre](https://github.com/felixveysseyre))
|
|
||||||
* [#6610](https://github.com/openlayers/openlayers/pull/6610) - Fix event type case of MSPointerDown ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6611](https://github.com/openlayers/openlayers/pull/6611) - Update jquery to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6609](https://github.com/openlayers/openlayers/pull/6609) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6606](https://github.com/openlayers/openlayers/pull/6606) - Reset dragSegments after vertex deletion ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6523](https://github.com/openlayers/openlayers/pull/6523) - Add Gml2 serializers to support WFS-T 1.0.0 ([@Jenselme](https://github.com/Jenselme))
|
|
||||||
* [#6579](https://github.com/openlayers/openlayers/pull/6579) - Update slimerjs to v0.10.3 ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6577](https://github.com/openlayers/openlayers/pull/6577) - Adding crossOrigin to optionsFromCapabilities ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6604](https://github.com/openlayers/openlayers/pull/6604) - Fix RegularShape documentation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6603](https://github.com/openlayers/openlayers/pull/6603) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6601](https://github.com/openlayers/openlayers/pull/6601) - Update jquery to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6600](https://github.com/openlayers/openlayers/pull/6600) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6578](https://github.com/openlayers/openlayers/pull/6578) - Add ol.RenderOrderFunction typedef ([@icholy](https://github.com/icholy))
|
|
||||||
* [#6589](https://github.com/openlayers/openlayers/pull/6589) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6592](https://github.com/openlayers/openlayers/pull/6592) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6594](https://github.com/openlayers/openlayers/pull/6594) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6580](https://github.com/openlayers/openlayers/pull/6580) - Remove unused esprima package ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6570](https://github.com/openlayers/openlayers/pull/6570) - Don't use deprecated sinon.stub(obj, 'meth', fn) ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6569](https://github.com/openlayers/openlayers/pull/6569) - Return null if the layer was not found in the WMTS capabilities ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6551](https://github.com/openlayers/openlayers/pull/6551) - Use the default fill and stroke color ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6560](https://github.com/openlayers/openlayers/pull/6560) - Don’t crash if feature loader xhr response returns 500 ([@geosense](https://github.com/geosense))
|
|
||||||
* [#6559](https://github.com/openlayers/openlayers/pull/6559) - Remove unneeded type cast ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6558](https://github.com/openlayers/openlayers/pull/6558) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6553](https://github.com/openlayers/openlayers/pull/6553) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6554](https://github.com/openlayers/openlayers/pull/6554) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6549](https://github.com/openlayers/openlayers/pull/6549) - Make getAnimating and cancelAnimations @api ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#6547](https://github.com/openlayers/openlayers/pull/6547) - Clean up left-over code from animation changes ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#6540](https://github.com/openlayers/openlayers/pull/6540) - More precise ol.Geolocation#getAccuracyGeometry return type ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6539](https://github.com/openlayers/openlayers/pull/6539) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6535](https://github.com/openlayers/openlayers/pull/6535) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6529](https://github.com/openlayers/openlayers/pull/6529) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6530](https://github.com/openlayers/openlayers/pull/6530) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6515](https://github.com/openlayers/openlayers/pull/6515) - Add view methods for getting max zoom, min zoom, and any zoom for a resolution ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6520](https://github.com/openlayers/openlayers/pull/6520) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6518](https://github.com/openlayers/openlayers/pull/6518) - Fix olx.style.IconOptions.prototype.src type ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6513](https://github.com/openlayers/openlayers/pull/6513) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6512](https://github.com/openlayers/openlayers/pull/6512) - Complete animations at target values ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6511](https://github.com/openlayers/openlayers/pull/6511) - Revert accidently committed example change ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6507](https://github.com/openlayers/openlayers/pull/6507) - ol.DEBUG no longer needed in transforms/module.js ([@probins](https://github.com/probins))
|
|
||||||
* [#6505](https://github.com/openlayers/openlayers/pull/6505) - Update ol package to include Browserify config ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6504](https://github.com/openlayers/openlayers/pull/6504) - Determine if we should handle the drawing while the pointer is moving ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6499](https://github.com/openlayers/openlayers/pull/6499) - Be more tolerant when comparing vertices when modifying a circle ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6498](https://github.com/openlayers/openlayers/pull/6498) - Travis failing on master - use Node v6.1.x ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6493](https://github.com/openlayers/openlayers/pull/6493) - Vector tile cleanup ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6483](https://github.com/openlayers/openlayers/pull/6483) - Fix renderer.canvas.TileLayer to calculate correct canvas height for drawing. ([@nearmap](https://github.com/nearmap))
|
|
||||||
* [#6488](https://github.com/openlayers/openlayers/pull/6488) - Do not draw circle when pointer not moved and freehand is on ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6491](https://github.com/openlayers/openlayers/pull/6491) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# 4.1.1
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a patch release to fix several minor issues and two regressions in the [4.1.0 release](https://github.com/openlayers/openlayers/releases/tag/v4.1.0).
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* [#6711](https://github.com/openlayers/openlayers/pull/6711) - Correct path to cleancss ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6728](https://github.com/openlayers/openlayers/pull/6728) - Fix tissot examples docs ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6732](https://github.com/openlayers/openlayers/pull/6732) - Use firefox < 53 in travis ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6741](https://github.com/openlayers/openlayers/pull/6741) - Allow user selection in overlay container ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6755](https://github.com/openlayers/openlayers/pull/6755) - Add missing goog.require ([@fredj](https://github.com/fredj))
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
# 4.2.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v4.2.0 release includes features and fixes from 87 pull requests.
|
|
||||||
|
|
||||||
#### New `movestart` event on `ol.Map`
|
|
||||||
|
|
||||||
The map now has a `movestart` event, as countarpart to the already existing `moveend` event.
|
|
||||||
|
|
||||||
#### New `moveTolerance` option in `ol.Map`
|
|
||||||
|
|
||||||
Some touch devices do not play well with OpenLayers's way of detecting clicks. To overcome this, a new `moveTolerance` option was introduced, so users can override the 1 pixel threshold above which a touch-release sequence won't be considered a click any more.
|
|
||||||
|
|
||||||
#### Support for multiple layers in `ol.format.TopoJSON`
|
|
||||||
|
|
||||||
With the new `layerName` and `layers` options, applications can extract the layer as additional attribute for vector features from `ol.format.TopoJSON`. This can especially be useful for styling vector tile layers.
|
|
||||||
|
|
||||||
#### New `tileJSON` option for `ol.source.TileJSON`
|
|
||||||
|
|
||||||
Like `ol.source.TileUTFGrid`, `ol.source.TileJSON` now also has a `tileJSON` option to configue it with inline TileJSON instead of a TileJSON URL.
|
|
||||||
|
|
||||||
#### New `ol.format.filter.during` filter
|
|
||||||
|
|
||||||
Although OpenLayers has no support for WFS v2.0, we added `ol.format.filter.during` for the `During` temporal operator.
|
|
||||||
|
|
||||||
#### Improved vector tile rendering at non-native resolutions
|
|
||||||
|
|
||||||
The vector tile renderer now uses an internal tile grid for all resolutions to cache pre-rendered tiles, even if the tile source does not have tiles for the viewed resolution. This improves rendering quality and performance.
|
|
||||||
|
|
||||||
#### New `insertVertexCondition` for `ol.interaction.Modify`
|
|
||||||
|
|
||||||
Applications can now control whether a vertex will be inserted into the modified geometry. This makes it easier to modify custom geometries.
|
|
||||||
|
|
||||||
#### New `callback` option for `ol.View#fit()`
|
|
||||||
|
|
||||||
To allow applications to perform custom actions when an animation associated with `ol.View#fit()` is completed, that method now has a new `callback` option.
|
|
||||||
|
|
||||||
#### New `ol.View#getInteracting()` getter
|
|
||||||
|
|
||||||
Like `ol.View#getAnimating()` returns `true` during a view animation, `ol.View#getInteracting()` returns `true` while users are interacting with the view.
|
|
||||||
|
|
||||||
#### New `hasZ` option for `ol.format.WFS#writeTransaction()`
|
|
||||||
|
|
||||||
When the new `hasZ` option is set to `true`, 3D coordinates will be preserved and encoded when writing a WFS transaction.
|
|
||||||
|
|
||||||
#### New `wrapX` option for `ol.source.Stamen`
|
|
||||||
|
|
||||||
Like other tile sources, `ol.source.Stamen` now also has a `wrapX` option, which allows applications to turn off wrapping the world in x direction.
|
|
||||||
|
|
||||||
#### Label support for `ol.Graticule`
|
|
||||||
|
|
||||||
The `ol.Graticule` component has several new options to add and control the output of labels. To turn on labelling, configure `ol.Graticule` with `showLabels: true`. The new options to control label formatting are `lonLabelFormatter`, `latLabelFormatter`, `lonLabelPosition` and `latLabelPosition`.
|
|
||||||
|
|
||||||
#### Return values of two `ol.style.RegularShape` getters have changed
|
|
||||||
|
|
||||||
To provide a more consistent behaviour the following getters now return the same value that was given to constructor:
|
|
||||||
|
|
||||||
`ol.style.RegularShape#getPoints` does not return the double amount of points anymore if a radius2 is set.
|
|
||||||
|
|
||||||
`ol.style.RegularShape#getRadius2` will return `undefined` if no radius2 is set.
|
|
||||||
|
|
||||||
## Detailed changes
|
|
||||||
|
|
||||||
* [#6912](https://github.com/openlayers/openlayers/pull/6912) - Use class instead of style for Translate cursor ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6858](https://github.com/openlayers/openlayers/pull/6858) - Webgl vector improvements ([@GaborFarkas](https://github.com/GaborFarkas))
|
|
||||||
* [#6890](https://github.com/openlayers/openlayers/pull/6890) - Add a movestart event ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6910](https://github.com/openlayers/openlayers/pull/6910) - Avoid duplicates in Observables list ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6902](https://github.com/openlayers/openlayers/pull/6902) - Require minimum duration for kinetic animation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6904](https://github.com/openlayers/openlayers/pull/6904) - chore(package): update sinon to version 2.3.4 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6901](https://github.com/openlayers/openlayers/pull/6901) - Added release note for changed methods of ol.style.regularShape ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
|
||||||
* [#6886](https://github.com/openlayers/openlayers/pull/6886) - Make ol.source.Cluster extensible ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#6887](https://github.com/openlayers/openlayers/pull/6887) - Disable rotation for views with enableRotation: false ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6900](https://github.com/openlayers/openlayers/pull/6900) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6897](https://github.com/openlayers/openlayers/pull/6897) - ProjectionLike in proj.getPointResolution ([@probins](https://github.com/probins))
|
|
||||||
* [#6888](https://github.com/openlayers/openlayers/pull/6888) - Add note about custom functions to getPointResolution ([@probins](https://github.com/probins))
|
|
||||||
* [#6893](https://github.com/openlayers/openlayers/pull/6893) - Fix decimals options when writing features ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6759](https://github.com/openlayers/openlayers/pull/6759) - Regular shape points ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
|
||||||
* [#6892](https://github.com/openlayers/openlayers/pull/6892) - Accept a ol.ProjectionLike instead of ol.proj.Projection ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6883](https://github.com/openlayers/openlayers/pull/6883) - Remove unused ol.pointer.EventSource#getMapping function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6870](https://github.com/openlayers/openlayers/pull/6870) - Center map on proper earth, not one to the left ([@kannes](https://github.com/kannes))
|
|
||||||
* [#6872](https://github.com/openlayers/openlayers/pull/6872) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6876](https://github.com/openlayers/openlayers/pull/6876) - Only test ol.interaction.DragAndDrop if FileReader is supported ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6874](https://github.com/openlayers/openlayers/pull/6874) - Remove unused var from ol.proj ([@probins](https://github.com/probins))
|
|
||||||
* [#6875](https://github.com/openlayers/openlayers/pull/6875) - chore(package): update sinon to version 2.3.2 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6867](https://github.com/openlayers/openlayers/pull/6867) - add getArea to api ([@cs09g](https://github.com/cs09g))
|
|
||||||
* [#6863](https://github.com/openlayers/openlayers/pull/6863) - change size to optional ([@cs09g](https://github.com/cs09g))
|
|
||||||
* [#6864](https://github.com/openlayers/openlayers/pull/6864) - fix(package): update closure-util to version 1.21.0 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6834](https://github.com/openlayers/openlayers/pull/6834) - Move tolerance option ([@notnotse](https://github.com/notnotse))
|
|
||||||
* [#6856](https://github.com/openlayers/openlayers/pull/6856) - Fix creation of new URL in readSharedStyle_ and readSharedStyleMap_ ([@oterral](https://github.com/oterral))
|
|
||||||
* [#6852](https://github.com/openlayers/openlayers/pull/6852) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6851](https://github.com/openlayers/openlayers/pull/6851) - Register/unregister listeners in setActive ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6832](https://github.com/openlayers/openlayers/pull/6832) - Force state of error tiles when usInterimTilesOnError is false ([@oterral](https://github.com/oterral))
|
|
||||||
* [#6849](https://github.com/openlayers/openlayers/pull/6849) - Create URL object only when we can ([@oterral](https://github.com/oterral))
|
|
||||||
* [#6845](https://github.com/openlayers/openlayers/pull/6845) - Snap on circles ([@tchandelle](https://github.com/tchandelle))
|
|
||||||
* [#6842](https://github.com/openlayers/openlayers/pull/6842) - add condition to check if active ([@cs09g](https://github.com/cs09g))
|
|
||||||
* [#6844](https://github.com/openlayers/openlayers/pull/6844) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6841](https://github.com/openlayers/openlayers/pull/6841) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6839](https://github.com/openlayers/openlayers/pull/6839) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6838](https://github.com/openlayers/openlayers/pull/6838) - fix(package): update handlebars to version 4.0.10 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6817](https://github.com/openlayers/openlayers/pull/6817) - Multiple layers in TopoJSON vector tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6833](https://github.com/openlayers/openlayers/pull/6833) - Fix geojson-vt example for line and point geometries ([@oterral](https://github.com/oterral))
|
|
||||||
* [#6829](https://github.com/openlayers/openlayers/pull/6829) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6819](https://github.com/openlayers/openlayers/pull/6819) - Adjust/fix API for working with vector tile features ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6818](https://github.com/openlayers/openlayers/pull/6818) - Add tileJSON option to ol.source.TileJSON ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6805](https://github.com/openlayers/openlayers/pull/6805) - Display country name on click select ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6813](https://github.com/openlayers/openlayers/pull/6813) - Prepend the version with a v ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6814](https://github.com/openlayers/openlayers/pull/6814) - Re-add ol.render.Feature#getGeometry() ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6812](https://github.com/openlayers/openlayers/pull/6812) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6786](https://github.com/openlayers/openlayers/pull/6786) - Add ol.format.filter.during ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6806](https://github.com/openlayers/openlayers/pull/6806) - Add note about features with the same id ([@drnextgis](https://github.com/drnextgis))
|
|
||||||
* [#6802](https://github.com/openlayers/openlayers/pull/6802) - Remove unused setFeatures and getFormat methods ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6801](https://github.com/openlayers/openlayers/pull/6801) - Add getId method for ol.render.Feature ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6778](https://github.com/openlayers/openlayers/pull/6778) - Add a small tolerance when testing pointer event positions ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6796](https://github.com/openlayers/openlayers/pull/6796) - Re-add accidently dropped condition ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6798](https://github.com/openlayers/openlayers/pull/6798) - chore(package): update clean-css-cli to version 4.1.2 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6795](https://github.com/openlayers/openlayers/pull/6795) - Fix ol.DrawGeometryFunctionType coordinates argument type ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6797](https://github.com/openlayers/openlayers/pull/6797) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6779](https://github.com/openlayers/openlayers/pull/6779) - Decouple source and rendered tile grid of vector tile sources ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6785](https://github.com/openlayers/openlayers/pull/6785) - Add insertVertexCondition to ol.interaction.Modify options ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6792](https://github.com/openlayers/openlayers/pull/6792) - Create intermediate canvas when resolutions have changed ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6790](https://github.com/openlayers/openlayers/pull/6790) - Update resemblejs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6784](https://github.com/openlayers/openlayers/pull/6784) - chore(package): update clean-css-cli to version 4.1.0 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6556](https://github.com/openlayers/openlayers/pull/6556) - Reading kml xunits/yunits insetPixels ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
|
||||||
* [#6775](https://github.com/openlayers/openlayers/pull/6775) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6774](https://github.com/openlayers/openlayers/pull/6774) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6770](https://github.com/openlayers/openlayers/pull/6770) - Enforce the "no missing requires" rule ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6772](https://github.com/openlayers/openlayers/pull/6772) - Remove html tag from shortdesc ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6769](https://github.com/openlayers/openlayers/pull/6769) - Update handlebars to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6757](https://github.com/openlayers/openlayers/pull/6757) - Fix crashing on creation of snap-interaction, if Circle is among the features to snap to. ([@hajjimurad](https://github.com/hajjimurad))
|
|
||||||
* [#6766](https://github.com/openlayers/openlayers/pull/6766) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6765](https://github.com/openlayers/openlayers/pull/6765) - Add new callback function to view.FitOptions ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6764](https://github.com/openlayers/openlayers/pull/6764) - Added View#getInteracting() to the api ([@mblinsitu](https://github.com/mblinsitu))
|
|
||||||
* [#6760](https://github.com/openlayers/openlayers/pull/6760) - Update handlebars to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6761](https://github.com/openlayers/openlayers/pull/6761) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6755](https://github.com/openlayers/openlayers/pull/6755) - Add missing goog.require ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6751](https://github.com/openlayers/openlayers/pull/6751) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6750](https://github.com/openlayers/openlayers/pull/6750) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6741](https://github.com/openlayers/openlayers/pull/6741) - Allow user selection in overlay container ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6744](https://github.com/openlayers/openlayers/pull/6744) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6737](https://github.com/openlayers/openlayers/pull/6737) - Graticule labels ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6740](https://github.com/openlayers/openlayers/pull/6740) - Fix spelling ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6730](https://github.com/openlayers/openlayers/pull/6730) - Update metalsmith-layouts to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6732](https://github.com/openlayers/openlayers/pull/6732) - Use firefox < 53 in travis ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6677](https://github.com/openlayers/openlayers/pull/6677) - Add an option to writeTransaction to support 3D geometries ([@Jenselme](https://github.com/Jenselme))
|
|
||||||
* [#6524](https://github.com/openlayers/openlayers/pull/6524) - Don't append feature prefix twice in WFS requests ([@Jenselme](https://github.com/Jenselme))
|
|
||||||
* [#6727](https://github.com/openlayers/openlayers/pull/6727) - Add default value in doc for the hitTolerance option ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6724](https://github.com/openlayers/openlayers/pull/6724) - Add wrapX option to Stamen source ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6728](https://github.com/openlayers/openlayers/pull/6728) - Fix tissot examples docs ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6725](https://github.com/openlayers/openlayers/pull/6725) - Update dependencies to enable Greenkeeper 🌴 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6711](https://github.com/openlayers/openlayers/pull/6711) - Correct path to cleancss ([@tschaub](https://github.com/tschaub))
|
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
# 4.3.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The v4.3.0 release includes features and fixes from 92 pull requests.
|
|
||||||
|
|
||||||
#### New `map.getFeaturesAtPixel()` method
|
|
||||||
|
|
||||||
When you want to get all features at a given pixel, use the new `map.getFeaturesAtPixel()` method.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
var features = [];
|
|
||||||
map.forEachFeatureAtPixel(pixel, function(feature) {
|
|
||||||
features.push(feature);
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
var features = map.getFeaturesAtPixel(pixel);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `ol.Sphere` functions for spherical measures
|
|
||||||
|
|
||||||
The new `ol.Sphere.getArea()` and `ol.Sphere.getLength()` methods can be used to calculate spherical measures on geometries. This is the recommended over using the `geometry.getArea()` or `geometry.getLength()` methods.
|
|
||||||
|
|
||||||
Bad:
|
|
||||||
```js
|
|
||||||
geometry.getArea();
|
|
||||||
```
|
|
||||||
|
|
||||||
Good:
|
|
||||||
```js
|
|
||||||
ol.Sphere.getArea(geometry);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `ol.interaction.DragAndDrop` can be configured with a vector source
|
|
||||||
|
|
||||||
It is now possible to configure the drag and drop interaction with a vector source:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var dragAndDrop = new ol.interaction.DragAndDrop({source: source});
|
|
||||||
```
|
|
||||||
|
|
||||||
Any dropped features will replace all existing features on the source.
|
|
||||||
|
|
||||||
#### `ol.interaction.Modify` can be configured with a vector source
|
|
||||||
|
|
||||||
It is now possible to configure the modify interaction with a vector source (in addition to a feature collection):
|
|
||||||
|
|
||||||
```js
|
|
||||||
var modify = new ol.interaction.Modify({source: source});
|
|
||||||
```
|
|
||||||
|
|
||||||
With this configuration, all features on the source are eligible for modification while the interaction is active.
|
|
||||||
|
|
||||||
#### `ol.interaction.Modify` deletes with `alt` key only
|
|
||||||
|
|
||||||
To delete features with the modify interaction, press the `alt` key while clicking on an existing vertex. If you want to configure the modify interaction with a different delete condition, use the `deleteCondition` option. For example, to allow deletion on a single click with no modifier keys, configure the interaction like this:
|
|
||||||
```js
|
|
||||||
var interaction = new ol.interaction.Modify({
|
|
||||||
source: source,
|
|
||||||
deleteCondition: function(event) {
|
|
||||||
return ol.events.condition.noModifierKeys(event) && ol.events.condition.singleClick(event);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
The motivation for this change is to make the modify, draw, and snap interactions all work well together. Previously, the use of these interactions with the default configuration would make it so you couldn't reliably add new vertices (click with no modifier) and delete existing vertices (click with no modifier).
|
|
||||||
|
|
||||||
#### `ol.source.VectorTile` no longer requires a `tileGrid` option
|
|
||||||
|
|
||||||
By default, the `ol.source.VectorTile` constructor creates an XYZ tile grid (in Web Mercator) for 512 pixel tiles and assumes a max zoom level of 22. If you were creating a vector tile source with an explicit `tileGrid` option, you can now remove this.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.VectorTile({
|
|
||||||
tileGrid: ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 22}),
|
|
||||||
url: url
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.VectorTile({
|
|
||||||
url: url
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need to change the max zoom level, you can pass the source a `maxZoom` option. If you need to change the tile size, you can pass the source a `tileSize` option. If you need a completely custom tile grid, you can still pass the source a `tileGrid` option.
|
|
||||||
|
|
||||||
#### `ol.source.VectorTile` no longer has a `tilePixelRatio` option
|
|
||||||
|
|
||||||
The `tilePixelRatio` option was only used for tiles in projections with `tile-pixels` as units. For tiles read with `ol.format.MVT` and the default tile loader, or tiles with the default pixel size of 4096 pixels, no changes are necessary. For the very rare cases that do not fall under these categories, a custom `tileLoadFunction` now needs to be configured on the `ol.source.VectorTile`. In addition to calling `tile.setFeatures()` and `tile.setProjection()`, it also needs to contain code like the following:
|
|
||||||
```js
|
|
||||||
var extent = tile.getFormat() instanceof ol.format.MVT ?
|
|
||||||
tile.getLastExtent() :
|
|
||||||
[0, 0, tilePixelRatio * tileSize, tilePixelRatio * tileSize];
|
|
||||||
tile.setExtent(extent);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `ol.animate` now takes the shortest arc for rotation animation
|
|
||||||
|
|
||||||
Usually rotation animations should animate along the shortest arc. There are rare occasions where a spinning animation effect is desired. So if you previously had something like
|
|
||||||
```js
|
|
||||||
map.getView().animate({
|
|
||||||
rotation: 2 * Math.PI,
|
|
||||||
duration: 2000
|
|
||||||
});
|
|
||||||
```
|
|
||||||
we recommend to split the animation into two parts and use different easing functions. The code below results in the same effect as the snippet above did with previous versions:
|
|
||||||
```js
|
|
||||||
map.getView().animate({
|
|
||||||
rotation: Math.PI,
|
|
||||||
easing: ol.easing.easeIn
|
|
||||||
}, {
|
|
||||||
rotation: 2 * Math.PI,
|
|
||||||
easing: ol.easing.easeOut
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## Full List of Changes
|
|
||||||
|
|
||||||
* [#7117](https://github.com/openlayers/openlayers/pull/7117) - Sensible default tilegrid for vector tiles ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7116](https://github.com/openlayers/openlayers/pull/7116) - fix(package): update rollup to version 0.47.2 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7111](https://github.com/openlayers/openlayers/pull/7111) - Remove broken wrapX handling from ol.Graticule ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7107](https://github.com/openlayers/openlayers/pull/7107) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7106](https://github.com/openlayers/openlayers/pull/7106) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7105](https://github.com/openlayers/openlayers/pull/7105) - Functions for spherical calculations ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7104](https://github.com/openlayers/openlayers/pull/7104) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6807](https://github.com/openlayers/openlayers/pull/6807) - Initialize hasZ in the constructor of GML3 ([@Jenselme](https://github.com/Jenselme))
|
|
||||||
* [#7102](https://github.com/openlayers/openlayers/pull/7102) - Allow drag and drop interaction to be configured with a source ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6825](https://github.com/openlayers/openlayers/pull/6825) - Read/write Tessellate tag in KML format ([@oterral](https://github.com/oterral))
|
|
||||||
* [#7098](https://github.com/openlayers/openlayers/pull/7098) - Use fractional coordinates for CSS positioning ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7064](https://github.com/openlayers/openlayers/pull/7064) - Do not use Array.prototype.forEach when dealing with potentially large arrays ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7093](https://github.com/openlayers/openlayers/pull/7093) - Allow modify interaction to be configured with a source ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7096](https://github.com/openlayers/openlayers/pull/7096) - Add new Map#getFeaturesAtPixel method ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7094](https://github.com/openlayers/openlayers/pull/7094) - Add missing zIndex options ([@icholy](https://github.com/icholy))
|
|
||||||
* [#7087](https://github.com/openlayers/openlayers/pull/7087) - Fix scale line for EPSG:4326 maps ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7088](https://github.com/openlayers/openlayers/pull/7088) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7085](https://github.com/openlayers/openlayers/pull/7085) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7084](https://github.com/openlayers/openlayers/pull/7084) - Fix a typo in the street-labels example ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7082](https://github.com/openlayers/openlayers/pull/7082) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7079](https://github.com/openlayers/openlayers/pull/7079) - Optimize custom renderer code, examples and API ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7080](https://github.com/openlayers/openlayers/pull/7080) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7078](https://github.com/openlayers/openlayers/pull/7078) - Fix return type annotation of ol.layer.VectorTile.getSource ([@geosense](https://github.com/geosense))
|
|
||||||
* [#7073](https://github.com/openlayers/openlayers/pull/7073) - Make ol.layer.Group change handling consistent ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#7075](https://github.com/openlayers/openlayers/pull/7075) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7072](https://github.com/openlayers/openlayers/pull/7072) - Improve API docs for ol.VectorTile ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7070](https://github.com/openlayers/openlayers/pull/7070) - Get tilePixelRatio from MVT tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7069](https://github.com/openlayers/openlayers/pull/7069) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7068](https://github.com/openlayers/openlayers/pull/7068) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7066](https://github.com/openlayers/openlayers/pull/7066) - Fix ol.interaction.Extent event type and documentation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7032](https://github.com/openlayers/openlayers/pull/7032) - Fix KML Export Icon Anchor ([@raiyni](https://github.com/raiyni))
|
|
||||||
* [#7065](https://github.com/openlayers/openlayers/pull/7065) - Only use API functions in example ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7022](https://github.com/openlayers/openlayers/pull/7022) - Allow styles to configure a custom renderer ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7061](https://github.com/openlayers/openlayers/pull/7061) - Update docs and issue and pull request instructions ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7059](https://github.com/openlayers/openlayers/pull/7059) - Allow to configure Extent interaction with an extent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7060](https://github.com/openlayers/openlayers/pull/7060) - Removing invalid urn ([@wnordmann](https://github.com/wnordmann))
|
|
||||||
* [#7051](https://github.com/openlayers/openlayers/pull/7051) - Changing the EPSG3857.PROJECTION array assignment and adding urn:ogc:… ([@wnordmann](https://github.com/wnordmann))
|
|
||||||
* [#7045](https://github.com/openlayers/openlayers/pull/7045) - Respect pixelRatio when scaling images ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7023](https://github.com/openlayers/openlayers/pull/7023) - Update tile size and resolutions of vector tile examples ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7005](https://github.com/openlayers/openlayers/pull/7005) - Add spatial reference inside geometry in EsriFormat ([@Sol1du2](https://github.com/Sol1du2))
|
|
||||||
* [#7034](https://github.com/openlayers/openlayers/pull/7034) - Move non-build dependencies to devDependencies ([@probins](https://github.com/probins))
|
|
||||||
* [#7050](https://github.com/openlayers/openlayers/pull/7050) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6976](https://github.com/openlayers/openlayers/pull/6976) - Example - Earthquake Clusters - Change evt.type of interaction ([@ehanoj](https://github.com/ehanoj))
|
|
||||||
* [#7048](https://github.com/openlayers/openlayers/pull/7048) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7041](https://github.com/openlayers/openlayers/pull/7041) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7042](https://github.com/openlayers/openlayers/pull/7042) - Line dash offset ([@gkresic](https://github.com/gkresic))
|
|
||||||
* [#6980](https://github.com/openlayers/openlayers/pull/6980) - Added tileClass to TileWMS ([@ZachTRice](https://github.com/ZachTRice))
|
|
||||||
* [#7028](https://github.com/openlayers/openlayers/pull/7028) - Fix Graticule use of incorrect min/maxLon values ([@greggian](https://github.com/greggian))
|
|
||||||
* [#7021](https://github.com/openlayers/openlayers/pull/7021) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7018](https://github.com/openlayers/openlayers/pull/7018) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7015](https://github.com/openlayers/openlayers/pull/7015) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7014](https://github.com/openlayers/openlayers/pull/7014) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7013](https://github.com/openlayers/openlayers/pull/7013) - Remove ol.sphere.WGS84 and ol.sphere.NORMAL ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6981](https://github.com/openlayers/openlayers/pull/6981) - Render transparent vector layers to an intermediate canvas ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#6899](https://github.com/openlayers/openlayers/pull/6899) - Use number literal for sphere radius ([@probins](https://github.com/probins))
|
|
||||||
* [#7011](https://github.com/openlayers/openlayers/pull/7011) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7008](https://github.com/openlayers/openlayers/pull/7008) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7007](https://github.com/openlayers/openlayers/pull/7007) - fix(package): update rollup to version 0.45.0 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6996](https://github.com/openlayers/openlayers/pull/6996) - 6987: Memory leak with WMS time source with reprojection ([@ch08532](https://github.com/ch08532))
|
|
||||||
* [#7003](https://github.com/openlayers/openlayers/pull/7003) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7004](https://github.com/openlayers/openlayers/pull/7004) - Use https for bing and stamen attributions ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6998](https://github.com/openlayers/openlayers/pull/6998) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6999](https://github.com/openlayers/openlayers/pull/6999) - Make VectorTile source work with multiple layers ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6988](https://github.com/openlayers/openlayers/pull/6988) - Add missing type annotations ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6984](https://github.com/openlayers/openlayers/pull/6984) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6970](https://github.com/openlayers/openlayers/pull/6970) - Fix Bug when adding/removing layer with no cache ([@cmortazavi](https://github.com/cmortazavi))
|
|
||||||
* [#6972](https://github.com/openlayers/openlayers/pull/6972) - Handle error tiles properly ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6973](https://github.com/openlayers/openlayers/pull/6973) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6971](https://github.com/openlayers/openlayers/pull/6971) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6968](https://github.com/openlayers/openlayers/pull/6968) - Shortest arc rotation animation improvements and upgrade notes ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6966](https://github.com/openlayers/openlayers/pull/6966) - Add getResolutionForZoom method for ol.View ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6965](https://github.com/openlayers/openlayers/pull/6965) - Use shortest rotation delta for animation ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6967](https://github.com/openlayers/openlayers/pull/6967) - Add RoadOnDemand imagery set to Bing example ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6964](https://github.com/openlayers/openlayers/pull/6964) - Fix KML ExtendedData reading ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6958](https://github.com/openlayers/openlayers/pull/6958) - Remove error tiles after loading is finished ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6793](https://github.com/openlayers/openlayers/pull/6793) - Webgl text ([@GaborFarkas](https://github.com/GaborFarkas))
|
|
||||||
* [#6960](https://github.com/openlayers/openlayers/pull/6960) - Queue tiles before loading ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#6957](https://github.com/openlayers/openlayers/pull/6957) - Greenkeeper/eslint 4.1.1 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6955](https://github.com/openlayers/openlayers/pull/6955) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6916](https://github.com/openlayers/openlayers/pull/6916) - Upgrade eslint to v4.0.0 ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#6943](https://github.com/openlayers/openlayers/pull/6943) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6939](https://github.com/openlayers/openlayers/pull/6939) - Abort loading when tile is disposed ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6930](https://github.com/openlayers/openlayers/pull/6930) - Handle setActive(false) on an interaction without map ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#6936](https://github.com/openlayers/openlayers/pull/6936) - Do not stop the render loop when all wanted tiles are aborted ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6920](https://github.com/openlayers/openlayers/pull/6920) - Fix minor type strength inconsistency ([@klokantech](https://github.com/klokantech))
|
|
||||||
* [#6935](https://github.com/openlayers/openlayers/pull/6935) - Use transparent image from canvas context ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6933](https://github.com/openlayers/openlayers/pull/6933) - Improve proj.get() logic ([@probins](https://github.com/probins))
|
|
||||||
* [#6931](https://github.com/openlayers/openlayers/pull/6931) - Make sure we use the default featurePrefix ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#6928](https://github.com/openlayers/openlayers/pull/6928) - Only adjust resolution when center within projection extent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6923](https://github.com/openlayers/openlayers/pull/6923) - Load tasks/build-ext.js in strict mode ([@fredj](https://github.com/fredj))
|
|
||||||
* [#6918](https://github.com/openlayers/openlayers/pull/6918) - Remove unnecessary pixelRatio check ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6917](https://github.com/openlayers/openlayers/pull/6917) - Correct typo in graticule docs ([@probins](https://github.com/probins))
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# 4.3.1
|
|
||||||
|
|
||||||
The v4.3.1 release includes a few fixes that didn't make it into v4.3.0. No special upgrade considerations.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7122](https://github.com/openlayers/openlayers/pull/7122) - Immediately complete no-op animations ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7120](https://github.com/openlayers/openlayers/pull/7120) - Fix hit detection for overzoomed vector tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7114](https://github.com/openlayers/openlayers/pull/7114) - Immediate WebGL text renderer and other improvements ([@GaborFarkas](https://github.com/GaborFarkas))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.3.2
|
|
||||||
|
|
||||||
The v4.3.2 release includes a single fix.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7140](https://github.com/openlayers/openlayers/pull/7140) - Export ol.Sphere.getLength and ol.Sphere.getArea ([@fredj](https://github.com/fredj))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.3.3
|
|
||||||
|
|
||||||
The v4.3.3 release reverts the fractional pixel positioning of overlays.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7258](https://github.com/openlayers/openlayers/pull/7258) - Revert changes made in #7098 ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.3.4
|
|
||||||
|
|
||||||
The v4.3.4 release includes a fix for Safari on iOS 11.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7285](https://github.com/openlayers/openlayers/pull/7285) - Convert pointerId to string for object lookups ([@tschaub](https://github.com/tschaub))
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
# 4.4.0
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The 4.4.0 release includes features and fixes from 80 pull requests, including first time contributions from @EduardoNogueira, @ath0mas, @f7o, @trevorblades, @viethang, and @wb14123. There are some really nice rendering enhancements included in this release. It is now possible to render labels along lines (see [#7239](https://github.com/openlayers/openlayers/pull/7239) for more detail) and polygon labels are only rendered if they fit within the polygon ([#7292](https://github.com/openlayers/openlayers/pull/7292)). In addition, we now render tiles with an opacity transition, so tiled layers more gracefully fade in ([#7267](https://github.com/openlayers/openlayers/pull/7267)).
|
|
||||||
|
|
||||||
### Upgrade notes
|
|
||||||
|
|
||||||
#### Behavior change for polygon labels
|
|
||||||
|
|
||||||
Polygon labels are now only rendered when the label does not exceed the polygon at the label position. To get the old behavior, configure your `ol.style.Text` with `exceedLength: true`.
|
|
||||||
|
|
||||||
#### Minor change for custom `tileLoadFunction` with `ol.source.VectorTile`
|
|
||||||
|
|
||||||
It is no longer necessary to set the projection on the tile. Instead, the `readFeatures` method must be called with the tile's extent as `extent` option and the view's projection as `featureProjection`.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
tile.setLoader(function() {
|
|
||||||
var data = // ... fetch data
|
|
||||||
var format = tile.getFormat();
|
|
||||||
tile.setFeatures(format.readFeatures(data));
|
|
||||||
tile.setProjection(format.readProjection(data));
|
|
||||||
// uncomment the line below for ol.format.MVT only
|
|
||||||
//tile.setExtent(format.getLastExtent());
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
tile.setLoader(function() {
|
|
||||||
var data = // ... fetch data
|
|
||||||
var format = tile.getFormat();
|
|
||||||
tile.setFeatures(format.readFeatures(data, {
|
|
||||||
featureProjection: map.getView().getProjection(),
|
|
||||||
// uncomment the line below for ol.format.MVT only
|
|
||||||
//extent: tile.getExtent()
|
|
||||||
}));
|
|
||||||
);
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Deprecation of `ol.DeviceOrientation`
|
|
||||||
|
|
||||||
`ol.DeviceOrientation` is deprecated and will be removed in the next major version.
|
|
||||||
The device-orientation example has been updated to use the (gyronorm.js)[https://github.com/dorukeker/gyronorm.js] library.
|
|
||||||
|
|
||||||
|
|
||||||
## Detailed changes
|
|
||||||
|
|
||||||
See below for the full list of changes.
|
|
||||||
|
|
||||||
* [#7306](https://github.com/openlayers/openlayers/pull/7306) - Enable mouse wheel in freehand draw mode ([@trevorblades](https://github.com/trevorblades))
|
|
||||||
* [#7297](https://github.com/openlayers/openlayers/pull/7297) - Fix multipoint instruction set ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7267](https://github.com/openlayers/openlayers/pull/7267) - Render tiles with an opacity transition ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7292](https://github.com/openlayers/openlayers/pull/7292) - Only render polygon labels when they fit ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7289](https://github.com/openlayers/openlayers/pull/7289) - Release v4.3.4 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7287](https://github.com/openlayers/openlayers/pull/7287) - Fix vertical stroke/fill alignment for text along lines ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7285](https://github.com/openlayers/openlayers/pull/7285) - Convert pointerId to string for object lookups ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7280](https://github.com/openlayers/openlayers/pull/7280) - Updated docs for deleteCondition ([@EduardoNogueira](https://github.com/EduardoNogueira))
|
|
||||||
* [#7274](https://github.com/openlayers/openlayers/pull/7274) - Add ability to change the loader of a vector source ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#7259](https://github.com/openlayers/openlayers/pull/7259) - Add missing param doc tag for ol.format.WKT.prototype.writeFeatures ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7260](https://github.com/openlayers/openlayers/pull/7260) - Release v4.3.3 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7258](https://github.com/openlayers/openlayers/pull/7258) - Revert changes made in #7098. ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7220](https://github.com/openlayers/openlayers/pull/7220) - Mark ol.format.filter.Spatial as abstract class ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7249](https://github.com/openlayers/openlayers/pull/7249) - Script to rename files so the case matches the module name ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7252](https://github.com/openlayers/openlayers/pull/7252) - fix osmxml to read ways before the definition of nodes ([@wb14123](https://github.com/wb14123))
|
|
||||||
* [#7253](https://github.com/openlayers/openlayers/pull/7253) - Nicer wording in the issue template ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7236](https://github.com/openlayers/openlayers/pull/7236) - reusing images in ol.style.Icon#clone ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
|
||||||
* [#7246](https://github.com/openlayers/openlayers/pull/7246) - Compare measured lengths with a tolerance ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#7247](https://github.com/openlayers/openlayers/pull/7247) - Raise tolerance of rendering tests to pass on Firefox 55 (GNU/Linux) ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#7239](https://github.com/openlayers/openlayers/pull/7239) - Render text along lines ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7242](https://github.com/openlayers/openlayers/pull/7242) - Use EMPTY and LOADED state properly on ol.VectorImageTile ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7234](https://github.com/openlayers/openlayers/pull/7234) - Fix abort handling of tileload events ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7221](https://github.com/openlayers/openlayers/pull/7221) - update zoomify source to accept tileIndex placeholders and handle iip… ([@thhomas](https://github.com/thhomas))
|
|
||||||
* [#6871](https://github.com/openlayers/openlayers/pull/6871) - Correct controls position in Center example ([@ath0mas](https://github.com/ath0mas))
|
|
||||||
* [#7229](https://github.com/openlayers/openlayers/pull/7229) - Fix JSDoc paths for custom builds ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7230](https://github.com/openlayers/openlayers/pull/7230) - Remove unused context handling for ol.Image ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7225](https://github.com/openlayers/openlayers/pull/7225) - Fix hit detection for image layers ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7223](https://github.com/openlayers/openlayers/pull/7223) - Transform updates ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7219](https://github.com/openlayers/openlayers/pull/7219) - Change cartodb domain from cartodb.com to carto.com ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7210](https://github.com/openlayers/openlayers/pull/7210) - Avoid unnecessary calculations for a zoom factor of 2 ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7209](https://github.com/openlayers/openlayers/pull/7209) - Remove grid.getTileRangeForExtentAndResolution() ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7201](https://github.com/openlayers/openlayers/pull/7201) - Prerender text to images ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7208](https://github.com/openlayers/openlayers/pull/7208) - Do not calculate coverage when running tests locally ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7206](https://github.com/openlayers/openlayers/pull/7206) - Only load source tiles that intersect the source tile grid's extent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7203](https://github.com/openlayers/openlayers/pull/7203) - Enable Edge tests on SauceLabs ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7194](https://github.com/openlayers/openlayers/pull/7194) - Deprecate ol.DeviceOrientation ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7198](https://github.com/openlayers/openlayers/pull/7198) - Use geometry name in WFS updates ([@bartvde](https://github.com/bartvde))
|
|
||||||
* [#7205](https://github.com/openlayers/openlayers/pull/7205) - Release v4.3.2 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7172](https://github.com/openlayers/openlayers/pull/7172) - added clear method to vectortile source ([@f7o](https://github.com/f7o))
|
|
||||||
* [#7196](https://github.com/openlayers/openlayers/pull/7196) - renderSync() to make sure overlay is initially visible ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7193](https://github.com/openlayers/openlayers/pull/7193) - Fix KML links for documents created locally in Safari ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6977](https://github.com/openlayers/openlayers/pull/6977) - Fixed modify feature test ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
|
||||||
* [#7190](https://github.com/openlayers/openlayers/pull/7190) - Use jsts version 1.4.0 in example ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7191](https://github.com/openlayers/openlayers/pull/7191) - Fix provide/require for autogenerated shader files ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7192](https://github.com/openlayers/openlayers/pull/7192) - Fix typo ([@viethang](https://github.com/viethang))
|
|
||||||
* [#7133](https://github.com/openlayers/openlayers/pull/7133) - Issue/6991/WFS Write Dimension ([@Sol1du2](https://github.com/Sol1du2))
|
|
||||||
* [#7141](https://github.com/openlayers/openlayers/pull/7141) - Issue/6990/Wfs Read srsDimension ([@Sol1du2](https://github.com/Sol1du2))
|
|
||||||
* [#7187](https://github.com/openlayers/openlayers/pull/7187) - Simpler tile pixel handling and faster parsing for ol.format.MVT vector tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7182](https://github.com/openlayers/openlayers/pull/7182) - Avoid instanceof checks in global test extensions ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7168](https://github.com/openlayers/openlayers/pull/7168) - Exclude greenkeeper merges from changelog ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#7162](https://github.com/openlayers/openlayers/pull/7162) - Bring back coverage ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#7165](https://github.com/openlayers/openlayers/pull/7165) - More assorted test fixes ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7142](https://github.com/openlayers/openlayers/pull/7142) - Adds unit test to test the projection inside the geometry of esriJson ([@Sol1du2](https://github.com/Sol1du2))
|
|
||||||
* [#7163](https://github.com/openlayers/openlayers/pull/7163) - Remove bundling magic for Mapbox styles script ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7160](https://github.com/openlayers/openlayers/pull/7160) - Assorted test updates ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7158](https://github.com/openlayers/openlayers/pull/7158) - Retain comments when replacing nodes ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7153](https://github.com/openlayers/openlayers/pull/7153) - Scripts for in-place transforms ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7154](https://github.com/openlayers/openlayers/pull/7154) - Unused require in examples/d3.js ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7151](https://github.com/openlayers/openlayers/pull/7151) - Get rid of useless test exports ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7152](https://github.com/openlayers/openlayers/pull/7152) - Adjust the pull request template (tests, CLA, wording) ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#7150](https://github.com/openlayers/openlayers/pull/7150) - Remove problematic spies from scaleline tests ([@marcjansen](https://github.com/marcjansen))
|
|
||||||
* [#7149](https://github.com/openlayers/openlayers/pull/7149) - Remove unused requires ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7148](https://github.com/openlayers/openlayers/pull/7148) - Remove ol.ENABLE_WEBGL wrap from WebGL files ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7147](https://github.com/openlayers/openlayers/pull/7147) - Remove unnecessary import in events.test.js ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7146](https://github.com/openlayers/openlayers/pull/7146) - Avoid modifying imports ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7145](https://github.com/openlayers/openlayers/pull/7145) - Spaceless provides ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7136](https://github.com/openlayers/openlayers/pull/7136) - Use data URI instead of whole empty image ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7137](https://github.com/openlayers/openlayers/pull/7137) - Developer documentation updates ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7138](https://github.com/openlayers/openlayers/pull/7138) - Improvements to the new test setup ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7140](https://github.com/openlayers/openlayers/pull/7140) - Export ol.Sphere.getLength and ol.Sphere.getArea ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7131](https://github.com/openlayers/openlayers/pull/7131) - Print ES6 import hint on each doc page ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6953](https://github.com/openlayers/openlayers/pull/6953) - Run tests in real browsers with Karma ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7127](https://github.com/openlayers/openlayers/pull/7127) - Use static GeoJSON instead of Overpass query for faster loading ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7125](https://github.com/openlayers/openlayers/pull/7125) - Do not try to render error tiles from VectorTile source ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#6855](https://github.com/openlayers/openlayers/pull/6855) - Pluggable renderers ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7128](https://github.com/openlayers/openlayers/pull/7128) - Make view.animate() tolerate undefined views ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7124](https://github.com/openlayers/openlayers/pull/7124) - Release v4.3.1 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7122](https://github.com/openlayers/openlayers/pull/7122) - Immediately complete no-op animations ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7120](https://github.com/openlayers/openlayers/pull/7120) - Fix hit detection for overzoomed vector tiles ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7114](https://github.com/openlayers/openlayers/pull/7114) - Immediate WebGL text renderer and other improvements ([@GaborFarkas](https://github.com/GaborFarkas))
|
|
||||||
|
|
||||||
|
|
||||||
Additionally a number of updates where made to our dependencies:
|
|
||||||
* [#7307](https://github.com/openlayers/openlayers/pull/7307) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7302](https://github.com/openlayers/openlayers/pull/7302) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7298](https://github.com/openlayers/openlayers/pull/7298) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7295](https://github.com/openlayers/openlayers/pull/7295) - chore(package): update coveralls to version 3.0.0 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7291](https://github.com/openlayers/openlayers/pull/7291) - Update pbf to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7290](https://github.com/openlayers/openlayers/pull/7290) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7281](https://github.com/openlayers/openlayers/pull/7281) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7273](https://github.com/openlayers/openlayers/pull/7273) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7272](https://github.com/openlayers/openlayers/pull/7272) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7269](https://github.com/openlayers/openlayers/pull/7269) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7265](https://github.com/openlayers/openlayers/pull/7265) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7263](https://github.com/openlayers/openlayers/pull/7263) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7254](https://github.com/openlayers/openlayers/pull/7254) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7257](https://github.com/openlayers/openlayers/pull/7257) - Update jsdoc to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7251](https://github.com/openlayers/openlayers/pull/7251) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7243](https://github.com/openlayers/openlayers/pull/7243) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7240](https://github.com/openlayers/openlayers/pull/7240) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7238](https://github.com/openlayers/openlayers/pull/7238) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7212](https://github.com/openlayers/openlayers/pull/7212) - chore(package): update clean-css-cli to version 4.1.9 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7213](https://github.com/openlayers/openlayers/pull/7213) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7207](https://github.com/openlayers/openlayers/pull/7207) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7188](https://github.com/openlayers/openlayers/pull/7188) - fix(package): update rollup to version 0.49.1 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7166](https://github.com/openlayers/openlayers/pull/7166) - fix(package): update rollup to version 0.48.1 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7161](https://github.com/openlayers/openlayers/pull/7161) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7144](https://github.com/openlayers/openlayers/pull/7144) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7135](https://github.com/openlayers/openlayers/pull/7135) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7126](https://github.com/openlayers/openlayers/pull/7126) - Update phantomjs-prebuilt to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# 4.4.1
|
|
||||||
|
|
||||||
The v4.4.1 release includes a fix for the [`ol` package](https://www.npmjs.com/package/ol) and a fix for a tile rendering regression.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7323](https://github.com/openlayers/openlayers/pull/7323) - Only clear the canvas when needed ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7313](https://github.com/openlayers/openlayers/pull/7313) - Use lowercase module identifiers until ol@5 ([@tschaub](https://github.com/tschaub))
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# 4.4.2
|
|
||||||
|
|
||||||
The v4.4.2 release fixes a number of rendering issues in the 4.4 releases.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7327](https://github.com/openlayers/openlayers/pull/7327) - Prune the tile cache after updating a source's URL ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7341](https://github.com/openlayers/openlayers/pull/7341) - Proper rendering of raster sources when there is a tile transition ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7339](https://github.com/openlayers/openlayers/pull/7339) - Use correct text stroke on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7345](https://github.com/openlayers/openlayers/pull/7345) - Handle different lineWidth scaling in Safari ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7346](https://github.com/openlayers/openlayers/pull/7346) - Pre-render text images for configured scale ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7350](https://github.com/openlayers/openlayers/pull/7350) - Calculate correct text box size ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
# 4.5.0
|
|
||||||
|
|
||||||
### Summary
|
|
||||||
|
|
||||||
The 4.5 release includes enhancements and fixes from 50 or so pull requests. Headlining this release, vector layers got a new `declutter` option that can be used to avoid overlapping labels. See the [street labels example](http://openlayers.org/en/latest/examples/street-labels.html) for a demonstration of this feature.
|
|
||||||
|
|
||||||
Please note that if you are using `closure-util` to build your OpenLayers based application, it is time to migrate to using the [`ol` package](https://www.npmjs.com/package/ol) and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the [3.19 release](https://github.com/openlayers/openlayers/releases/tag/v3.19.0); and with the 5.0 release we will be moving completely away from `goog.require` and `goog.provide`, dropping support for `closure-util`, and going with ES modules for our sources.
|
|
||||||
|
|
||||||
We will be adding details to the wiki about upcoming changes in 5.0 and tips on how to upgrade. We'll likely have a few more 4.x releases before the 5.0 release. But if you're interested in continuing to get feature enhancements in future releases, migrating to the `ol` package now will make the transition easier.
|
|
||||||
|
|
||||||
### Upgrade notes
|
|
||||||
|
|
||||||
#### Removed GeoJSON crs workaround for GeoServer
|
|
||||||
|
|
||||||
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed.
|
|
||||||
|
|
||||||
#### Deprecation of `ol.Attribution`
|
|
||||||
|
|
||||||
`ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.XYZ({
|
|
||||||
attributions: [
|
|
||||||
new ol.Attribution({html: 'some attribution'})
|
|
||||||
]
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
After:
|
|
||||||
```js
|
|
||||||
var source = new ol.source.XYZ({
|
|
||||||
attributions: 'some attribution'
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
In addition to passing a string or an array of strings for the `attributions` option, you can also pass a function that will get called with the current frame state.
|
|
||||||
```js
|
|
||||||
var source = new ol.source.XYZ({
|
|
||||||
attributions: function(frameState) {
|
|
||||||
// inspect the frame state and return attributions
|
|
||||||
return 'some attribution'; // or ['multiple', 'attributions'] or null
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## Detailed changes
|
|
||||||
|
|
||||||
See below for the full list of changes.
|
|
||||||
|
|
||||||
* [#7456](https://github.com/openlayers/openlayers/pull/7456) - Retry if sauce connect fails ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7440](https://github.com/openlayers/openlayers/pull/7440) - Attempt to make font loading tests more stable ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7444](https://github.com/openlayers/openlayers/pull/7444) - Simpler style management ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7438](https://github.com/openlayers/openlayers/pull/7438) - Call getProjection() only once ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7430](https://github.com/openlayers/openlayers/pull/7430) - Add support for hex colors with alpha ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7431](https://github.com/openlayers/openlayers/pull/7431) - Avoid returning undefined zoom ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7436](https://github.com/openlayers/openlayers/pull/7436) - Always use source projection loading image tiles ([@pjeweb](https://github.com/pjeweb))
|
|
||||||
* [#7433](https://github.com/openlayers/openlayers/pull/7433) - Don't use getHints if it's not needed ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7362](https://github.com/openlayers/openlayers/pull/7362) - Added option to the ol.format.GeoJSON to allow the reading of the geometry_name from the geojson ([@Alexandre27](https://github.com/Alexandre27))
|
|
||||||
* [#7426](https://github.com/openlayers/openlayers/pull/7426) - Update InteractionOptions.prototype.handleEvent docs ([@glen-nu](https://github.com/glen-nu))
|
|
||||||
* [#7423](https://github.com/openlayers/openlayers/pull/7423) - Get rendered features by coordinate when wrapping ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7421](https://github.com/openlayers/openlayers/pull/7421) - Keep longitude between -180 and 180 ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7420](https://github.com/openlayers/openlayers/pull/7420) - Fix MapGuide example resolves #7325 ([@TDesjardins](https://github.com/TDesjardins))
|
|
||||||
* [#7340](https://github.com/openlayers/openlayers/pull/7340) - Clear label cache when fonts become available ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7414](https://github.com/openlayers/openlayers/pull/7414) - Only split text at line angle changes ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7411](https://github.com/openlayers/openlayers/pull/7411) - Add getLayers and setLayers functions to ol.format.WMSGetFeatureInfo ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7328](https://github.com/openlayers/openlayers/pull/7328) - Declutter text and images ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7406](https://github.com/openlayers/openlayers/pull/7406) - Add option to Zoomify source for setting custom extent ([@lasselaakkonen](https://github.com/lasselaakkonen))
|
|
||||||
* [#7410](https://github.com/openlayers/openlayers/pull/7410) - Add getFeatureType and setFeatureType functions to ol.format.WFS ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7379](https://github.com/openlayers/openlayers/pull/7379) - Add support for custom tile size to Zoomify source ([@lasselaakkonen](https://github.com/lasselaakkonen))
|
|
||||||
* [#7376](https://github.com/openlayers/openlayers/pull/7376) - changed visibility of overlay properties to protected ([@virtualcitySYSTEMS](https://github.com/virtualcitySYSTEMS))
|
|
||||||
* [#7377](https://github.com/openlayers/openlayers/pull/7377) - Add support to specify CSS class name when creating ol.Overlay ([@notnotse](https://github.com/notnotse))
|
|
||||||
* [#7383](https://github.com/openlayers/openlayers/pull/7383) - Handle null tile coordinates correctly ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7375](https://github.com/openlayers/openlayers/pull/7375) - Read 'Abstract', 'AccessConstraints' and 'Fees' in ol.format.OWS ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7378](https://github.com/openlayers/openlayers/pull/7378) - Fix incorrect docs about ol.source.Raster ([@notnotse](https://github.com/notnotse))
|
|
||||||
* [#7371](https://github.com/openlayers/openlayers/pull/7371) - Add @api annotation to ol.VectorTile.getExtent ([@notnotse](https://github.com/notnotse))
|
|
||||||
* [#7369](https://github.com/openlayers/openlayers/pull/7369) - Always request the Bing API with the 'culture' value ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7364](https://github.com/openlayers/openlayers/pull/7364) - Remove GeoJSON workaround for GeoServer ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7355](https://github.com/openlayers/openlayers/pull/7355) - Pass pixel tolerance as a parameter to constructor of ol.interaction.Extent ([@marcosox](https://github.com/marcosox))
|
|
||||||
* [#7356](https://github.com/openlayers/openlayers/pull/7356) - Fix documentation for target option in the controls ([@EduardoNogueira](https://github.com/EduardoNogueira))
|
|
||||||
* [#7359](https://github.com/openlayers/openlayers/pull/7359) - Rename entry to input - regarding options to rollup lib - Issue #7358 ([@akkumar](https://github.com/akkumar))
|
|
||||||
* [#7357](https://github.com/openlayers/openlayers/pull/7357) - Release v4.4.2 ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7350](https://github.com/openlayers/openlayers/pull/7350) - Calculate correct text box size ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7349](https://github.com/openlayers/openlayers/pull/7349) - Do not use tileUrlFunction for renderer tile coordinates ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7305](https://github.com/openlayers/openlayers/pull/7305) - Fix #7304: Re-calculate the resolution when the WMS source is reprojected ([@oterral](https://github.com/oterral))
|
|
||||||
* [#7346](https://github.com/openlayers/openlayers/pull/7346) - Pre-render text images for configured scale ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7345](https://github.com/openlayers/openlayers/pull/7345) - Handle different lineWidth scaling in Safari ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7344](https://github.com/openlayers/openlayers/pull/7344) - Make text height detection independent of css settings ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7341](https://github.com/openlayers/openlayers/pull/7341) - Proper rendering of raster sources when there is a tile transition ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7339](https://github.com/openlayers/openlayers/pull/7339) - Use correct text stroke on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7327](https://github.com/openlayers/openlayers/pull/7327) - Prune the tile cache after updating a source's URL ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7333](https://github.com/openlayers/openlayers/pull/7333) - Pluggable Map/Layers - function calls to handles and create ([@waxenegger](https://github.com/waxenegger))
|
|
||||||
* [#7329](https://github.com/openlayers/openlayers/pull/7329) - Reworked attribution handling ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7337](https://github.com/openlayers/openlayers/pull/7337) - Always create a new blank image to avoid CSP violations ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7330](https://github.com/openlayers/openlayers/pull/7330) - Add upgrade notes to 4.4.0 changelog ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7321](https://github.com/openlayers/openlayers/pull/7321) - Release v4.4.1 ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7323](https://github.com/openlayers/openlayers/pull/7323) - Only clear the canvas when needed ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7313](https://github.com/openlayers/openlayers/pull/7313) - Use lowercase module identifiers until ol@5 ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7316](https://github.com/openlayers/openlayers/pull/7316) - fix copy-paste error in 4.4.0 changelog ([@mprins](https://github.com/mprins))
|
|
||||||
* [#7315](https://github.com/openlayers/openlayers/pull/7315) - Add new ol.format.filter.Contains spatial operator ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7311](https://github.com/openlayers/openlayers/pull/7311) - Release v4.4.0 ([@tschaub](https://github.com/tschaub))
|
|
||||||
|
|
||||||
Additionally a number of updates where made to our dependencies:
|
|
||||||
<details>
|
|
||||||
<summary>Click to expand</summary>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7455">#7455</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7447">#7447</a> - chore(package): update rollup-plugin-commonjs to version 8.2.6 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7448">#7448</a> - chore(package): update debounce to version 1.1.0 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7451">#7451</a> - chore(package): update karma to version 1.7.1 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7446">#7446</a> - fix(package): update rollup to version 0.51.3 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7428">#7428</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7425">#7425</a> - Update async to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7418">#7418</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7416">#7416</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7417">#7417</a> - Update phantomjs-prebuilt to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7399">#7399</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7395">#7395</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7392">#7392</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7380">#7380</a> - Update rollup-plugin-cleanup to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7366">#7366</a> - Update handlebars to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7360">#7360</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7354">#7354</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7319">#7319</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
<li><a href="https://github.com/openlayers/openlayers/pull/7314">#7314</a> - Update mocha to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
|
||||||
</ul>
|
|
||||||
</details>
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
# v4.6.0
|
|
||||||
|
|
||||||
### Summary
|
|
||||||
|
|
||||||
The 4.6 release includes enhancements and fixes from 30 or so pull requests. Headlining this release, vector layers got new `textBackgroundFill`, `textBackgroundStroke` and `padding` options that can be used to render background boxes for text. `ol.source.ImageVector` is now deprecated and replaced by a more convenient way to render vectors as images: by simply setting `renderMode: 'image'` on the vector layer.
|
|
||||||
|
|
||||||
Please note that if you are using `closure-util` to build your OpenLayers based application, it is time to migrate to using the [`ol` package](https://www.npmjs.com/package/ol) and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the [3.19 release](https://github.com/openlayers/openlayers/releases/tag/v3.19.0); and with the 5.0 release we will be moving completely away from `goog.require` and `goog.provide`, dropping support for `closure-util`, and going with ES modules for our sources.
|
|
||||||
|
|
||||||
See the [wiki](https://github.com/openlayers/openlayers/wiki/OpenLayers-v5.x) about upcoming changes in 5.0 and tips on how to upgrade. We likely won't have another 4.x release before the 5.0 release. If you're interested in continuing to get feature enhancements in future releases, migrating to the `ol` package now will make the transition easier.
|
|
||||||
|
|
||||||
|
|
||||||
### Upgrade notes
|
|
||||||
|
|
||||||
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
|
|
||||||
|
|
||||||
To update your applications, simply replace `exceedLength` with `overflow`.
|
|
||||||
|
|
||||||
#### Deprecation of `ol.source.ImageVector`
|
|
||||||
|
|
||||||
Rendering vector sources as image is now directly supported by `ol.layer.Vector` with the new `renderMode: 'image'` configuration option. Change code like this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
new ol.layer.Image({
|
|
||||||
source: new ol.source.ImageVector({
|
|
||||||
style: myStyle,
|
|
||||||
source: new ol.source.Vector({
|
|
||||||
url: 'my/data.json',
|
|
||||||
format: new ol.format.GeoJSON()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
|
||||||
```
|
|
||||||
to:
|
|
||||||
|
|
||||||
```js
|
|
||||||
new ol.layer.Vector({
|
|
||||||
renderMode: 'image',
|
|
||||||
style: myStyle,
|
|
||||||
source: new ol.source.Vector({
|
|
||||||
url: 'my/data.json',
|
|
||||||
format: new ol.format.GeoJSON()
|
|
||||||
})
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Detailed changes
|
|
||||||
|
|
||||||
See below for the full list of changes.
|
|
||||||
|
|
||||||
* [#7538](https://github.com/openlayers/openlayers/pull/7538) - removeFromLoadedExtents to remove extents that failed to load ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7537](https://github.com/openlayers/openlayers/pull/7537) - Fix Draw.removeLastPoint exception when no points to remove ([@walkermatt](https://github.com/walkermatt))
|
|
||||||
* [#7461](https://github.com/openlayers/openlayers/pull/7461) - Use the matrixSet projection by default ([@oterral](https://github.com/oterral))
|
|
||||||
* [#5883](https://github.com/openlayers/openlayers/pull/5883) - Fixes setUrl() for WMTS sources (ol.source.WMTS) ([@bylexus](https://github.com/bylexus))
|
|
||||||
* [#7531](https://github.com/openlayers/openlayers/pull/7531) - Update the ol package readme ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7372](https://github.com/openlayers/openlayers/pull/7372) - Add method to set max cache size in ol.style.IconImageCache ([@notnotse](https://github.com/notnotse))
|
|
||||||
* [#7530](https://github.com/openlayers/openlayers/pull/7530) - Check forward/back 1 world if wrapping ([@raiyni](https://github.com/raiyni))
|
|
||||||
* [#7526](https://github.com/openlayers/openlayers/pull/7526) - Allow clicks to be stopped while drawing ([@tschaub](https://github.com/tschaub))
|
|
||||||
* [#7524](https://github.com/openlayers/openlayers/pull/7524) - Snap view center to pixel ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7521](https://github.com/openlayers/openlayers/pull/7521) - fix setMinZoom/setMaxZoom ([@cs09g](https://github.com/cs09g))
|
|
||||||
* [#7519](https://github.com/openlayers/openlayers/pull/7519) - Reuse declutter tree for hit detection ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7499](https://github.com/openlayers/openlayers/pull/7499) - Remove attributions from olx.FrameState instances ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7501](https://github.com/openlayers/openlayers/pull/7501) - Option to render vector layers as images ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7516](https://github.com/openlayers/openlayers/pull/7516) - Deprecate exceedLength and replace with overflow ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7510](https://github.com/openlayers/openlayers/pull/7510) - Do not fade the states layer ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7513](https://github.com/openlayers/openlayers/pull/7513) - Make strokeKey safer ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7514](https://github.com/openlayers/openlayers/pull/7514) - Prune the label cache less aggressively ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7505](https://github.com/openlayers/openlayers/pull/7505) - Remove ol.DeviceOrientation link from API index ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7497](https://github.com/openlayers/openlayers/pull/7497) - Use getGeometry ([@nicholas-l](https://github.com/nicholas-l))
|
|
||||||
* [#7495](https://github.com/openlayers/openlayers/pull/7495) - Remove layer renderers when viewport is removed ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7492](https://github.com/openlayers/openlayers/pull/7492) - Remove unneeded type cast from examples ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7489](https://github.com/openlayers/openlayers/pull/7489) - Allow string to be passed as ol.interaction.Draw type ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7445](https://github.com/openlayers/openlayers/pull/7445) - Load css rules from full-screen.css in examples ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7481](https://github.com/openlayers/openlayers/pull/7481) - Make zoom to extent control extensible ([@gberaudo](https://github.com/gberaudo))
|
|
||||||
* [#7477](https://github.com/openlayers/openlayers/pull/7477) - Make text states available for replay time ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7482](https://github.com/openlayers/openlayers/pull/7482) - Reset rotation after rendering ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7480](https://github.com/openlayers/openlayers/pull/7480) - Create a new image when loading tile after an error ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7476](https://github.com/openlayers/openlayers/pull/7476) - Reset text measurements when available fonts change ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7454](https://github.com/openlayers/openlayers/pull/7454) - Add text background rendering and text padding ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7468](https://github.com/openlayers/openlayers/pull/7468) - Add new API-key for HERE example ([@chrismayer](https://github.com/chrismayer))
|
|
||||||
* [#7465](https://github.com/openlayers/openlayers/pull/7465) - Export ol.proj.Projection#getAxisOrientation function ([@fredj](https://github.com/fredj))
|
|
||||||
* [#7462](https://github.com/openlayers/openlayers/pull/7462) - Respect metersPerUnit in ScaleLine control ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
|
|
||||||
|
|
||||||
Additionally a number of updates where made to our dependencies:
|
|
||||||
* [#7536](https://github.com/openlayers/openlayers/pull/7536) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7533](https://github.com/openlayers/openlayers/pull/7533) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7527](https://github.com/openlayers/openlayers/pull/7527) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7511](https://github.com/openlayers/openlayers/pull/7511) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7512](https://github.com/openlayers/openlayers/pull/7512) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
* [#7484](https://github.com/openlayers/openlayers/pull/7484) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# 4.6.1
|
|
||||||
|
|
||||||
The v4.6.1 release fixes a number of issues in the 4.6 releases.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7543](https://github.com/openlayers/openlayers/pull/7543) - Donut polygon labels do not get a chance to get rendered ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7542](https://github.com/openlayers/openlayers/pull/7542) - Still respect deprecated exceedLength option ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
* [#7541](https://github.com/openlayers/openlayers/pull/7541) - Fix case of vectorrendertype.js ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.6.2
|
|
||||||
|
|
||||||
The v4.6.2 release fixes a regression that could cause tremendous amounts of unneeded vector data to be fetched from the source.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7546](https://github.com/openlayers/openlayers/pull/7546) - Do not request features for wrapped extent ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.6.3
|
|
||||||
|
|
||||||
The v4.6.3 release fixes a performance issue when `renderMode: 'image'` is set on an `ol.layer.Vector`.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7554](https://github.com/openlayers/openlayers/pull/7554) - Only compose image vector frame when the replay group has changed ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.6.4
|
|
||||||
|
|
||||||
The v4.6.4 release fixes a feature selection issue when `renderMode: 'image'` is set on an `ol.layer.Vector`.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7559](https://github.com/openlayers/openlayers/pull/7559) - Handle skipping and unskipping features with renderMode: 'image' ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# 4.6.5
|
|
||||||
|
|
||||||
The v4.6.5 release fixes a hit detection issue when `declutter: true` is set on an `ol.layer.VectorTile`.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* [#7669](https://github.com/openlayers/openlayers/pull/7559) - Use declutter tree only for text and image replays ([@ahocevar](https://github.com/ahocevar))
|
|
||||||
@@ -59,16 +59,14 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div id="source-controls">
|
<div id="source-controls">
|
||||||
<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="codepen-button"><i class="fa fa-codepen"></i> Edit</a>
|
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
||||||
</div>
|
</div>
|
||||||
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
|
<form method="POST" id="jsfiddle-form" target="_blank" action="https://jsfiddle.net/api/post/library/pure/">
|
||||||
<textarea class="hidden" name="title">{{ title }}</textarea>
|
|
||||||
<textarea class="hidden" name="description">{{ shortdesc }}</textarea>
|
|
||||||
<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>
|
||||||
|
<input type="hidden" name="wrap" value="l">
|
||||||
<input type="hidden" name="resources" value="https://openlayers.org/en/v{{ olVersion }}/css/ol.css,https://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
<input type="hidden" name="resources" value="https://openlayers.org/en/v{{ olVersion }}/css/ol.css,https://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
||||||
<input type="hidden" name="data">
|
|
||||||
</form>
|
</form>
|
||||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"plugins/markdown",
|
"node_modules/jsdoc/plugins/markdown",
|
||||||
"config/jsdoc/api/plugins/inheritdoc",
|
"config/jsdoc/api/plugins/inheritdoc",
|
||||||
"config/jsdoc/api/plugins/typedefs",
|
"config/jsdoc/api/plugins/typedefs",
|
||||||
"config/jsdoc/api/plugins/events",
|
"config/jsdoc/api/plugins/events",
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ Interactions for [vector features](ol.Feature.html)
|
|||||||
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
|
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
|
||||||
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#.transform) and [ol.proj.transformExtent()](ol.proj.html#.transformExtent).</p>
|
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#.transform) and [ol.proj.transformExtent()](ol.proj.html#.transformExtent).</p>
|
||||||
[ol.proj](ol.proj.html)</td>
|
[ol.proj](ol.proj.html)</td>
|
||||||
<td><p>Changes to all [ol.Objects](ol.Object.html) can be observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.Object.Event](ol.Object.Event.html) with information on the changed property and old value.</p>
|
<td><p>Changes to all [ol.Objects](ol.Object.html) can observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.Object.Event](ol.Object.Event.html) with information on the changed property and old value.</p>
|
||||||
<td>
|
<td>[ol.DeviceOrientation](ol.DeviceOrientation.html)<br>
|
||||||
[ol.Geolocation](ol.Geolocation.html)<br>
|
[ol.Geolocation](ol.Geolocation.html)<br>
|
||||||
[ol.Overlay](ol.Overlay.html)<br></td>
|
[ol.Overlay](ol.Overlay.html)<br></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ exports.handlers = {
|
|||||||
cls.observables = [];
|
cls.observables = [];
|
||||||
}
|
}
|
||||||
observable = observables[doclet.observable];
|
observable = observables[doclet.observable];
|
||||||
if (observable.type && cls.observables.indexOf(observable) == -1) {
|
if (cls.observables.indexOf(observable) == -1) {
|
||||||
cls.observables.push(observable);
|
cls.observables.push(observable);
|
||||||
}
|
}
|
||||||
if (!cls.fires) {
|
if (!cls.fires) {
|
||||||
|
|||||||
@@ -17,19 +17,6 @@
|
|||||||
<?js if (doc.variation) { ?>
|
<?js if (doc.variation) { ?>
|
||||||
<sup class="variation"><?js= doc.variation ?></sup>
|
<sup class="variation"><?js= doc.variation ?></sup>
|
||||||
<?js } ?></h2>
|
<?js } ?></h2>
|
||||||
<br>
|
|
||||||
<?js if (doc.stability || doc.kind == 'namespace') {
|
|
||||||
var ancestors = doc.ancestors.map(a => a.replace(/>\./g, '>').replace(/\.</g, '<')).join('/');
|
|
||||||
var name = doc.name.toLowerCase();
|
|
||||||
var parts = [];
|
|
||||||
if (ancestors) {
|
|
||||||
parts.push(ancestors);
|
|
||||||
}
|
|
||||||
parts.push(name);
|
|
||||||
var importPath = parts.join('/');
|
|
||||||
?>
|
|
||||||
<pre class="prettyprint source"><code>import <?js= doc.name ?> from '<?js= importPath ?>';</code></pre>
|
|
||||||
<?js } ?>
|
|
||||||
<?js if (doc.classdesc) { ?>
|
<?js if (doc.classdesc) { ?>
|
||||||
<div class="class-description"><?js= doc.classdesc ?></div>
|
<div class="class-description"><?js= doc.classdesc ?></div>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
|
|||||||
@@ -16,10 +16,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?js
|
<?js
|
||||||
var self = this;
|
var self = this;
|
||||||
var propsByName = {};
|
|
||||||
props.forEach(function(prop) {
|
props.forEach(function(prop) {
|
||||||
if (!prop || propsByName[prop.name]) { return; }
|
if (!prop) { return; }
|
||||||
propsByName[prop.name] = prop;
|
|
||||||
var setter = prop.readonly ? 'no' : 'yes';
|
var setter = prop.readonly ? 'no' : 'yes';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* an api tag) and boolean defines (with a define tag and a default value).
|
* an api tag) and boolean defines (with a define tag and a default value).
|
||||||
*/
|
*/
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ exports.publish = function(data, opts) {
|
|||||||
types: getTypes(doc.type.names)
|
types: getTypes(doc.type.names)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
var types;
|
||||||
var symbol = {
|
var symbol = {
|
||||||
name: doc.longname,
|
name: doc.longname,
|
||||||
kind: doc.kind,
|
kind: doc.kind,
|
||||||
@@ -167,15 +169,13 @@ exports.publish = function(data, opts) {
|
|||||||
return (symbol.name in augments || symbol.virtual);
|
return (symbol.name in augments || symbol.virtual);
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Promise(function(resolve, reject) {
|
process.stdout.write(
|
||||||
process.stdout.write(
|
JSON.stringify({
|
||||||
JSON.stringify({
|
symbols: symbols,
|
||||||
symbols: symbols,
|
defines: defines,
|
||||||
defines: defines,
|
typedefs: typedefs,
|
||||||
typedefs: typedefs,
|
externs: externs,
|
||||||
externs: externs,
|
base: base
|
||||||
base: base
|
}, null, 2));
|
||||||
}, null, 2));
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
26
css/ol.css
26
css/ol.css
@@ -34,32 +34,16 @@
|
|||||||
.ol-unsupported {
|
.ol-unsupported {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.ol-viewport, .ol-unselectable {
|
.ol-viewport .ol-unselectable {
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||||
}
|
}
|
||||||
.ol-selectable {
|
|
||||||
-webkit-touch-callout: default;
|
|
||||||
-webkit-user-select: auto;
|
|
||||||
-moz-user-select: auto;
|
|
||||||
-ms-user-select: auto;
|
|
||||||
user-select: auto;
|
|
||||||
}
|
|
||||||
.ol-grabbing {
|
|
||||||
cursor: -webkit-grabbing;
|
|
||||||
cursor: -moz-grabbing;
|
|
||||||
cursor: grabbing;
|
|
||||||
}
|
|
||||||
.ol-grab {
|
|
||||||
cursor: move;
|
|
||||||
cursor: -webkit-grab;
|
|
||||||
cursor: -moz-grab;
|
|
||||||
cursor: grab;
|
|
||||||
}
|
|
||||||
.ol-control {
|
.ol-control {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: rgba(255,255,255,0.4);
|
background-color: rgba(255,255,255,0.4);
|
||||||
@@ -255,7 +239,3 @@
|
|||||||
.ol-overviewmap-box {
|
.ol-overviewmap-box {
|
||||||
border: 2px dotted rgba(0,60,136,0.7);
|
border: 2px dotted rgba(0,60,136,0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ol-overviewmap .ol-overviewmap-box:hover {
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -220,11 +220,3 @@ The `{-y}` placeholder requires a tile grid with extent.
|
|||||||
### 57
|
### 57
|
||||||
|
|
||||||
At least 2 conditions are required.
|
At least 2 conditions are required.
|
||||||
|
|
||||||
### 58
|
|
||||||
|
|
||||||
Duplicate item added to a unique collection. For example, it may be that you tried to add the same layer to a map twice. Check for calls to `map.addLayer()` or other places where the map's layer collection is modified.
|
|
||||||
|
|
||||||
### 59
|
|
||||||
|
|
||||||
Invalid command found in the PBF. This indicates that the loaded vector tile may be corrupt.
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ layout: doc.hbs
|
|||||||
|
|
||||||
Certain questions arise more often than others when users ask for help. This
|
Certain questions arise more often than others when users ask for help. This
|
||||||
document tries to list some of the common questions that frequently get asked,
|
document tries to list some of the common questions that frequently get asked,
|
||||||
e.g. on [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers).
|
e.g. on [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers-3).
|
||||||
|
|
||||||
If you think a question (and naturally its answer) should be added here, feel
|
If you think a question (and naturally its answer) should be added here, feel
|
||||||
free to ping us or to send a pull request enhancing this document.
|
free to ping us or to send a pull request enhancing this document.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ For a more in-depth overview of OpenLayers core concepts, check out the [tutoria
|
|||||||
|
|
||||||
Make sure to also check out the [OpenLayers workshop](/workshop/).
|
Make sure to also check out the [OpenLayers workshop](/workshop/).
|
||||||
|
|
||||||
Find additional reference material in the [API docs](../apidoc) and [examples](../examples).
|
Find additional reference material in the [API docs](../apidoc).
|
||||||
|
|
||||||
# Frequently Asked Questions (FAQ)
|
# Frequently Asked Questions (FAQ)
|
||||||
|
|
||||||
@@ -19,4 +19,4 @@ We have put together a document that lists [Frequently Asked Questions (FAQ)](fa
|
|||||||
|
|
||||||
# More questions?
|
# More questions?
|
||||||
|
|
||||||
If you cannot find an answer in the documentation or the FAQ, you can search [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers). If you cannot find an answer there, ask a new question there, using the tag 'openlayers'.
|
If you cannot find an answer in the documentation or the FAQ, you can ask your question on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
|
||||||
|
|||||||
@@ -5,56 +5,57 @@ layout: doc.hbs
|
|||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
When going beyond modifying existing examples you might be looking for a way to setup your own code with dependency management together with external dependencies like OpenLayers.
|
When going beyond modifying existing examples you might be looking for a
|
||||||
|
way to setup your own code with dependency management together with external
|
||||||
|
dependencies like OpenLayers.
|
||||||
|
|
||||||
This tutorial serves as a suggested project setup using NPM and Browserify for the most basic needs. There are several other options, and in particular you might be interested in a more modern one (ES2015) [using Webpack with OpenLayers](https://gist.github.com/tschaub/79025aef325cd2837364400a105405b8).
|
This tutorial serves as a suggested project setup using NPM and Browserify
|
||||||
|
for the most basic needs. There are several other options and in particular
|
||||||
|
you might be interested in
|
||||||
|
[compiling your own code together with OpenLayers](closure.html).
|
||||||
|
|
||||||
## Initial steps
|
## Initial steps
|
||||||
|
|
||||||
Create a new empty directory for your project and navigate to it by running `mkdir new-project && cd new-project`. Initialize your project using `npm init` and answer the questions asked.
|
Create a new empty directory for your project and navigate to it by running
|
||||||
|
`mkdir new-project && cd new-project`. Initialize your project using `npm init`
|
||||||
|
and answer the questions asked.
|
||||||
|
|
||||||
Add OpenLayers as dependency to your application with `npm install --save ol`.
|
At this point you can ask NPM to add required dependencies by running
|
||||||
|
`npm install --save-dev openlayers browserify watchify uglify-js`. Watchify and
|
||||||
At this point you can ask NPM to add required development dependencies by running
|
Uglify will be used to monitor for changes and to build into a minified
|
||||||
```
|
bundle.
|
||||||
npm install --save-dev cssify browserify cssify http-server uglify-js watchify
|
|
||||||
npm install --save-dev babelify babel-plugin-transform-es2015-modules-commonjs
|
|
||||||
```
|
|
||||||
We will be using `cssify` to include the css definitions required by OpenLayers in our bundle. `watchify`, `http-server` and `uglify-js` are used to monitor for changes and to build into a minified bundle. `babelify` and `babel-plugin-transform-es2015-modules-commonjs` are used to make the `ol` package, which was created using ES2015 modules, work with CommonJS.
|
|
||||||
|
|
||||||
## Application code and index.html
|
## Application code and index.html
|
||||||
|
|
||||||
Place your application code in `index.js`. Here is a simple starting point:
|
Place your application code in `index.js`. Here is a simple starting point:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
require('ol/ol.css');
|
var ol = require('openlayers');
|
||||||
var ol_Map = require('ol/map').default;
|
|
||||||
var ol_layer_Tile = require('ol/layer/tile').default;
|
|
||||||
var ol_source_OSM = require('ol/source/osm').default;
|
|
||||||
var ol_View = require('ol/view').default;
|
|
||||||
|
|
||||||
var map = new ol_Map({
|
var map = new ol.Map({
|
||||||
target: 'map',
|
target: 'map',
|
||||||
layers: [
|
layers: [
|
||||||
new ol_layer_Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol_source_OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
view: new ol_View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 0
|
zoom: 0
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
You will also need an `ìndex.html` file that will use your bundle. Here is a simple example:
|
You will also need an `ìndex.html` file that will use your bundle. Here is a simple
|
||||||
|
example:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Using Browserify with OpenLayers</title>
|
<title>Using Browserify with OpenLayers</title>
|
||||||
|
<link rel="stylesheet" href="node_modules/openlayers/dist/ol.css" type="text/css">
|
||||||
<style>
|
<style>
|
||||||
#map {
|
#map {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
@@ -71,17 +72,18 @@ You will also need an `ìndex.html` file that will use your bundle. Here is a si
|
|||||||
|
|
||||||
## Creating a bundle
|
## Creating a bundle
|
||||||
|
|
||||||
With simple scripts you can introduce the commands `npm run build` and `npm start` to manually build your bundle and watch for changes, respectively. Add the following to the script section in `package.json`:
|
With simple scripts you can introduce the commands `npm run build` and `npm start` to
|
||||||
|
manually build your bundle and watch for changes, respectively. Add the following
|
||||||
|
to the script section in `package.json`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "watchify index.js -g cssify --outfile bundle.js & http-server",
|
"start": "watchify index.js --outfile bundle.js",
|
||||||
"build": "browserify -g cssify index.js | uglifyjs --compress --output bundle.js"
|
"build": "browserify index.js | uglifyjs --compress --output bundle.js"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Now to test your application open http://localhost:8080/ in your browser. `watchify` will update `bundle.js` whenever you change something. You simply need to reload the page in your browser to see the changes.
|
|
||||||
```
|
|
||||||
$ npm start
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that `bundle.js` will contain your application code and all dependencies used in your application. From OpenLayers, it only contains the required components.
|
Note that `bundle.js` will contain your application code and all dependencies
|
||||||
|
used in your application, in this case the official full build of OpenLayers.
|
||||||
|
If you only need parts of OpenLayers you can create
|
||||||
|
[custom builds](../../builder).
|
||||||
|
|||||||
@@ -5,15 +5,11 @@ layout: doc.hbs
|
|||||||
|
|
||||||
# Compiling Application with Closure Compiler
|
# Compiling Application with Closure Compiler
|
||||||
|
|
||||||
**Note**: When building an application with dependencies that are available as [npm](https://npmjs.com/) packages, it will probably be easier to use the [ol](https://npmjs.com/package/ol) package and follow the instructions there.
|
|
||||||
|
|
||||||
The OpenLayers code uses the Closure Library, and it is compiled with the
|
The OpenLayers code uses the Closure Library, and it is compiled with the
|
||||||
Closure Compiler. Using OpenLayers in an application does not require using
|
Closure Compiler. Using OpenLayers in an application does not require using
|
||||||
Closure. But using Closure in an OpenLayers application is possible. And this
|
Closure. But using Closure in an OpenLayers application is possible. And this
|
||||||
is what this tutorial is about.
|
is what this tutorial is about.
|
||||||
|
|
||||||
When you want to include OpenLayers as separate script without bundling with your application, follow the [Creating custom builds](./custom-builds.html) tutorial instead.
|
|
||||||
|
|
||||||
This tutorial will teach you how to set up an OpenLayers application based on
|
This tutorial will teach you how to set up an OpenLayers application based on
|
||||||
the [`closure-util`](https://github.com/openlayers/closure-util) node package,
|
the [`closure-util`](https://github.com/openlayers/closure-util) node package,
|
||||||
which provides utilities for working with Closure. Using `closure-util` is one
|
which provides utilities for working with Closure. Using `closure-util` is one
|
||||||
@@ -124,7 +120,7 @@ goog.require('ol.source.OSM');
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.PluggableMap}
|
* @type {ol.Map}
|
||||||
*/
|
*/
|
||||||
app.map = new ol.Map({
|
app.map = new ol.Map({
|
||||||
target: 'map',
|
target: 'map',
|
||||||
@@ -176,7 +172,6 @@ The minimum config file looks like this:
|
|||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
"node_modules/openlayers/src/ol/typedefs.js",
|
|
||||||
"node_modules/openlayers/externs/olx.js",
|
"node_modules/openlayers/externs/olx.js",
|
||||||
"node_modules/openlayers/externs/oli.js"
|
"node_modules/openlayers/externs/oli.js"
|
||||||
],
|
],
|
||||||
@@ -228,7 +223,6 @@ Here is a version of `config.json` with more compilation checks enabled:
|
|||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
"node_modules/openlayers/src/ol/typedefs.js",
|
|
||||||
"node_modules/openlayers/externs/olx.js",
|
"node_modules/openlayers/externs/olx.js",
|
||||||
"node_modules/openlayers/externs/oli.js"
|
"node_modules/openlayers/externs/oli.js"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -51,9 +51,7 @@ Creating a custom build requires writing a build configuration file. The format
|
|||||||
"compile": {
|
"compile": {
|
||||||
"externs": [
|
"externs": [
|
||||||
"externs/bingmaps.js",
|
"externs/bingmaps.js",
|
||||||
"externs/cartodb.js",
|
|
||||||
"externs/closure-compiler.js",
|
"externs/closure-compiler.js",
|
||||||
"externs/esrijson.js",
|
|
||||||
"externs/geojson.js",
|
"externs/geojson.js",
|
||||||
"externs/oli.js",
|
"externs/oli.js",
|
||||||
"externs/olx.js",
|
"externs/olx.js",
|
||||||
@@ -203,16 +201,9 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openl
|
|||||||
],
|
],
|
||||||
"compile": {
|
"compile": {
|
||||||
"externs": [
|
"externs": [
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/cartodb.js",
|
|
||||||
"externs/closure-compiler.js",
|
"externs/closure-compiler.js",
|
||||||
"externs/esrijson.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/olx.js",
|
"externs/olx.js",
|
||||||
"externs/oli.js",
|
"externs/oli.js"
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js"
|
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.ENABLE_WEBGL=false",
|
"ol.ENABLE_WEBGL=false",
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ The easiest way to use a custom projection is to add the [Proj4js](http://proj4j
|
|||||||
Following example shows definition of a [British National Grid](https://epsg.io/27700):
|
Following example shows definition of a [British National Grid](https://epsg.io/27700):
|
||||||
|
|
||||||
``` html
|
``` html
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
"createMapboxStreetsV6Style": false,
|
"createMapboxStreetsV6Style": false,
|
||||||
"d3": false,
|
"d3": false,
|
||||||
"geojsonvt": false,
|
"geojsonvt": false,
|
||||||
"GyroNorm": false,
|
|
||||||
"jsPDF": false,
|
"jsPDF": false,
|
||||||
"jsts": false,
|
"jsts": false,
|
||||||
"saveAs": false,
|
"saveAs": false,
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.easing');
|
|
||||||
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.OSM');
|
||||||
@@ -74,16 +73,9 @@ onClick('rotate-right', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onClick('rotate-around-rome', function() {
|
onClick('rotate-around-rome', function() {
|
||||||
// Rotation animation takes the shortest arc, so animate in two parts
|
|
||||||
var rotation = view.getRotation();
|
|
||||||
view.animate({
|
view.animate({
|
||||||
rotation: rotation + Math.PI,
|
rotation: view.getRotation() + 2 * Math.PI,
|
||||||
anchor: rome,
|
anchor: rome
|
||||||
easing: ol.easing.easeIn
|
|
||||||
}, {
|
|
||||||
rotation: rotation + 2 * Math.PI,
|
|
||||||
anchor: rome,
|
|
||||||
easing: ol.easing.easeOut
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -111,19 +103,10 @@ onClick('bounce-to-istanbul', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onClick('spin-to-rome', function() {
|
onClick('spin-to-rome', function() {
|
||||||
// Rotation animation takes the shortest arc, so animate in two parts
|
|
||||||
var center = view.getCenter();
|
|
||||||
view.animate({
|
view.animate({
|
||||||
center: [
|
|
||||||
center[0] + (rome[0] - center[0]) / 2,
|
|
||||||
center[1] + (rome[1] - center[1]) / 2
|
|
||||||
],
|
|
||||||
rotation: Math.PI,
|
|
||||||
easing: ol.easing.easeIn
|
|
||||||
}, {
|
|
||||||
center: rome,
|
center: rome,
|
||||||
rotation: 2 * Math.PI,
|
rotation: 2 * Math.PI,
|
||||||
easing: ol.easing.easeOut
|
duration: 2000
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ cloak:
|
|||||||
<select id="layer-select">
|
<select id="layer-select">
|
||||||
<option value="Aerial">Aerial</option>
|
<option value="Aerial">Aerial</option>
|
||||||
<option value="AerialWithLabels" selected>Aerial with labels</option>
|
<option value="AerialWithLabels" selected>Aerial with labels</option>
|
||||||
<option value="Road">Road (static)</option>
|
<option value="Road">Road</option>
|
||||||
<option value="RoadOnDemand">Road (dynamic)</option>
|
|
||||||
<option value="collinsBart">Collins Bart</option>
|
<option value="collinsBart">Collins Bart</option>
|
||||||
<option value="ordnanceSurvey">Ordnance Survey</option>
|
<option value="ordnanceSurvey">Ordnance Survey</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ goog.require('ol.source.BingMaps');
|
|||||||
|
|
||||||
var styles = [
|
var styles = [
|
||||||
'Road',
|
'Road',
|
||||||
'RoadOnDemand',
|
|
||||||
'Aerial',
|
'Aerial',
|
||||||
'AerialWithLabels',
|
'AerialWithLabels',
|
||||||
'collinsBart',
|
'collinsBart',
|
||||||
|
|||||||
@@ -45,29 +45,29 @@ var dragBox = new ol.interaction.DragBox({
|
|||||||
|
|
||||||
map.addInteraction(dragBox);
|
map.addInteraction(dragBox);
|
||||||
|
|
||||||
|
var infoBox = document.getElementById('info');
|
||||||
|
|
||||||
dragBox.on('boxend', function() {
|
dragBox.on('boxend', function() {
|
||||||
// features that intersect the box are added to the collection of
|
// features that intersect the box are added to the collection of
|
||||||
// selected features
|
// selected features, and their names are displayed in the "info"
|
||||||
|
// div
|
||||||
|
var info = [];
|
||||||
var extent = dragBox.getGeometry().getExtent();
|
var extent = dragBox.getGeometry().getExtent();
|
||||||
vectorSource.forEachFeatureIntersectingExtent(extent, function(feature) {
|
vectorSource.forEachFeatureIntersectingExtent(extent, function(feature) {
|
||||||
selectedFeatures.push(feature);
|
selectedFeatures.push(feature);
|
||||||
|
info.push(feature.get('name'));
|
||||||
});
|
});
|
||||||
|
if (info.length > 0) {
|
||||||
|
infoBox.innerHTML = info.join(', ');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// clear selection when drawing a new box and when clicking on the map
|
// clear selection when drawing a new box and when clicking on the map
|
||||||
dragBox.on('boxstart', function() {
|
dragBox.on('boxstart', function() {
|
||||||
selectedFeatures.clear();
|
selectedFeatures.clear();
|
||||||
|
infoBox.innerHTML = ' ';
|
||||||
});
|
});
|
||||||
|
map.on('click', function() {
|
||||||
var infoBox = document.getElementById('info');
|
selectedFeatures.clear();
|
||||||
|
infoBox.innerHTML = ' ';
|
||||||
selectedFeatures.on(['add', 'remove'], function() {
|
|
||||||
var names = selectedFeatures.getArray().map(function(feature) {
|
|
||||||
return feature.get('name');
|
|
||||||
});
|
|
||||||
if (names.length > 0) {
|
|
||||||
infoBox.innerHTML = names.join(', ');
|
|
||||||
} else {
|
|
||||||
infoBox.innerHTML = 'No countries selected';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.transform(
|
center: ol.proj.transform(
|
||||||
|
|||||||
@@ -10,11 +10,7 @@ div.ol-zoom {
|
|||||||
top: 178px;
|
top: 178px;
|
||||||
left: 158px;
|
left: 158px;
|
||||||
}
|
}
|
||||||
div.ol-rotate {
|
div.ol-attribution {
|
||||||
top: 178px;
|
|
||||||
right: 58px;
|
|
||||||
}
|
|
||||||
.map div.ol-attribution {
|
|
||||||
bottom: 30px;
|
bottom: 30px;
|
||||||
right: 50px;
|
right: 50px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: example.html
|
||||||
title: Clustered Features
|
title: Clustered Features
|
||||||
shortdesc: Example of using ol.source.Cluster.
|
shortdesc: Example of using <code>ol.source.Cluster</code>.
|
||||||
docs: >
|
docs: >
|
||||||
This example shows how to do clustering on point features.
|
This example shows how to do clustering on point features.
|
||||||
tags: "cluster, vector"
|
tags: "cluster, vector"
|
||||||
|
|||||||
@@ -97,13 +97,12 @@ function rgb2xyz(x) {
|
|||||||
|
|
||||||
function xyz2rgb(x) {
|
function xyz2rgb(x) {
|
||||||
return 255 * (x <= 0.0031308 ?
|
return 255 * (x <= 0.0031308 ?
|
||||||
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
||||||
}
|
}
|
||||||
|
|
||||||
var raster = new ol.source.Raster({
|
var raster = new ol.source.Raster({
|
||||||
sources: [new ol.source.Stamen({
|
sources: [new ol.source.Stamen({
|
||||||
layer: 'watercolor',
|
layer: 'watercolor'
|
||||||
transition: 0
|
|
||||||
})],
|
})],
|
||||||
operation: function(pixels, data) {
|
operation: function(pixels, data) {
|
||||||
var hcl = rgb2hcl(pixels[0]);
|
var hcl = rgb2hcl(pixels[0]);
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}).extend([
|
}).extend([
|
||||||
new app.RotateNorthControl()
|
new app.RotateNorthControl()
|
||||||
]),
|
]),
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ app.Drag.prototype.handleDragEvent = function(evt) {
|
|||||||
var deltaX = evt.coordinate[0] - this.coordinate_[0];
|
var deltaX = evt.coordinate[0] - this.coordinate_[0];
|
||||||
var deltaY = evt.coordinate[1] - this.coordinate_[1];
|
var deltaY = evt.coordinate[1] - this.coordinate_[1];
|
||||||
|
|
||||||
var geometry = this.feature_.getGeometry();
|
var geometry = /** @type {ol.geom.SimpleGeometry} */
|
||||||
|
(this.feature_.getGeometry());
|
||||||
geometry.translate(deltaX, deltaY);
|
geometry.translate(deltaX, deltaY);
|
||||||
|
|
||||||
this.coordinate_[0] = evt.coordinate[0];
|
this.coordinate_[0] = evt.coordinate[0];
|
||||||
@@ -141,7 +142,7 @@ var lineFeature = new ol.Feature(
|
|||||||
|
|
||||||
var polygonFeature = new ol.Feature(
|
var polygonFeature = new ol.Feature(
|
||||||
new ol.geom.Polygon([[[-3e6, -1e6], [-3e6, 1e6],
|
new ol.geom.Polygon([[[-3e6, -1e6], [-3e6, 1e6],
|
||||||
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
|
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
|
||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
|||||||
1
examples/d3.js
vendored
1
examples/d3.js
vendored
@@ -1,4 +1,5 @@
|
|||||||
// NOCOMPILE
|
// NOCOMPILE
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -4,15 +4,16 @@ title: Device Orientation
|
|||||||
shortdesc: Listen to DeviceOrientation events.
|
shortdesc: Listen to DeviceOrientation events.
|
||||||
docs: >
|
docs: >
|
||||||
This example shows how to track changes in device orientation.
|
This example shows how to track changes in device orientation.
|
||||||
[gyronorm.js](https://github.com/dorukeker/gyronorm.js) library is used to access and
|
tags: "orientation, openstreetmap"
|
||||||
normalize the events from the browser.
|
|
||||||
tags: "device, orientation, gyronorm"
|
|
||||||
resources:
|
|
||||||
- https://cdn.rawgit.com/dorukeker/gyronorm.js/v2.0.6/dist/gyronorm.complete.min.js
|
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
<label>
|
||||||
|
track changes
|
||||||
|
<input id="track" type="checkbox"/>
|
||||||
|
</label>
|
||||||
<p>
|
<p>
|
||||||
<div>α : <code id="alpha"></code></div>
|
α : <code id="alpha"></code>
|
||||||
<div>β : <code id="beta"></code></div>
|
β : <code id="beta"></code>
|
||||||
<div>γ : <code id="gamma"></code></div>
|
γ : <code id="gamma"></code>
|
||||||
|
heading : <code id="heading"></code>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
// NOCOMPILE
|
goog.require('ol.DeviceOrientation');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.math');
|
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
@@ -22,35 +21,39 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var deviceOrientation = new ol.DeviceOrientation();
|
||||||
|
|
||||||
function el(id) {
|
function el(id) {
|
||||||
return document.getElementById(id);
|
return document.getElementById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
el('track').addEventListener('change', function() {
|
||||||
var gn = new GyroNorm();
|
deviceOrientation.setTracking(this.checked);
|
||||||
|
});
|
||||||
gn.init().then(function() {
|
|
||||||
gn.start(function(event) {
|
deviceOrientation.on('change', function() {
|
||||||
var center = view.getCenter();
|
el('alpha').innerText = deviceOrientation.getAlpha() + ' [rad]';
|
||||||
var resolution = view.getResolution();
|
el('beta').innerText = deviceOrientation.getBeta() + ' [rad]';
|
||||||
var alpha = ol.math.toRadians(event.do.beta);
|
el('gamma').innerText = deviceOrientation.getGamma() + ' [rad]';
|
||||||
var beta = ol.math.toRadians(event.do.beta);
|
el('heading').innerText = deviceOrientation.getHeading() + ' [rad]';
|
||||||
var gamma = ol.math.toRadians(event.do.gamma);
|
});
|
||||||
|
|
||||||
el('alpha').innerText = alpha + ' [rad]';
|
// tilt the map
|
||||||
el('beta').innerText = beta + ' [rad]';
|
deviceOrientation.on(['change:beta', 'change:gamma'], function(event) {
|
||||||
el('gamma').innerText = gamma + ' [rad]';
|
var center = view.getCenter();
|
||||||
|
var resolution = view.getResolution();
|
||||||
center[0] -= resolution * gamma * 25;
|
var beta = event.target.getBeta() || 0;
|
||||||
center[1] += resolution * beta * 25;
|
var gamma = event.target.getGamma() || 0;
|
||||||
|
|
||||||
view.setCenter(view.constrainCenter(center));
|
center[0] -= resolution * gamma * 25;
|
||||||
});
|
center[1] += resolution * beta * 25;
|
||||||
|
|
||||||
|
view.setCenter(view.constrainCenter(center));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: example.html
|
||||||
title: Drag-and-Drop Image Vector
|
title: Drag-and-Drop Image Vector
|
||||||
shortdesc: Example of using the drag-and-drop interaction with image vector rendering.
|
shortdesc: Example of using the drag-and-drop interaction with a ol.source.ImageVector.
|
||||||
docs: >
|
docs: >
|
||||||
Example of using the drag-and-drop interaction with an `ol.layer.Vector` with `renderMode: 'image'``. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
||||||
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
|
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
|
||||||
cloak:
|
cloak:
|
||||||
As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ goog.require('ol.format.KML');
|
|||||||
goog.require('ol.format.TopoJSON');
|
goog.require('ol.format.TopoJSON');
|
||||||
goog.require('ol.interaction');
|
goog.require('ol.interaction');
|
||||||
goog.require('ol.interaction.DragAndDrop');
|
goog.require('ol.interaction.DragAndDrop');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Image');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.BingMaps');
|
goog.require('ol.source.BingMaps');
|
||||||
|
goog.require('ol.source.ImageVector');
|
||||||
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');
|
||||||
@@ -114,10 +115,11 @@ dragAndDropInteraction.on('addfeatures', function(event) {
|
|||||||
var vectorSource = new ol.source.Vector({
|
var vectorSource = new ol.source.Vector({
|
||||||
features: event.features
|
features: event.features
|
||||||
});
|
});
|
||||||
map.addLayer(new ol.layer.Vector({
|
map.addLayer(new ol.layer.Image({
|
||||||
renderMode: 'image',
|
source: new ol.source.ImageVector({
|
||||||
source: vectorSource,
|
source: vectorSource,
|
||||||
style: styleFunction
|
style: styleFunction
|
||||||
|
})
|
||||||
}));
|
}));
|
||||||
map.getView().fit(vectorSource.getExtent());
|
map.getView().fit(vectorSource.getExtent());
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.events.condition');
|
||||||
goog.require('ol.interaction.Draw');
|
goog.require('ol.interaction.Draw');
|
||||||
goog.require('ol.interaction.Modify');
|
goog.require('ol.interaction.Modify');
|
||||||
goog.require('ol.interaction.Snap');
|
|
||||||
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');
|
||||||
@@ -16,9 +17,18 @@ var raster = new ol.layer.Tile({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
});
|
});
|
||||||
|
|
||||||
var source = new ol.source.Vector();
|
var map = new ol.Map({
|
||||||
var vector = new ol.layer.Vector({
|
layers: [raster],
|
||||||
source: source,
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: [-11000000, 4600000],
|
||||||
|
zoom: 4
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var features = new ol.Collection();
|
||||||
|
var featureOverlay = new ol.layer.Vector({
|
||||||
|
source: new ol.source.Vector({features: features}),
|
||||||
style: new ol.style.Style({
|
style: new ol.style.Style({
|
||||||
fill: new ol.style.Fill({
|
fill: new ol.style.Fill({
|
||||||
color: 'rgba(255, 255, 255, 0.2)'
|
color: 'rgba(255, 255, 255, 0.2)'
|
||||||
@@ -35,40 +45,38 @@ var vector = new ol.layer.Vector({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
featureOverlay.setMap(map);
|
||||||
|
|
||||||
var map = new ol.Map({
|
var modify = new ol.interaction.Modify({
|
||||||
layers: [raster, vector],
|
features: features,
|
||||||
target: 'map',
|
// the SHIFT key must be pressed to delete vertices, so
|
||||||
view: new ol.View({
|
// that new vertices can be drawn at the same position
|
||||||
center: [-11000000, 4600000],
|
// of existing vertices
|
||||||
zoom: 4
|
deleteCondition: function(event) {
|
||||||
})
|
return ol.events.condition.shiftKeyOnly(event) &&
|
||||||
|
ol.events.condition.singleClick(event);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var modify = new ol.interaction.Modify({source: source});
|
|
||||||
map.addInteraction(modify);
|
map.addInteraction(modify);
|
||||||
|
|
||||||
var draw, snap; // global so we can remove them later
|
var draw; // global so we can remove it later
|
||||||
var typeSelect = document.getElementById('type');
|
var typeSelect = document.getElementById('type');
|
||||||
|
|
||||||
function addInteractions() {
|
function addInteraction() {
|
||||||
draw = new ol.interaction.Draw({
|
draw = new ol.interaction.Draw({
|
||||||
source: source,
|
features: features,
|
||||||
type: typeSelect.value
|
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
|
||||||
});
|
});
|
||||||
map.addInteraction(draw);
|
map.addInteraction(draw);
|
||||||
snap = new ol.interaction.Snap({source: source});
|
|
||||||
map.addInteraction(snap);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle change event.
|
* Handle change event.
|
||||||
*/
|
*/
|
||||||
typeSelect.onchange = function() {
|
typeSelect.onchange = function() {
|
||||||
map.removeInteraction(draw);
|
map.removeInteraction(draw);
|
||||||
map.removeInteraction(snap);
|
addInteraction();
|
||||||
addInteractions();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
addInteractions();
|
addInteraction();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function addInteraction() {
|
|||||||
if (value !== 'None') {
|
if (value !== 'None') {
|
||||||
draw = new ol.interaction.Draw({
|
draw = new ol.interaction.Draw({
|
||||||
source: source,
|
source: source,
|
||||||
type: typeSelect.value
|
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
|
||||||
});
|
});
|
||||||
map.addInteraction(draw);
|
map.addInteraction(draw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function addInteraction() {
|
|||||||
if (value !== 'None') {
|
if (value !== 'None') {
|
||||||
draw = new ol.interaction.Draw({
|
draw = new ol.interaction.Draw({
|
||||||
source: source,
|
source: source,
|
||||||
type: typeSelect.value,
|
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value),
|
||||||
freehand: true
|
freehand: true
|
||||||
});
|
});
|
||||||
map.addInteraction(draw);
|
map.addInteraction(draw);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function addInteraction() {
|
|||||||
}
|
}
|
||||||
draw = new ol.interaction.Draw({
|
draw = new ol.interaction.Draw({
|
||||||
source: source,
|
source: source,
|
||||||
type: value,
|
type: /** @type {ol.geom.GeometryType} */ (value),
|
||||||
geometryFunction: geometryFunction
|
geometryFunction: geometryFunction
|
||||||
});
|
});
|
||||||
map.addInteraction(draw);
|
map.addInteraction(draw);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ var map = new ol.Map({
|
|||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
interactions: ol.interaction.defaults().extend([new ol.interaction.Select({
|
interactions: ol.interaction.defaults().extend([new ol.interaction.Select({
|
||||||
condition: function(evt) {
|
condition: function(evt) {
|
||||||
return evt.type == 'pointermove' ||
|
return evt.originalEvent.type == 'mousemove' ||
|
||||||
evt.type == 'singleclick';
|
evt.type == 'singleclick';
|
||||||
},
|
},
|
||||||
style: selectStyleFunction
|
style: selectStyleFunction
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ var layers = [
|
|||||||
source: new ol.source.TileWMS({
|
source: new ol.source.TileWMS({
|
||||||
url: 'https://ahocevar.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
params: {
|
params: {
|
||||||
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
|
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
||||||
'TILED': true
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ var map = new ol.Map({
|
|||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ function stopAnimation(ended) {
|
|||||||
// if animation cancelled set the marker at the beginning
|
// if animation cancelled set the marker at the beginning
|
||||||
var coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
|
var coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
|
||||||
/** @type {ol.geom.Point} */ (geoMarker.getGeometry())
|
/** @type {ol.geom.Point} */ (geoMarker.getGeometry())
|
||||||
.setCoordinates(coord);
|
.setCoordinates(coord);
|
||||||
//remove listener
|
//remove listener
|
||||||
map.un('postcompose', moveFeature);
|
map.un('postcompose', moveFeature);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
.map:-webkit-full-screen {
|
.map:-webkit-full-screen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.map:-ms-fullscreen {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.map:fullscreen {
|
.map:fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ goog.require('ol.source.OSM');
|
|||||||
goog.require('ol.source.VectorTile');
|
goog.require('ol.source.VectorTile');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.VectorTile');
|
goog.require('ol.layer.VectorTile');
|
||||||
|
goog.require('ol.tilegrid');
|
||||||
goog.require('ol.proj.Projection');
|
goog.require('ol.proj.Projection');
|
||||||
|
|
||||||
|
|
||||||
@@ -16,30 +17,18 @@ var replacer = function(key, value) {
|
|||||||
var geometry = value.geometry;
|
var geometry = value.geometry;
|
||||||
|
|
||||||
if (rawType === 1) {
|
if (rawType === 1) {
|
||||||
type = 'MultiPoint';
|
type = geometry.length === 1 ? 'Point' : 'MultiPoint';
|
||||||
if (geometry.length == 1) {
|
|
||||||
type = 'Point';
|
|
||||||
geometry = geometry[0];
|
|
||||||
}
|
|
||||||
} else if (rawType === 2) {
|
} else if (rawType === 2) {
|
||||||
type = 'MultiLineString';
|
type = geometry.length === 1 ? 'LineString' : 'MultiLineString';
|
||||||
if (geometry.length == 1) {
|
|
||||||
type = 'LineString';
|
|
||||||
geometry = geometry[0];
|
|
||||||
}
|
|
||||||
} else if (rawType === 3) {
|
} else if (rawType === 3) {
|
||||||
type = 'Polygon';
|
type = geometry.length === 1 ? 'Polygon' : 'MultiPolygon';
|
||||||
if (geometry.length > 1) {
|
|
||||||
type = 'MultiPolygon';
|
|
||||||
geometry = [geometry];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type': 'Feature',
|
'type': 'Feature',
|
||||||
'geometry': {
|
'geometry': {
|
||||||
'type': type,
|
'type': type,
|
||||||
'coordinates': geometry
|
'coordinates': geometry.length == 1 ? geometry : [geometry]
|
||||||
},
|
},
|
||||||
'properties': value.tags
|
'properties': value.tags
|
||||||
};
|
};
|
||||||
@@ -76,16 +65,18 @@ fetch(url).then(function(response) {
|
|||||||
});
|
});
|
||||||
var vectorSource = new ol.source.VectorTile({
|
var vectorSource = new ol.source.VectorTile({
|
||||||
format: new ol.format.GeoJSON(),
|
format: new ol.format.GeoJSON(),
|
||||||
|
tileGrid: ol.tilegrid.createXYZ(),
|
||||||
|
tilePixelRatio: 16,
|
||||||
tileLoadFunction: function(tile) {
|
tileLoadFunction: function(tile) {
|
||||||
var format = tile.getFormat();
|
var format = tile.getFormat();
|
||||||
var tileCoord = tile.getTileCoord();
|
var tileCoord = tile.getTileCoord();
|
||||||
var data = tileIndex.getTile(tileCoord[0], tileCoord[1], -tileCoord[2] - 1);
|
var data = tileIndex.getTile(tileCoord[0], tileCoord[1], -tileCoord[2] - 1);
|
||||||
|
|
||||||
var features = format.readFeatures(
|
var features = format.readFeatures(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: 'FeatureCollection',
|
type: 'FeatureCollection',
|
||||||
features: data ? data.features : []
|
features: data ? data.features : []
|
||||||
}, replacer));
|
}, replacer));
|
||||||
tile.setLoader(function() {
|
tile.setLoader(function() {
|
||||||
tile.setFeatures(features);
|
tile.setFeatures(features);
|
||||||
tile.setProjection(tilePixels);
|
tile.setProjection(tilePixels);
|
||||||
|
|||||||
@@ -180,9 +180,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
@@ -46,14 +46,14 @@ var positions = new ol.geom.LineString([],
|
|||||||
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
|
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
|
||||||
|
|
||||||
// Geolocation Control
|
// Geolocation Control
|
||||||
var geolocation = new ol.Geolocation({
|
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({
|
||||||
projection: view.getProjection(),
|
projection: view.getProjection(),
|
||||||
trackingOptions: {
|
trackingOptions: {
|
||||||
maximumAge: 10000,
|
maximumAge: 10000,
|
||||||
enableHighAccuracy: true,
|
enableHighAccuracy: true,
|
||||||
timeout: 600000
|
timeout: 600000
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
|
|
||||||
var deltaMean = 500; // the geolocation sampling period mean in ms
|
var deltaMean = 500; // the geolocation sampling period mean in ms
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
@@ -83,7 +83,7 @@ positionFeature.setStyle(new ol.style.Style({
|
|||||||
geolocation.on('change:position', function() {
|
geolocation.on('change:position', function() {
|
||||||
var coordinates = geolocation.getPosition();
|
var coordinates = geolocation.getPosition();
|
||||||
positionFeature.setGeometry(coordinates ?
|
positionFeature.setGeometry(coordinates ?
|
||||||
new ol.geom.Point(coordinates) : null);
|
new ol.geom.Point(coordinates) : null);
|
||||||
});
|
});
|
||||||
|
|
||||||
new ol.layer.Vector({
|
new ol.layer.Vector({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ goog.require('ol.source.TileWMS');
|
|||||||
|
|
||||||
var wmsSource = new ol.source.TileWMS({
|
var wmsSource = new ol.source.TileWMS({
|
||||||
url: 'https://ahocevar.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
params: {'LAYERS': 'ne:ne', 'TILED': true},
|
params: {'LAYERS': 'ne:ne'},
|
||||||
serverType: 'geoserver',
|
serverType: 'geoserver',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,15 +10,12 @@ goog.require('ol.style.Stroke');
|
|||||||
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.OSM()
|
||||||
wrapX: false
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
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]),
|
||||||
extent: ol.proj.get('EPSG:3857').getExtent(),
|
|
||||||
zoom: 5
|
zoom: 5
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -30,8 +27,6 @@ var graticule = new ol.Graticule({
|
|||||||
color: 'rgba(255,120,0,0.9)',
|
color: 'rgba(255,120,0,0.9)',
|
||||||
width: 2,
|
width: 2,
|
||||||
lineDash: [0.5, 4]
|
lineDash: [0.5, 4]
|
||||||
}),
|
})
|
||||||
showLabels: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
graticule.setMap(map);
|
graticule.setMap(map);
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ docs: >
|
|||||||
<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>
|
<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"
|
tags: "here, here-maps, here-tile-api"
|
||||||
cloak:
|
cloak:
|
||||||
kDm0Jq1K4Ak7Bwtn8uvk: Your HERE Maps appId from https://developer.here.com/
|
a2qhegvZZFIuJDkkqjhQ: Your HERE Maps appId from https://developer.here.com/
|
||||||
xnmvc4dKZrDfGlvQHXSvwQ: Your HERE Maps appCode from https://developer.here.com/
|
lPJ3iaFLJDhD8fIAyU582A: Your HERE Maps appCode from https://developer.here.com/
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<select id="layer-select">
|
<select id="layer-select">
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
|
|
||||||
var appId = 'kDm0Jq1K4Ak7Bwtn8uvk';
|
var appId = 'a2qhegvZZFIuJDkkqjhQ';
|
||||||
var appCode = 'xnmvc4dKZrDfGlvQHXSvwQ';
|
var appCode = 'lPJ3iaFLJDhD8fIAyU582A';
|
||||||
var hereLayers = [
|
var hereLayers = [
|
||||||
{
|
{
|
||||||
base: 'base',
|
base: 'base',
|
||||||
@@ -81,11 +81,11 @@ var map = new ol.Map({
|
|||||||
|
|
||||||
function createUrl(tpl, layerDesc) {
|
function createUrl(tpl, layerDesc) {
|
||||||
return tpl
|
return tpl
|
||||||
.replace('{base}', layerDesc.base)
|
.replace('{base}', layerDesc.base)
|
||||||
.replace('{type}', layerDesc.type)
|
.replace('{type}', layerDesc.type)
|
||||||
.replace('{scheme}', layerDesc.scheme)
|
.replace('{scheme}', layerDesc.scheme)
|
||||||
.replace('{app_id}', layerDesc.app_id)
|
.replace('{app_id}', layerDesc.app_id)
|
||||||
.replace('{app_code}', layerDesc.app_code);
|
.replace('{app_code}', layerDesc.app_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
var select = document.getElementById('layer-select');
|
var select = document.getElementById('layer-select');
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ var madrid = new ol.Feature({
|
|||||||
rome.setStyle(new ol.style.Style({
|
rome.setStyle(new ol.style.Style({
|
||||||
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
||||||
color: '#8959A8',
|
color: '#8959A8',
|
||||||
crossOrigin: 'anonymous',
|
|
||||||
src: 'data/dot.png'
|
src: 'data/dot.png'
|
||||||
}))
|
}))
|
||||||
}));
|
}));
|
||||||
@@ -34,7 +33,6 @@ rome.setStyle(new ol.style.Style({
|
|||||||
london.setStyle(new ol.style.Style({
|
london.setStyle(new ol.style.Style({
|
||||||
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
||||||
color: '#4271AE',
|
color: '#4271AE',
|
||||||
crossOrigin: 'anonymous',
|
|
||||||
src: 'data/dot.png'
|
src: 'data/dot.png'
|
||||||
}))
|
}))
|
||||||
}));
|
}));
|
||||||
@@ -42,7 +40,6 @@ london.setStyle(new ol.style.Style({
|
|||||||
madrid.setStyle(new ol.style.Style({
|
madrid.setStyle(new ol.style.Style({
|
||||||
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
||||||
color: [113, 140, 0],
|
color: [113, 140, 0],
|
||||||
crossOrigin: 'anonymous',
|
|
||||||
src: 'data/dot.png'
|
src: 'data/dot.png'
|
||||||
}))
|
}))
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ function createStyle(src, img) {
|
|||||||
return new ol.style.Style({
|
return new ol.style.Style({
|
||||||
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
||||||
anchor: [0.5, 0.96],
|
anchor: [0.5, 0.96],
|
||||||
crossOrigin: 'anonymous',
|
|
||||||
src: src,
|
src: src,
|
||||||
img: img,
|
img: img,
|
||||||
imgSize: img ? [img.width, img.height] : undefined
|
imgSize: img ? [img.width, img.height] : undefined
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ for (i = 0; i < iconCount; ++i) {
|
|||||||
rotation: info.rotation,
|
rotation: info.rotation,
|
||||||
scale: info.scale,
|
scale: info.scale,
|
||||||
size: info.size,
|
size: info.size,
|
||||||
crossOrigin: 'anonymous',
|
|
||||||
src: 'data/Butterfly.png'
|
src: 'data/Butterfly.png'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -80,7 +79,7 @@ var vector = new ol.layer.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
|
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||||
layers: [vector],
|
layers: [vector],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [703365.7089403362, 5714629.865071137],
|
center: [703365.7089403362, 5714629.865071137],
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ layout: example.html
|
|||||||
title: Image Vector Layer
|
title: Image Vector Layer
|
||||||
shortdesc: Example of an image vector layer.
|
shortdesc: Example of an image vector layer.
|
||||||
docs: >
|
docs: >
|
||||||
<p>This example uses <code>ol.layer.Vector</code> with `renderMode: 'image'`. This mode results in faster rendering during interaction and animations, at the cost of less accurate rendering.</p>
|
<p>This example uses a <code>ol.source.ImageVector</code> source. That source gets vector features from the
|
||||||
|
<code>ol.source.Vector</code> it's configured with, and draw these features to an HTML5 canvas element that
|
||||||
|
is then used as the image of an image layer.</p>
|
||||||
tags: "vector, image"
|
tags: "vector, image"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -1,37 +1,38 @@
|
|||||||
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.Image');
|
||||||
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.source.ImageVector');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
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');
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
goog.require('ol.style.Text');
|
|
||||||
|
|
||||||
|
|
||||||
var style = new ol.style.Style({
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: 'rgba(255, 255, 255, 0.6)'
|
|
||||||
}),
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: '#319FD3',
|
|
||||||
width: 1
|
|
||||||
}),
|
|
||||||
text: new ol.style.Text()
|
|
||||||
});
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Vector({
|
new ol.layer.Tile({
|
||||||
renderMode: 'image',
|
source: new ol.source.OSM()
|
||||||
source: new ol.source.Vector({
|
}),
|
||||||
url: 'data/geojson/countries.geojson',
|
new ol.layer.Image({
|
||||||
format: new ol.format.GeoJSON()
|
source: new ol.source.ImageVector({
|
||||||
}),
|
source: new ol.source.Vector({
|
||||||
style: function(feature) {
|
url: 'data/geojson/countries.geojson',
|
||||||
style.getText().setText(feature.get('name'));
|
format: new ol.format.GeoJSON()
|
||||||
return style;
|
}),
|
||||||
}
|
style: new ol.style.Style({
|
||||||
|
fill: new ol.style.Fill({
|
||||||
|
color: 'rgba(255, 255, 255, 0.6)'
|
||||||
|
}),
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: '#319FD3',
|
||||||
|
width: 1
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ docs: >
|
|||||||
with OpenLayers.
|
with OpenLayers.
|
||||||
tags: "vector, jsts, buffer"
|
tags: "vector, jsts, buffer"
|
||||||
resources:
|
resources:
|
||||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.4.0/jsts.min.js
|
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.2.0/jsts.min.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ if (!ol.has.WEBGL) {
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [osm],
|
layers: [osm],
|
||||||
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
|
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ var map = new ol.Map({
|
|||||||
layers: [osm],
|
layers: [osm],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ var map = new ol.Map({
|
|||||||
layers: [osm, bing],
|
layers: [osm, bing],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -62,5 +62,5 @@ var map = new ol.Map({
|
|||||||
|
|
||||||
map.addInteraction(new ol.interaction.Draw({
|
map.addInteraction(new ol.interaction.Draw({
|
||||||
source: source,
|
source: source,
|
||||||
type: 'LineString'
|
type: /** @type {ol.geom.GeometryType} */ ('LineString')
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ var map = new ol.Map({
|
|||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: {
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
collapsible: false
|
collapsible: false
|
||||||
}
|
})
|
||||||
}),
|
}),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ layout: example.html
|
|||||||
title: Advanced Mapbox Vector Tiles
|
title: Advanced Mapbox Vector Tiles
|
||||||
shortdesc: Example of a Mapbox vector tiles map with custom tile grid.
|
shortdesc: Example of a Mapbox vector tiles map with custom tile grid.
|
||||||
docs: >
|
docs: >
|
||||||
A vector tiles map which reuses the same source tiles for subsequent zoom levels to save bandwidth on mobile devices. **Note**: No map will be visible when the access token has expired.
|
A vector tiles map which reuses the same tiles for subsequent zoom levels to save bandwith on mobile devices. **Note**: No map will be visible when the access token has expired.
|
||||||
tags: "mapbox, vector, tiles, mobile"
|
tags: "mapbox, vector, tiles, mobile"
|
||||||
resources:
|
resources:
|
||||||
- resources/mapbox-streets-v6-style.js
|
- resources/mapbox-streets-v6-style.js
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable openlayers-internal/no-unused-requires */
|
||||||
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');
|
||||||
@@ -14,16 +15,25 @@ goog.require('ol.tilegrid.TileGrid');
|
|||||||
|
|
||||||
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||||
|
|
||||||
// Calculation of resolutions that match zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
|
// For how many zoom levels do we want to use the same vector tiles?
|
||||||
|
// 1 means "use tiles from all zoom levels". 2 means "use the same tiles for 2
|
||||||
|
// subsequent zoom levels".
|
||||||
|
var reuseZoomLevels = 2;
|
||||||
|
|
||||||
|
// Offset of loaded tiles from web mercator zoom level 0.
|
||||||
|
// 0 means "At map zoom level 0, use tiles from zoom level 0". 1 means "At map
|
||||||
|
// zoom level 0, use tiles from zoom level 1".
|
||||||
|
var zoomOffset = 1;
|
||||||
|
|
||||||
|
// Calculation of tile urls
|
||||||
var resolutions = [];
|
var resolutions = [];
|
||||||
for (var i = 0; i <= 8; ++i) {
|
for (var z = zoomOffset / reuseZoomLevels; z <= 22 / reuseZoomLevels; ++z) {
|
||||||
resolutions.push(156543.03392804097 / Math.pow(2, i * 2));
|
resolutions.push(156543.03392804097 / Math.pow(2, z * reuseZoomLevels));
|
||||||
}
|
}
|
||||||
// Calculation of tile urls for zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
|
|
||||||
function tileUrlFunction(tileCoord) {
|
function tileUrlFunction(tileCoord) {
|
||||||
return ('https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
return ('https://{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] * 2 - 1))
|
.replace('{z}', String(tileCoord[0] * reuseZoomLevels + zoomOffset))
|
||||||
.replace('{x}', String(tileCoord[1]))
|
.replace('{x}', String(tileCoord[1]))
|
||||||
.replace('{y}', String(-tileCoord[2] - 1))
|
.replace('{y}', String(-tileCoord[2] - 1))
|
||||||
.replace('{a-d}', 'abcd'.substr(
|
.replace('{a-d}', 'abcd'.substr(
|
||||||
@@ -33,6 +43,8 @@ function tileUrlFunction(tileCoord) {
|
|||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.VectorTile({
|
new ol.layer.VectorTile({
|
||||||
|
renderMode: 'vector',
|
||||||
|
preload: Infinity,
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||||
'© <a href="https://www.openstreetmap.org/copyright">' +
|
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||||
@@ -40,12 +52,12 @@ var map = new ol.Map({
|
|||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
tileGrid: new ol.tilegrid.TileGrid({
|
tileGrid: new ol.tilegrid.TileGrid({
|
||||||
extent: ol.proj.get('EPSG:3857').getExtent(),
|
extent: ol.proj.get('EPSG:3857').getExtent(),
|
||||||
resolutions: resolutions,
|
resolutions: resolutions
|
||||||
tileSize: 512
|
|
||||||
}),
|
}),
|
||||||
|
tilePixelRatio: 16,
|
||||||
tileUrlFunction: tileUrlFunction
|
tileUrlFunction: tileUrlFunction
|
||||||
}),
|
}),
|
||||||
style: createMapboxStreetsV6Style(ol.style.Style, ol.style.Fill, ol.style.Stroke, ol.style.Icon, ol.style.Text)
|
style: createMapboxStreetsV6Style()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
@@ -55,3 +67,6 @@ var map = new ol.Map({
|
|||||||
zoom: 2
|
zoom: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ol.style.Fill, ol.style.Icon, ol.style.Stroke, ol.style.Style and
|
||||||
|
// ol.style.Text are required for createMapboxStreetsV6Style()
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable openlayers-internal/no-unused-requires */
|
||||||
|
|
||||||
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');
|
||||||
@@ -8,6 +10,7 @@ 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';
|
||||||
@@ -15,16 +18,17 @@ var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
|||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.VectorTile({
|
new ol.layer.VectorTile({
|
||||||
declutter: true,
|
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||||
'© <a href="https://www.openstreetmap.org/copyright">' +
|
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||||
'OpenStreetMap contributors</a>',
|
'OpenStreetMap contributors</a>',
|
||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
|
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
||||||
|
tilePixelRatio: 16,
|
||||||
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
|
url: 'https://{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(ol.style.Style, ol.style.Fill, ol.style.Stroke, ol.style.Icon, ol.style.Text)
|
style: createMapboxStreetsV6Style()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
@@ -33,3 +37,6 @@ var map = new ol.Map({
|
|||||||
zoom: 2
|
zoom: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ol.style.Fill, ol.style.Icon, ol.style.Stroke, ol.style.Style and
|
||||||
|
// ol.style.Text are required for createMapboxStreetsV6Style()
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.layer.Image');
|
goog.require('ol.layer.Image');
|
||||||
goog.require('ol.source.ImageMapGuide');
|
goog.require('ol.source.ImageMapGuide');
|
||||||
|
|
||||||
var mdf = 'Library://Public/Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
var mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
||||||
var agentUrl =
|
var agentUrl =
|
||||||
'http://www.buoyshark.com/mapguide/mapagent/mapagent.fcgi?';
|
'http://data.mapguide.com/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous';
|
||||||
var bounds = [
|
var bounds = [
|
||||||
-87.865114442365922,
|
-87.865114442365922,
|
||||||
43.665065564837931,
|
43.665065564837931,
|
||||||
@@ -23,9 +23,7 @@ var map = new ol.Map({
|
|||||||
metersPerUnit: 111319.4908, //value returned from mapguide
|
metersPerUnit: 111319.4908, //value returned from mapguide
|
||||||
params: {
|
params: {
|
||||||
MAPDEFINITION: mdf,
|
MAPDEFINITION: mdf,
|
||||||
FORMAT: 'PNG',
|
FORMAT: 'PNG'
|
||||||
USERNAME: 'OpenLayers',
|
|
||||||
PASSWORD: 'OpenLayers'
|
|
||||||
},
|
},
|
||||||
ratio: 2
|
ratio: 2
|
||||||
})
|
})
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user