Skip to content

Commit

Permalink
add vl-source-bingmaps and deprecate vl-source-bing-maps name
Browse files Browse the repository at this point in the history
update docs, add info about new name
  • Loading branch information
ghettovoice committed Nov 3, 2018
1 parent 2910994 commit 4fd5675
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 33 deletions.
5 changes: 3 additions & 2 deletions .idea/inspectionProfiles/Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<img class="logo" src="/_media/logo.svg" data-origin="_media/logo.svg" alt="VueLayers Logo" />

# VueLayers <small>v0.10.18</small>
# VueLayers <small>v0.10.19</small>

> Web map [Vue](https://vuejs.org/ "Vue Homepage") components with the power of [OpenLayers](https://openlayers.org/ "OpenLayers Homepage")
Expand Down
2 changes: 1 addition & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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

<vuep template="#usage-example"></vuep>

Expand All @@ -23,8 +26,8 @@ Example of `vl-source-bing-maps` usage
<vl-map :load-tiles-while-animating="true" :load-tiles-while-interacting="true" style="height: 400px">
<vl-view :zoom.sync="zoom" :center.sync="center" :rotation.sync="rotation"></vl-view>

<vl-layer-tile id="bing-maps">
<vl-source-bing-maps :api-key="apiKey" :imagery-set="imagerySet"></vl-source-bing-maps>
<vl-layer-tile id="bingmaps">
<vl-source-bingmaps :api-key="apiKey" :imagery-set="imagerySet"></vl-source-bingmaps>
</vl-layer-tile>
</vl-map>
</template>
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
alias: {
'/.*/_sidebar.md': '/_sidebar.md',
'/docs/(.*)': '/$1',
'/component/bing-maps-source': '/component/bingmaps-source',
},
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"main": "lib/index.js",
Expand Down
25 changes: 14 additions & 11 deletions src/component/bing-maps-source/index.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
12 changes: 12 additions & 0 deletions src/component/bingmaps-source/index.js
Original file line number Diff line number Diff line change
@@ -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)
},
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script>
/** @module bing-maps-source/source */
import BingMapsSource from 'ol/source/bingmaps'
import tileSource from '../../mixin/tile-source'
import { makeWatchers } from '../../util/vue-helpers'
Expand Down Expand Up @@ -77,12 +76,8 @@
this.recreate()
})
/**
* @vueProto
* @alias module:bing-maps-source/source
*/
export default {
name: 'vl-source-bing-maps',
name: 'vl-source-bingmaps',
mixins: [tileSource],
props,
methods,
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* @license MIT
*/
import ArcgisRestSource from './component/arcgis-rest-source'
import BingMapsSource from './component/bing-maps-source'
import BingMapsSource from './component/bing-maps-source' // todo remove in v0.11.x
import BingmapsSource from './component/bingmaps-source'
import CircleGeom from './component/circle-geom'
import CircleStyle from './component/circle-style'
import ClusterSource from './component/cluster-source'
Expand Down Expand Up @@ -66,6 +67,7 @@ function plugin (Vue, options = {}) {
// install components
Vue.use(ArcgisRestSource, options)
Vue.use(BingMapsSource, options)
Vue.use(BingmapsSource, options)
Vue.use(CircleGeom, options)
Vue.use(CircleStyle, options)
Vue.use(ClusterSource, options)
Expand Down Expand Up @@ -116,6 +118,7 @@ export {
// components
ArcgisRestSource,
BingMapsSource,
BingmapsSource,
CircleGeom,
CircleStyle,
ClusterSource,
Expand Down
7 changes: 7 additions & 0 deletions test/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
<vl-source-arcgis-rest url="https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer"></vl-source-arcgis-rest>
</vl-layer-tile>

<vl-layer-tile>
<vl-source-bing-maps api-key="qwerty" imagery-set="RoadOnDemand"></vl-source-bing-maps>
</vl-layer-tile>
<vl-layer-tile>
<vl-source-bingmaps api-key="qwerty" imagery-set="RoadOnDemand"></vl-source-bingmaps>
</vl-layer-tile>

<vl-interaction-select ident="select" @select="log('select', $event)" @unselect="log('unselect', $event)" :features.sync="selectedFeatures"/>

<vl-overlay v-if="selectedFeatures.length && selectedFeatures[0].properties && selectedFeatures[0].properties.features"
Expand Down

0 comments on commit 4fd5675

Please sign in to comment.