Merge pull request #9633 from fredj/rm_typecast

Mark the `layers` property as optional in OverviewMap constructor
This commit is contained in:
Frédéric Junod
2019-06-03 15:46:23 +02:00
committed by GitHub
9 changed files with 11 additions and 12 deletions

View File

@@ -51,8 +51,8 @@ class ControlledMap extends PluggableMap {
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
* @property {string|HTMLElement} [label='»'] Text label to use for the collapsed
* overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {Array<import("../layer/Layer.js").default>|import("../Collection.js").default<import("../layer/Layer.js").default>} layers
* Layers for the overview map (mandatory).
* @property {Array<import("../layer/Layer.js").default>|import("../Collection.js").default<import("../layer/Layer.js").default>} [layers]
* Layers for the overview map.
* @property {function(import("../MapEvent.js").default)} [render] Function called when the control
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {HTMLElement|string} [target] Specify a target if you want the control
@@ -76,7 +76,7 @@ class OverviewMap extends Control {
*/
constructor(opt_options) {
const options = opt_options ? opt_options : /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
super({
element: document.createElement('div'),

View File

@@ -72,8 +72,7 @@ class BaseVectorLayer extends Layer {
* @param {Options=} opt_options Options.
*/
constructor(opt_options) {
const options = opt_options ?
opt_options : /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
const baseOptions = assign({}, options);

View File

@@ -60,7 +60,7 @@ class VectorImageLayer extends BaseVectorLayer {
* @param {Options=} opt_options Options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
const baseOptions = assign({}, options);
delete baseOptions.imageRatio;

View File

@@ -56,7 +56,7 @@ class ImageArcGISRest extends ImageSource {
*/
constructor(opt_options) {
const options = opt_options || /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
super({
attributions: options.attributions,

View File

@@ -53,7 +53,7 @@ class ImageCanvasSource extends ImageSource {
*/
constructor(opt_options) {
const options = opt_options || /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
super({
attributions: options.attributions,

View File

@@ -63,7 +63,7 @@ class ImageWMS extends ImageSource {
*/
constructor(opt_options) {
const options = opt_options || /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
super({
attributions: options.attributions,

View File

@@ -64,7 +64,7 @@ class TileArcGISRest extends TileImage {
*/
constructor(opt_options) {
const options = opt_options || /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
super({
attributions: options.attributions,

View File

@@ -81,7 +81,7 @@ class TileWMS extends TileImage {
*/
constructor(opt_options) {
const options = opt_options || /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
const params = options.params || {};

View File

@@ -24,7 +24,7 @@ class CircleStyle extends RegularShape {
*/
constructor(opt_options) {
const options = opt_options || /** @type {Options} */ ({});
const options = opt_options ? opt_options : {};
super({
points: Infinity,