Skip to content

Commit

Permalink
Merge pull request #1 from zuck/feat-map-min-max-zoom
Browse files Browse the repository at this point in the history
Add minZoom and maxZoom props to Map
  • Loading branch information
dattn committed Feb 23, 2017
2 parents bdde062 + aa0be6a commit 0ed0ddd
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/components/Map.vue
Expand Up @@ -36,11 +36,24 @@
zoom: {
type: Number,
default: 13
},
minZoom: {
type: Number
},
maxZoom: {
type: Number
}
},
mounted () {
this.$map = Leaflet.map(this.$refs.map).setView(this.position, this.zoom)
this.$map = Leaflet.map(this.$refs.map, {
center: this.position,
zoom: this.zoom,
minZoom: this.minZoom,
maxZoom: this.maxZoom
})
// passthru events
const mapEvents = [
Expand Down Expand Up @@ -76,6 +89,14 @@
zoom (zoom) {
this.$map.setZoom(zoom)
},
minZoom (minZoom) {
this.$map.setMinZoom(minZoom)
},
maxZoom (maxZoom) {
this.$map.setMaxZoom(maxZoom)
},
position (position) {
this.$map.panTo({
Expand Down

0 comments on commit 0ed0ddd

Please sign in to comment.