UNPKG

tchen-vuelayers

Version:

Web map Vue components with the power of OpenLayers

104 lines (92 loc) 2 kB
/** * VueLayers * Web map Vue components with the power of OpenLayers * * @package vuelayers * @author Vladimir Vershinin <ghettovoice@gmail.com> * @version 0.11.1 * @license MIT * @copyright (c) 2017-2019, Vladimir Vershinin <ghettovoice@gmail.com> */ import mergeDescriptors from '../util/multi-merge-descriptors'; import layer from './layer'; import stylesContainer from './styles-container'; var props = { /** * When set to `true`, feature batches will be recreated during animations. * @type {boolean} * @default false */ updateWhileAnimating: Boolean, /** * When set to `true`, feature batches will be recreated during interactions. * @type {boolean} * @default false */ updateWhileInteracting: Boolean, /** * @type {number|undefined} */ renderBuffer: { type: Number, default: 100 }, /** * @type {RenderOrderFunction|undefined} */ renderOrder: Function, /** * @type {boolean} */ declutter: Boolean }; var methods = { /** * @return {Promise<Vue<Layer>>} * @protected */ init: function init() { return layer.methods.init.call(this); }, /** * @return {void|Promise<void>} * @protected */ deinit: function deinit() { return layer.methods.deinit.call(this); }, /** * @returns {Object} * @protected */ getServices: function getServices() { return mergeDescriptors(layer.methods.getServices.call(this), stylesContainer.methods.getServices.call(this)); }, /** * @return {Vector|undefined} * @protected */ getStyleTarget: function getStyleTarget() { return this.$layer; }, /** * @return {void} * @protected */ mount: function mount() { layer.methods.mount.call(this); }, /** * @return {void} * @protected */ unmount: function unmount() { layer.methods.unmount.call(this); } }; var vectorLayer = { mixins: [layer, stylesContainer], props: props, methods: methods }; export default vectorLayer;