From b8fa8ad06b1199c0d65f4b6191063b2975ee8bb8 Mon Sep 17 00:00:00 2001 From: Eduardo Peredo Date: Sun, 16 Jul 2017 12:57:07 -0500 Subject: [PATCH] Fixed error when icon url for markers --- README.md | 4 +++- dist/StaticMap.js | 2 +- dist/StaticMap.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- src/App.vue | 6 +++--- src/components/StaticMap.vue | 26 +++++++++++++++++++++----- 7 files changed, 31 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c26110b..5933ae9 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ ![static google map](https://user-images.githubusercontent.com/461124/28100714-6c896d1e-6689-11e7-8a38-327dfe4b6ff5.png) +[Google Documentation](https://developers.google.com/maps/documentation/static-maps/intro) + ## Demo -- [JSBin example](http://jsbin.com/gawedufesa/edit?html,js,output) +- [JSBin example](http://jsbin.com/gizixekilu/edit?html,js,output) ## Requirements diff --git a/dist/StaticMap.js b/dist/StaticMap.js index 7e94f2e..cfce493 100644 --- a/dist/StaticMap.js +++ b/dist/StaticMap.js @@ -1,2 +1,2 @@ -(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.StaticMap=t():e.StaticMap=t()})(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,r){var n=r(2)(r(1),r(3),null,null,null);e.exports=n.exports},function(e,t,r){"use strict";function n(){return this.format.toLowerCase()}function o(){var e=["roadmap","satellite","hybrid","terrain"],t=this.type;if(e.indexOf(t)>-1)return t;throw Error("Type must be one of the following values "+e.join(", ").toUpperCase())}function a(){var e=c+"center="+this.center+"&zoom="+this.zoom+"&size="+this.sizeMap+"&maptype="+this.mapTypeMap+"&format="+this.formatMap+"&key="+this.googleApiKey+"&scale="+this.scaleMap+"&language="+this.language+this.markersMap+this.pathsMap;return this.$emit("get-url",e),e}function i(){return this.markers.map(function(e){var t="color:"+e.color,r="size:"+e.size,n="label:"+e.label;return"&markers=icon:"+e.icon+"|"+r+"|"+t+"|"+n+"|"+e.lat+","+e.lng}).join("")}function s(){return this.paths.map(function(e){var t="color:"+e.color,r="weight:"+e.weight,n="geodesic:"+e.geodesic;return"&path="+t+"|fillcolor:"+e.fillcolor+"|"+n+"|"+r+e.locations.map(function(e){if(e.startLat&&e.endLng)return"|"+e.startLat+","+e.endLng;throw Error("The path object must have startLat and endLng properties")}).join("")})[0]}function u(){var e=["1","2","4"];if(e.indexOf(this.scale)>-1)return this.scale;throw Error("Scale only can have the values "+e.join(", "))}function p(){if(this.size.length>0){var e=this.size;return e[0]+"x"+e[1]}throw Error("Size must have 2 values: WIDTH AND HEIGHT")}Object.defineProperty(t,"__esModule",{value:!0});var c="https://maps.googleapis.com/maps/api/staticmap?";t.default={computed:{formatMap:n,mapTypeMap:o,mapUrl:a,markersMap:i,pathsMap:s,scaleMap:u,sizeMap:p},props:{center:{type:String,required:!0},format:{type:String,default:"png"},getUrl:{type:Function},googleApiKey:{type:String,required:!0},language:{type:String,default:"en"},markers:{type:Array,default:function(){return[]}},paths:{type:Array,default:function(){return[]}},type:{type:String,default:"roadmap"},scale:{type:String,default:"1"},size:{type:Array,default:function(){return[500,400]}},zoom:{type:Number,required:!0}}}},function(e,t){e.exports=function(e,t,r,n,o){var a,i=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(a=e,i=e.default);var u="function"==typeof i?i.options:i;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns),n&&(u._scopeId=n);var p;if(o?(p=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=p):r&&(p=r),p){var c=u.functional,l=c?u.render:u.beforeCreate;c?u.render=function(e,t){return p.call(t),l(e,t)}:u.beforeCreate=l?[].concat(l,p):[p]}return{esModule:a,exports:i,options:u}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("img",{attrs:{src:e.mapUrl,alt:"Static Google Map"}})},staticRenderFns:[]}},function(e,t,r){e.exports=r(0)}])}); +(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.StaticMap=t():e.StaticMap=t()})(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,r){var n=r(2)(r(1),r(3),null,null,null);e.exports=n.exports},function(e,t,r){"use strict";function n(){return this.format.toLowerCase()}function o(){var e=["roadmap","satellite","hybrid","terrain"],t=this.type;if(e.indexOf(t)>-1)return t;throw Error("Type must be one of the following values "+e.join(", ").toUpperCase())}function a(){var e=c+"center="+this.center+"&zoom="+this.zoom+"&size="+this.sizeMap+"&maptype="+this.mapTypeMap+"&format="+this.formatMap+"&key="+this.googleApiKey+"&scale="+this.scaleMap+"&language="+this.language+this.markersMap+this.pathsMap;return this.$emit("get-url",e),e}function i(){return this.markers.map(function(e){var t="color:"+e.color+"|",r="size:"+e.size+"|",n="label:"+e.label+"|",o="icon:"+e.icon+"|",a=e.lat+","+e.lng,i="&markers=";return e.color&&(i+=t),e.size&&(i+=r),e.label&&(i+=n),e.icon&&(i+=o),e.lat&&e.lng&&(i+=a),i}).join("")}function s(){return this.paths.map(function(e){var t="color:"+e.color,r="weight:"+e.weight,n="geodesic:"+e.geodesic;return"&path="+t+"|fillcolor:"+e.fillcolor+"|"+n+"|"+r+e.locations.map(function(e){if(e.startLat&&e.endLng)return"|"+e.startLat+","+e.endLng;throw Error("The path object must have startLat and endLng properties")}).join("")})[0]}function u(){var e=["1","2","4"];if(e.indexOf(this.scale)>-1)return this.scale;throw Error("Scale only can have the values "+e.join(", "))}function p(){if(this.size.length>0){var e=this.size;return e[0]+"x"+e[1]}throw Error("Size must have 2 values: WIDTH AND HEIGHT")}Object.defineProperty(t,"__esModule",{value:!0});var c="https://maps.googleapis.com/maps/api/staticmap?";t.default={computed:{formatMap:n,mapTypeMap:o,mapUrl:a,markersMap:i,pathsMap:s,scaleMap:u,sizeMap:p},props:{center:{type:String,required:!0},format:{type:String,default:"png"},getUrl:{type:Function},googleApiKey:{type:String,required:!0},language:{type:String,default:"en"},markers:{type:Array,default:function(){return[]}},paths:{type:Array,default:function(){return[]}},type:{type:String,default:"roadmap"},scale:{type:String,default:"1"},size:{type:Array,default:function(){return[500,400]}},zoom:{type:Number,required:!0}}}},function(e,t){e.exports=function(e,t,r,n,o){var a,i=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(a=e,i=e.default);var u="function"==typeof i?i.options:i;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns),n&&(u._scopeId=n);var p;if(o?(p=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=p):r&&(p=r),p){var c=u.functional,l=c?u.render:u.beforeCreate;c?u.render=function(e,t){return p.call(t),l(e,t)}:u.beforeCreate=l?[].concat(l,p):[p]}return{esModule:a,exports:i,options:u}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("img",{attrs:{src:e.mapUrl,alt:"Static Google Map"}})},staticRenderFns:[]}},function(e,t,r){e.exports=r(0)}])}); //# sourceMappingURL=StaticMap.js.map \ No newline at end of file diff --git a/dist/StaticMap.js.map b/dist/StaticMap.js.map index 2ed9411..b3573d4 100644 --- a/dist/StaticMap.js.map +++ b/dist/StaticMap.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///StaticMap.js","webpack:///webpack/bootstrap b24be12132deebab92cf","webpack:///./src/components/StaticMap.vue","webpack:///StaticMap.vue","webpack:///./~/vue-loader/lib/component-normalizer.js","webpack:///./src/components/StaticMap.vue?ad3a"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","Component","__webpack_exports__","generateFormatMap","format","toLowerCase","generateMapType","types","currenType","type","indexOf","Error","join","toUpperCase","generateMapUrl","mapUrl","BASE_URL_MAP","center","zoom","sizeMap","mapTypeMap","formatMap","googleApiKey","scaleMap","language","markersMap","pathsMap","$emit","generateMarkers","markers","map","marker","color","size","label","icon","lat","lng","generatePaths","paths","path","weight","geodesic","fillcolor","locations","location","startLat","endLng","generateScaleMap","allowedScales","scale","generateSizeMap","length","computed","props","String","required","default","getUrl","Function","Array","Number","rawScriptExports","compiledTemplate","injectStyles","scopeId","moduleIdentifier","esModule","scriptExports","options","render","staticRenderFns","_scopeId","hook","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","functional","existing","beforeCreate","h","concat","_vm","_h","$createElement","_self","_c","attr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AP,EAGA,IAAAQ,EA4BA,IA3BAP,GACAO,EAAA,SAAAC,GAEAA,EACAA,GACArG,KAAAsG,QAAAtG,KAAAsG,OAAAC,YACAvG,KAAAwG,QAAAxG,KAAAwG,OAAAF,QAAAtG,KAAAwG,OAAAF,OAAAC,WAEAF,GAAA,mBAAAI,uBACAJ,EAAAI,qBAGAd,GACAA,EAAApF,KAAAP,KAAAqG,GAGAA,KAAAK,uBACAL,EAAAK,sBAAAC,IAAAd,IAKAG,EAAAY,aAAAR,GACGT,IACHS,EAAAT,GAGAS,EAAA,CACA,GAAAS,GAAAb,EAAAa,WACAC,EAAAD,EACAb,EAAAC,OACAD,EAAAe,YACAF,GAOAb,EAAAC,OAAA,SAAAe,EAAAX,GAEA,MADAD,GAAA7F,KAAA8F,GACAS,EAAAE,EAAAX,IAPAL,EAAAe,aAAAD,KACAG,OAAAH,EAAAV,IACAA,GAUA,OACAN,WACAlG,QAAAmG,EACAC,aJ6PM,SAAUnG,EAAQD,GKrVxBC,EAAAD,SAAgBqG,OAAA,WAAmB,GAAAiB,GAAAlH,KAAamH,EAAAD,EAAAE,cAChD,QAD0EF,EAAAG,MAAAC,IAAAH,GAC1E,OACAI,OACAC,IAAAN,EAAAxE,OACA+E,IAAA,wBAGCvB,qBL2VK,SAAUrG,EAAQD,EAASM,GAEjCL,EAAOD,QAAUM,EAAoB","file":"StaticMap.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StaticMap\"] = factory();\n\telse\n\t\troot[\"StaticMap\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StaticMap\"] = factory();\n\telse\n\t\troot[\"StaticMap\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Component = __webpack_require__(2)(\n /* script */\n __webpack_require__(1),\n /* template */\n __webpack_require__(3),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n//\n//\n//\n//\n\n\nvar BASE_URL_MAP = 'https://maps.googleapis.com/maps/api/staticmap?';\n\nfunction generateFormatMap() {\n\treturn this.format.toLowerCase();\n}\n\nfunction generateMapType() {\n\tvar types = ['roadmap', 'satellite', 'hybrid', 'terrain'];\n\tvar currenType = this.type;\n\tif (types.indexOf(currenType) > -1) {\n\t\treturn currenType;\n\t}\n\tthrow Error('Type must be one of the following values ' + types.join(', ').toUpperCase());\n}\n\nfunction generateMapUrl() {\n\tvar mapUrl = BASE_URL_MAP + 'center=' + this.center + '&zoom=' + this.zoom + '&size=' + this.sizeMap + '&maptype=' + this.mapTypeMap + '&format=' + this.formatMap + '&key=' + this.googleApiKey + '&scale=' + this.scaleMap + '&language=' + this.language + this.markersMap + this.pathsMap;\n\tthis.$emit('get-url', mapUrl);\n\treturn mapUrl;\n}\n\nfunction generateMarkers() {\n\tvar markers = this.markers.map(function (marker) {\n\t\tvar color = 'color:' + marker.color;\n\t\tvar size = 'size:' + marker.size;\n\t\tvar label = 'label:' + marker.label;\n\t\tvar icon = 'icon:' + marker.icon;\n\t\tvar latLng = marker.lat + ',' + marker.lng;\n\t\tvar markerUrl = '&markers=' + icon + '|' + size + '|' + color + '|' + label + '|' + latLng;\n\t\treturn markerUrl;\n\t});\n\treturn markers.join('');\n}\n\nfunction generatePaths() {\n\tvar paths = this.paths.map(function (path) {\n\t\tvar color = 'color:' + path.color;\n\t\tvar weight = 'weight:' + path.weight;\n\t\tvar geodesic = 'geodesic:' + path.geodesic;\n\t\tvar fillcolor = 'fillcolor:' + path.fillcolor;\n\t\tvar latLng = path.locations.map(function (location) {\n\t\t\tif (location.startLat && location.endLng) {\n\t\t\t\treturn '|' + location.startLat + ',' + location.endLng;\n\t\t\t}\n\t\t\tthrow Error('The path object must have startLat and endLng properties');\n\t\t});\n\t\tvar joinLatLng = latLng.join('');\n\t\tvar pathUrl = '&path=' + color + '|' + fillcolor + '|' + geodesic + '|' + weight + joinLatLng;\n\t\treturn pathUrl;\n\t});\n\treturn paths[0];\n}\n\nfunction generateScaleMap() {\n\tvar allowedScales = ['1', '2', '4'];\n\tif (allowedScales.indexOf(this.scale) > -1) {\n\t\treturn this.scale;\n\t}\n\tthrow Error('Scale only can have the values ' + allowedScales.join(', '));\n}\n\nfunction generateSizeMap() {\n\tif (this.size.length > 0) {\n\t\tvar size = this.size;\n\t\treturn size[0] + 'x' + size[1];\n\t}\n\tthrow Error('Size must have 2 values: WIDTH AND HEIGHT');\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n\tcomputed: {\n\t\tformatMap: generateFormatMap,\n\t\tmapTypeMap: generateMapType,\n\t\tmapUrl: generateMapUrl,\n\t\tmarkersMap: generateMarkers,\n\t\tpathsMap: generatePaths,\n\t\tscaleMap: generateScaleMap,\n\t\tsizeMap: generateSizeMap\n\t},\n\tprops: {\n\t\tcenter: {\n\t\t\ttype: String,\n\t\t\trequired: true\n\t\t},\n\t\tformat: {\n\t\t\ttype: String,\n\t\t\tdefault: 'png'\n\t\t},\n\t\tgetUrl: {\n\t\t\ttype: Function\n\t\t},\n\t\tgoogleApiKey: {\n\t\t\ttype: String,\n\t\t\trequired: true\n\t\t},\n\t\tlanguage: {\n\t\t\ttype: String,\n\t\t\tdefault: 'en'\n\t\t},\n\t\tmarkers: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\tpaths: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'roadmap'\n\t\t},\n\t\tscale: {\n\t\t\ttype: String,\n\t\t\tdefault: '1'\n\t\t},\n\t\tsize: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [500, 400];\n\t\t\t}\n\t\t},\n\t\tzoom: {\n\t\t\ttype: Number,\n\t\t\trequired: true\n\t\t}\n\t}\n});\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('img', {\n attrs: {\n \"src\": _vm.mapUrl,\n \"alt\": \"Static Google Map\"\n }\n })\n},staticRenderFns: []}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(0);\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// StaticMap.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b24be12132deebab92cf","var Component = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./StaticMap.vue\"),\n /* template */\n require(\"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-84f21168\\\"}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./StaticMap.vue\"),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/StaticMap.vue\n// module id = 0\n// module chunks = 0","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// StaticMap.vue?a000a522","/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/component-normalizer.js\n// module id = 2\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('img', {\n attrs: {\n \"src\": _vm.mapUrl,\n \"alt\": \"Static Google Map\"\n }\n })\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-84f21168\"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/components/StaticMap.vue\n// module id = 3\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///StaticMap.js","webpack:///webpack/bootstrap 6d78a3f06e2bccbb66c2","webpack:///./src/components/StaticMap.vue","webpack:///StaticMap.vue","webpack:///./~/vue-loader/lib/component-normalizer.js","webpack:///./src/components/StaticMap.vue?ad3a"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","Component","__webpack_exports__","generateFormatMap","format","toLowerCase","generateMapType","types","currenType","type","indexOf","Error","join","toUpperCase","generateMapUrl","mapUrl","BASE_URL_MAP","center","zoom","sizeMap","mapTypeMap","formatMap","googleApiKey","scaleMap","language","markersMap","pathsMap","$emit","generateMarkers","markers","map","marker","color","size","label","icon","latLng","lat","lng","markerUrl","generatePaths","paths","path","weight","geodesic","fillcolor","locations","location","startLat","endLng","generateScaleMap","allowedScales","scale","generateSizeMap","length","computed","props","String","required","default","getUrl","Function","Array","Number","rawScriptExports","compiledTemplate","injectStyles","scopeId","moduleIdentifier","esModule","scriptExports","options","render","staticRenderFns","_scopeId","hook","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","functional","existing","beforeCreate","h","concat","_vm","_h","$createElement","_self","_c","attrs","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AAA,aAAAA,IACA4D,EAAAL,EACAM,EAAAN,EAAAL,QAIA,IAAAY,GAAA,kBAAAD,GACAA,EAAAC,QACAD,CAGAL,KACAM,EAAAC,OAAAP,EAAAO,OACAD,EAAAE,gBAAAR,EAAAQ,iBAIAN,IACAI,EAAAG,SAAAP,EAGA,IAAAQ,EA4BA,IA3BAP,GACAO,EAAA,SAAAC,GAEAA,EACAA,GACAvG,KAAAwG,QAAAxG,KAAAwG,OAAAC,YACAzG,KAAA0G,QAAA1G,KAAA0G,OAAAF,QAAAxG,KAAA0G,OAAAF,OAAAC,WAEAF,GAAA,mBAAAI,uBACAJ,EAAAI,qBAGAd,GACAA,EAAAtF,KAAAP,KAAAuG,GAGAA,KAAAK,uBACAL,EAAAK,sBAAAC,IAAAd,IAKAG,EAAAY,aAAAR,GACGT,IACHS,EAAAT,GAGAS,EAAA,CACA,GAAAS,GAAAb,EAAAa,WACAC,EAAAD,EACAb,EAAAC,OACAD,EAAAe,YACAF,GAOAb,EAAAC,OAAA,SAAAe,EAAAX,GAEA,MADAD,GAAA/F,KAAAgG,GACAS,EAAAE,EAAAX,IAPAL,EAAAe,aAAAD,KACAG,OAAAH,EAAAV,IACAA,GAUA,OACAN,WACApG,QAAAqG,EACAC,aJ6QM,SAAUrG,EAAQD,GKrWxBC,EAAAD,SAAgBuG,OAAA,WAAmB,GAAAiB,GAAApH,KAAaqH,EAAAD,EAAAE,cAChD,QAD0EF,EAAAG,MAAAC,IAAAH,GAC1E,OACAI,OACAC,IAAAN,EAAA1E,OACAiF,IAAA,wBAGCvB,qBL2WK,SAAUvG,EAAQD,EAASM,GAEjCL,EAAOD,QAAUM,EAAoB","file":"StaticMap.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StaticMap\"] = factory();\n\telse\n\t\troot[\"StaticMap\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StaticMap\"] = factory();\n\telse\n\t\troot[\"StaticMap\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Component = __webpack_require__(2)(\n /* script */\n __webpack_require__(1),\n /* template */\n __webpack_require__(3),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n//\n//\n//\n//\n\n\nvar BASE_URL_MAP = 'https://maps.googleapis.com/maps/api/staticmap?';\n\nfunction generateFormatMap() {\n\treturn this.format.toLowerCase();\n}\n\nfunction generateMapType() {\n\tvar types = ['roadmap', 'satellite', 'hybrid', 'terrain'];\n\tvar currenType = this.type;\n\tif (types.indexOf(currenType) > -1) {\n\t\treturn currenType;\n\t}\n\tthrow Error('Type must be one of the following values ' + types.join(', ').toUpperCase());\n}\n\nfunction generateMapUrl() {\n\tvar mapUrl = BASE_URL_MAP + 'center=' + this.center + '&zoom=' + this.zoom + '&size=' + this.sizeMap + '&maptype=' + this.mapTypeMap + '&format=' + this.formatMap + '&key=' + this.googleApiKey + '&scale=' + this.scaleMap + '&language=' + this.language + this.markersMap + this.pathsMap;\n\tthis.$emit('get-url', mapUrl);\n\treturn mapUrl;\n}\n\nfunction generateMarkers() {\n\tvar markers = this.markers.map(function (marker) {\n\t\tvar color = 'color:' + marker.color + '|';\n\t\tvar size = 'size:' + marker.size + '|';\n\t\tvar label = 'label:' + marker.label + '|';\n\t\tvar icon = 'icon:' + marker.icon + '|';\n\t\tvar latLng = marker.lat + ',' + marker.lng;\n\t\tvar markerUrl = '&markers=';\n\t\tif (marker.color) {\n\t\t\tmarkerUrl += color;\n\t\t}\n\t\tif (marker.size) {\n\t\t\tmarkerUrl += size;\n\t\t}\n\t\tif (marker.label) {\n\t\t\tmarkerUrl += label;\n\t\t}\n\t\tif (marker.icon) {\n\t\t\tmarkerUrl += icon;\n\t\t}\n\t\tif (marker.lat && marker.lng) {\n\t\t\tmarkerUrl += latLng;\n\t\t}\n\t\t// const markerUrl = `&markers=${icon}|${size}|${color}|${label}|${latLng}`;\n\t\treturn markerUrl;\n\t});\n\treturn markers.join('');\n}\n\nfunction generatePaths() {\n\tvar paths = this.paths.map(function (path) {\n\t\tvar color = 'color:' + path.color;\n\t\tvar weight = 'weight:' + path.weight;\n\t\tvar geodesic = 'geodesic:' + path.geodesic;\n\t\tvar fillcolor = 'fillcolor:' + path.fillcolor;\n\t\tvar latLng = path.locations.map(function (location) {\n\t\t\tif (location.startLat && location.endLng) {\n\t\t\t\treturn '|' + location.startLat + ',' + location.endLng;\n\t\t\t}\n\t\t\tthrow Error('The path object must have startLat and endLng properties');\n\t\t});\n\t\tvar joinLatLng = latLng.join('');\n\t\tvar pathUrl = '&path=' + color + '|' + fillcolor + '|' + geodesic + '|' + weight + joinLatLng;\n\t\treturn pathUrl;\n\t});\n\treturn paths[0];\n}\n\nfunction generateScaleMap() {\n\tvar allowedScales = ['1', '2', '4'];\n\tif (allowedScales.indexOf(this.scale) > -1) {\n\t\treturn this.scale;\n\t}\n\tthrow Error('Scale only can have the values ' + allowedScales.join(', '));\n}\n\nfunction generateSizeMap() {\n\tif (this.size.length > 0) {\n\t\tvar size = this.size;\n\t\treturn size[0] + 'x' + size[1];\n\t}\n\tthrow Error('Size must have 2 values: WIDTH AND HEIGHT');\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n\tcomputed: {\n\t\tformatMap: generateFormatMap,\n\t\tmapTypeMap: generateMapType,\n\t\tmapUrl: generateMapUrl,\n\t\tmarkersMap: generateMarkers,\n\t\tpathsMap: generatePaths,\n\t\tscaleMap: generateScaleMap,\n\t\tsizeMap: generateSizeMap\n\t},\n\tprops: {\n\t\tcenter: {\n\t\t\ttype: String,\n\t\t\trequired: true\n\t\t},\n\t\tformat: {\n\t\t\ttype: String,\n\t\t\tdefault: 'png'\n\t\t},\n\t\tgetUrl: {\n\t\t\ttype: Function\n\t\t},\n\t\tgoogleApiKey: {\n\t\t\ttype: String,\n\t\t\trequired: true\n\t\t},\n\t\tlanguage: {\n\t\t\ttype: String,\n\t\t\tdefault: 'en'\n\t\t},\n\t\tmarkers: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\tpaths: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\ttype: {\n\t\t\ttype: String,\n\t\t\tdefault: 'roadmap'\n\t\t},\n\t\tscale: {\n\t\t\ttype: String,\n\t\t\tdefault: '1'\n\t\t},\n\t\tsize: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [500, 400];\n\t\t\t}\n\t\t},\n\t\tzoom: {\n\t\t\ttype: Number,\n\t\t\trequired: true\n\t\t}\n\t}\n});\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('img', {\n attrs: {\n \"src\": _vm.mapUrl,\n \"alt\": \"Static Google Map\"\n }\n })\n},staticRenderFns: []}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(0);\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// StaticMap.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6d78a3f06e2bccbb66c2","var Component = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./StaticMap.vue\"),\n /* template */\n require(\"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-84f21168\\\"}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./StaticMap.vue\"),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/StaticMap.vue\n// module id = 0\n// module chunks = 0","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// StaticMap.vue?021c2348","/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/component-normalizer.js\n// module id = 2\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('img', {\n attrs: {\n \"src\": _vm.mapUrl,\n \"alt\": \"Static Google Map\"\n }\n })\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-84f21168\"}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/components/StaticMap.vue\n// module id = 3\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5ba9eb9..17c013f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-static-map", - "version": "1.6.3", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 22412b6..a0e0fb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-static-map", - "version": "1.6.3", + "version": "2.0.0", "description": "a simple component to generate static google map", "keywords": [ "vue", diff --git a/src/App.vue b/src/App.vue index 6486485..4916d4e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,12 +19,12 @@ export default { data: () => { const dataValues = { apiKey: '', - center: 'Empire State Building', + center: 'Brooklyn+Bridge,New+York,NY', format: 'gif', - language: 'EN', + language: 'ja', markers: [ { - label: 'B', color: 'blue', lat: 40.702147, lng: -74.015794, size: 'normal', + label: 'W', color: 'blue', lat: 40.702147, lng: -74.015794, size: 'normal', }, { label: 'Y', color: 'yellow', lat: 40.711614, lng: -74.012318, size: 'tiny', diff --git a/src/components/StaticMap.vue b/src/components/StaticMap.vue index 07d8b52..0b75558 100644 --- a/src/components/StaticMap.vue +++ b/src/components/StaticMap.vue @@ -27,12 +27,28 @@ function generateMapUrl() { function generateMarkers() { const markers = this.markers.map((marker) => { - const color = `color:${marker.color}`; - const size = `size:${marker.size}`; - const label = `label:${marker.label}`; - const icon = `icon:${marker.icon}`; + const color = `color:${marker.color}|`; + const size = `size:${marker.size}|`; + const label = `label:${marker.label}|`; + const icon = `icon:${marker.icon}|`; const latLng = `${marker.lat},${marker.lng}`; - const markerUrl = `&markers=${icon}|${size}|${color}|${label}|${latLng}`; + let markerUrl = '&markers='; + if (marker.color) { + markerUrl += color; + } + if (marker.size) { + markerUrl += size; + } + if (marker.label) { + markerUrl += label; + } + if (marker.icon) { + markerUrl += icon; + } + if (marker.lat && marker.lng) { + markerUrl += latLng; + } + // const markerUrl = `&markers=${icon}|${size}|${color}|${label}|${latLng}`; return markerUrl; }); return markers.join('');