Skip to content

Commit

Permalink
fix(gmap-vue): fix tests and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoazh committed Aug 9, 2020
1 parent e22b276 commit b06aa81
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"scripts": {
"postinstall": "lerna bootstrap",
"start:docs": "lerna run dev",
"build": "lerna run build",
"test": "lerna run test",
"build": "lerna run build"
"lint": "lerna run lint"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
Expand Down
11 changes: 5 additions & 6 deletions packages/gmap-vue/examples/basic-place-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ <h1>Changing Default Place updates text box</h1>
<button @click="setPlaceText('Tokyo')">Set to Tokyo</button><br/>
<button @click="setPlaceText('Shanghai')">Set to Shanghai</button><br/>
<button @click="setPlaceText('Seoul')">Set to Seoul</button><br/>
<gmap-place-input :default-place="place"
@place_changed="setPlace">
</gmap-place-input>
<gmap-autocomplete placeholder="This is a placeholder text" @place_changed="setPlace">
</gmap-autocomplete>
<br/>
{{latLng.lat}},
{{latLng.lng}}
<strong>lat:</strong> {{latLng.lat}}
<strong>lng:</strong> {{latLng.lng}}
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.js"></script>
<script src="gmap-vue.js"></script>

Expand Down
16 changes: 9 additions & 7 deletions packages/gmap-vue/examples/default-place.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<body>
<div id="root">
<h1>Test</h1> "Singapore" should appear in the text box on page load. No errors in console.
<gmap-place-input default-place="Singapore" @place_changed="updatePlace">
</gmap-place-input>
{{place && place.lat}}, {{place && place.lng}},
<gmap-autocomplete placeholder="This is a placeholder text" @place_changed="setPlace">
</gmap-autocomplete>
<br/>
<strong>lat:</strong> {{place && place.lat}}
<strong>lng:</strong> {{place && place.lng}}
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.6/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.js"></script>
<script src="gmap-vue.js"></script>

Expand All @@ -27,10 +29,10 @@ <h1>Test</h1> "Singapore" should appear in the text box on page load. No errors
place: null
},
methods: {
updatePlace(what) {
setPlace(place) {
this.place = {
lat: what.geometry.location.lat(),
lng: what.geometry.location.lng()
lat: place.geometry.location.lat(),
lng: place.geometry.location.lng(),
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ export default mapElementFactory({
? google.maps.ControlPosition[this.position]
: google.maps.ControlPosition.TOP_LEFT;

options.drawingMode = null
options.drawingControl = !this.$scopedSlots.default
// TODO: should be analyzed after this PR
/* eslint-disable no-param-reassign -- needed to add options */
options.drawingMode = null;
options.drawingControl = !this.$scopedSlots.default;
options.drawingControlOptions = {
drawingModes,
position,
Expand Down
2 changes: 1 addition & 1 deletion packages/gmap-vue/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Cluster =
: ((s) => s.default || s)(require('./components/cluster'));

// TODO: This should be checked if it must be GmapVue, Gmap.api or something else
let GmapApi = null
let GmapApi = null;

// export everything
export {
Expand Down
2 changes: 1 addition & 1 deletion packages/gmap-vue/test/test-pages/test-gmapApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h2>Test 1</h2>
document.addEventListener('DOMContentLoaded', () => {
window.vue = new Vue({
computed: {
google: GmapVue.gmapApi
google: GmapVue.gmapApi,
},
el: '#test',
});
Expand Down

0 comments on commit b06aa81

Please sign in to comment.