From decca38b677a5889c54c783e12f562a5eb09fe5e Mon Sep 17 00:00:00 2001 From: Fawad Mirzad Date: Sat, 13 Feb 2021 16:09:48 +0100 Subject: [PATCH] Add most of components and prepare for V1 Release --- .eslintignore | 0 .eslintrc.json | 24 +++ README.md | 44 +++++ build-copy.js | 8 + src/.babelrc | 20 ++ src/.main.js.swx | 0 src/components/autocomplete.vue | 11 ++ src/components/autocompleteImpl.js | 71 +++++++ src/components/circle.js | 46 +++++ src/components/cluster.vue | 114 +++++++++++ src/components/infoWindow.vue | 14 ++ src/components/infoWindowImpl.js | 82 ++++++++ src/components/map.vue | 27 +++ src/components/mapElementFactory.js | 149 ++++++++++++++ src/components/mapElementMixin.js | 31 +++ src/components/mapImpl.js | 184 ++++++++++++++++++ src/components/marker.js | 139 +++++++++++++ src/components/placeInput.vue | 10 + src/components/placeInputImpl.js | 75 +++++++ src/components/polygon.js | 120 ++++++++++++ src/components/polyline.js | 77 ++++++++ src/components/rectangle.js | 41 ++++ src/components/streetViewPanorama.vue | 21 ++ src/components/streetViewPanoramaImpl.js | 147 ++++++++++++++ src/main.js | 126 ++++++++++++ src/manager.js | 73 +++++++ src/utils/TwoWayBindingWrapper.js | 48 +++++ src/utils/WatchPrimitiveProperties.js | 24 +++ src/utils/bindEvents.js | 10 + src/utils/bindProps.js | 74 +++++++ src/utils/lazyValue.js | 16 ++ src/utils/mountableMixin.js | 55 ++++++ src/utils/simulateArrowDown.js | 28 +++ test/.eslintrc.json | 26 +++ test/basic.js | 95 +++++++++ test/gmapApi-guard.js | 38 ++++ test/maps-not-loaded.js | 65 +++++++ test/marker-with-infowindow.js | 84 ++++++++ test/test-all-examples.js | 40 ++++ test/test-pages/test-gmapApi.html | 39 ++++ .../test-marker-with-infowindow.html | 71 +++++++ test/test-pages/test-page-without-maps.html | 28 +++ test/test-pages/test-plain-map.html | 30 +++ test/test-setup/babel-transform.js | 30 +++ test/test-setup/compile-standalone.js | 25 +++ test/test-setup/test-common.js | 23 +++ webpack.config.js | 53 +++++ 47 files changed, 2556 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 README.md create mode 100644 build-copy.js create mode 100644 src/.babelrc create mode 100644 src/.main.js.swx create mode 100644 src/components/autocomplete.vue create mode 100644 src/components/autocompleteImpl.js create mode 100644 src/components/circle.js create mode 100644 src/components/cluster.vue create mode 100644 src/components/infoWindow.vue create mode 100644 src/components/infoWindowImpl.js create mode 100644 src/components/map.vue create mode 100644 src/components/mapElementFactory.js create mode 100644 src/components/mapElementMixin.js create mode 100644 src/components/mapImpl.js create mode 100644 src/components/marker.js create mode 100644 src/components/placeInput.vue create mode 100644 src/components/placeInputImpl.js create mode 100644 src/components/polygon.js create mode 100644 src/components/polyline.js create mode 100644 src/components/rectangle.js create mode 100644 src/components/streetViewPanorama.vue create mode 100644 src/components/streetViewPanoramaImpl.js create mode 100644 src/main.js create mode 100644 src/manager.js create mode 100644 src/utils/TwoWayBindingWrapper.js create mode 100644 src/utils/WatchPrimitiveProperties.js create mode 100644 src/utils/bindEvents.js create mode 100644 src/utils/bindProps.js create mode 100644 src/utils/lazyValue.js create mode 100644 src/utils/mountableMixin.js create mode 100644 src/utils/simulateArrowDown.js create mode 100644 test/.eslintrc.json create mode 100644 test/basic.js create mode 100644 test/gmapApi-guard.js create mode 100644 test/maps-not-loaded.js create mode 100644 test/marker-with-infowindow.js create mode 100644 test/test-all-examples.js create mode 100644 test/test-pages/test-gmapApi.html create mode 100644 test/test-pages/test-marker-with-infowindow.html create mode 100644 test/test-pages/test-page-without-maps.html create mode 100644 test/test-pages/test-plain-map.html create mode 100644 test/test-setup/babel-transform.js create mode 100644 test/test-setup/compile-standalone.js create mode 100644 test/test-setup/test-common.js create mode 100644 webpack.config.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e69de29 diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..7a8cbaf --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "node": true + }, + "extends": "standard", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "comma-dangle": 0 + }, + "globals": { + "google": true + }, + "plugins": [ + "html" + ], + "settings": { + "html/html-extensions": [".html", ".vue"] + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..e83ca96 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# Google maps Components for Vue.js 3 + +Set of mostly used Google Maps components for Vue.js. + +#### Why this library exists? +We heavily use Google Maps in our projects, so I wanted to have a well maintained Google Maps library. + +## Documentation +Checkout https://vue-map.netlify.app for a detailed documentation + +## Installation +You can install it using npm +``` +npm install -S @fawmi/vue-google-maps +``` + +## Basic usage +You need an API Key. Learn how to [get an Api key ](https://developers.google.com/maps/documentation/javascript/get-api-key). + +##Configure Vue to use the Components + +In your `main.js` or inside a Nuxt plugin: + +```js +import { createApp } from 'vue' +import * as VueGoogleMaps from '@fawmi/vue-google-maps' + +const app = createApp(App); +app.use(VueGoogleMaps, { + load: { + key: 'YOUR_API_KEY_COMES_HERE', + }, +}).mount('#app') + +``` +## Use it anywhere in your components + +```vue +