From 4fd56756d7aa0debd967c2ea2fd56a0dbc06d8ee Mon Sep 17 00:00:00 2001 From: ghettovoice Date: Sat, 3 Nov 2018 12:04:08 +0300 Subject: [PATCH] add vl-source-bingmaps and deprecate vl-source-bing-maps name update docs, add info about new name --- .idea/inspectionProfiles/Default.xml | 5 ++-- docs/_coverpage.md | 2 +- docs/_sidebar.md | 2 +- ...bing-maps-source.md => bingmaps-source.md} | 21 +++++++++------- docs/index.html | 1 + package-lock.json | 2 +- package.json | 2 +- src/component/bing-maps-source/index.js | 25 +++++++++++-------- src/component/bingmaps-source/index.js | 12 +++++++++ .../source.vue | 7 +----- src/index.js | 5 +++- test/app.vue | 7 ++++++ 12 files changed, 58 insertions(+), 33 deletions(-) rename docs/component/{bing-maps-source.md => bingmaps-source.md} (71%) create mode 100644 src/component/bingmaps-source/index.js rename src/component/{bing-maps-source => bingmaps-source}/source.vue (91%) diff --git a/.idea/inspectionProfiles/Default.xml b/.idea/inspectionProfiles/Default.xml index 81b0d38c..592ff251 100644 --- a/.idea/inspectionProfiles/Default.xml +++ b/.idea/inspectionProfiles/Default.xml @@ -50,7 +50,7 @@ @@ -68,7 +69,7 @@ - diff --git a/docs/_coverpage.md b/docs/_coverpage.md index b5da3f23..00cb7f72 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -2,7 +2,7 @@ -# VueLayers v0.10.18 +# VueLayers v0.10.19 > Web map [Vue](https://vuejs.org/ "Vue Homepage") components with the power of [OpenLayers](https://openlayers.org/ "OpenLayers Homepage") diff --git a/docs/_sidebar.md b/docs/_sidebar.md index be77a266..47cfbb65 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -20,7 +20,7 @@ * Source - * [vl-source-bing-maps](/docs/component/bing-maps-source.md) + * [vl-source-bingmaps](/docs/component/bingmaps-source.md) * [vl-source-image-static](/docs/component/image-static-source.md) * [vl-source-image-wms](/docs/component/image-wms-source.md) * [vl-source-osm](/docs/component/osm-source.md) diff --git a/docs/component/bing-maps-source.md b/docs/component/bingmaps-source.md similarity index 71% rename from docs/component/bing-maps-source.md rename to docs/component/bingmaps-source.md index a221f8b2..b19895a2 100644 --- a/docs/component/bing-maps-source.md +++ b/docs/component/bingmaps-source.md @@ -1,20 +1,23 @@ -# vl-source-bing-maps +# vl-source-bingmaps -> Layer source for [Bing Maps API](https://www.bing.com/maps) +> Layer source for [BingMaps API](https://www.bing.com/maps) -`vl-source-bing-maps` adds ability to display tile data from Bing Maps. To use +`vl-source-bingmaps` adds ability to display tile data from BingMaps service. To use this source you should get **API key** at https://www.bingmapsportal.com. ## Versions -`vl-source-bing-maps` is a part of **BingMapsSource** module: +`vl-source-bingmaps` is a part of **BingmapsSource** module: -- **ES6**: https://unpkg.com/vuelayers/lib/_esm/bing-maps-source/ -- **CommonJS**: https://unpkg.com/vuelayers/lib/bing-maps-source/ +- **ES6**: https://unpkg.com/vuelayers/lib/_esm/bingmaps-source/ +- **CommonJS**: https://unpkg.com/vuelayers/lib/bingmaps-source/ + +!> **NOTE** The old name `vl-source-bing-maps` is deprecated and currently is an alias to the new name `vl-source-bingmaps`. +The old name will be removed later with the next major release. ## Usage -Example of `vl-source-bing-maps` usage +Example of `vl-source-bingmaps` usage @@ -23,8 +26,8 @@ Example of `vl-source-bing-maps` usage - - + + diff --git a/docs/index.html b/docs/index.html index 7a7b0d55..3d683ef5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -125,6 +125,7 @@ alias: { '/.*/_sidebar.md': '/_sidebar.md', '/docs/(.*)': '/$1', + '/component/bing-maps-source': '/component/bingmaps-source', }, } diff --git a/package-lock.json b/package-lock.json index 96e4db79..d3327566 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vuelayers", - "version": "0.10.18", + "version": "0.10.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7c9305cf..b90cbb00 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vuelayers", "fullname": "VueLayers", - "version": "0.10.18", + "version": "0.10.19", "description": "Web map Vue components with the power of OpenLayers", "author": "Vladimir Vershinin ", "main": "lib/index.js", diff --git a/src/component/bing-maps-source/index.js b/src/component/bing-maps-source/index.js index fd37f4b6..3be62e16 100644 --- a/src/component/bing-maps-source/index.js +++ b/src/component/bing-maps-source/index.js @@ -1,18 +1,21 @@ import { pick } from '../../util/minilo' -import Source from './source.vue' +import BingmapsSource from '../bingmaps-source' + +const Source = { + ...BingmapsSource.Source, + name: 'vl-source-bing-maps', + created () { + if (process.env.NODE_ENV !== 'production') { + console.warn( + '[VueLayers] Component vl-source-bing-maps was deprecated and will be removed later. ' + + 'Please use the new vl-source-bingmaps component.' + ) + } + }, +} -/** - * @alias module:bing-maps-source - */ export default { - /** - * @alias module:bing-maps-source/source - */ Source, - /** - * @param {Vue} Vue - * @param {VueLayersOptions} [options] - */ install (Vue, options = {}) { options = pick(options, 'dataProjection') Object.assign(Source, options) diff --git a/src/component/bingmaps-source/index.js b/src/component/bingmaps-source/index.js new file mode 100644 index 00000000..59cc4e13 --- /dev/null +++ b/src/component/bingmaps-source/index.js @@ -0,0 +1,12 @@ +import { pick } from '../../util/minilo' +import Source from './source.vue' + +export default { + Source, + install (Vue, options = {}) { + options = pick(options, 'dataProjection') + Object.assign(Source, options) + + Vue.component(Source.name, Source) + }, +} diff --git a/src/component/bing-maps-source/source.vue b/src/component/bingmaps-source/source.vue similarity index 91% rename from src/component/bing-maps-source/source.vue rename to src/component/bingmaps-source/source.vue index 66f90e6c..0009d4c4 100644 --- a/src/component/bing-maps-source/source.vue +++ b/src/component/bingmaps-source/source.vue @@ -1,5 +1,4 @@