Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rjgf/rj-components

Package Overview
Dependencies
Maintainers
6
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rjgf/rj-components - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

dist/main.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue-property-decorator"),require("axios")):"function"==typeof define&&define.amd?define(["vue-property-decorator","axios"],e):"object"==typeof exports?exports.main=e(require("vue-property-decorator"),require("axios")):t.main=e(t["vue-property-decorator"],t.axios)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[t.readOnly?t._e():e("div",{staticClass:"search-content"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],attrs:{type:"text",id:"keyword"},domProps:{value:t.keyword},on:{input:[function(e){e.target.composing||(t.keyword=e.target.value)},t.oninput],focus:function(e){return t.search(t.keyword)}}})]),t._v(" "),e("div",{style:t.containerStyle,attrs:{id:"t-map-container"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.resultList.length,expression:"resultList.length"}],staticClass:"result"},[e("ul",t._l(t.resultList,(function(n,r){return e("li",{key:n.lonlat+r,staticClass:"result-item",on:{click:function(e){return e.stopPropagation(),t.confirmAddress(n)}}},[e("span",[t._v(t._s(n.name))]),t._v(" "),e("span",{staticClass:"address"},[t._v(t._s(n.address))])])})),0),t._v(" "),e("div",{staticClass:"clear-info",on:{click:function(e){e.stopPropagation(),t.resultList=[]}}},[t._v("关闭")])])])])};r._withStripped=!0;var a=n(0),o=n(4),i=n.n(o),s=n(2),c=n.n(s),u=function(t,e,n,r){var a,o=arguments.length,i=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,n,i):a(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},d=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let l=class extends a.Vue{constructor(){super(...arguments),this.resultList=[],this.keyword=""}get mapBound(){const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;return`${t-2},${e-2},${t+2},${e+2}`}get containerStyle(){return"width: 100%; height: "+this.height}created(){this.initMapObj()}initMapObj(){let t=document.getElementById("t-map");if(t)return this.initMap();t=document.createElement("script"),t.id="t-map",t.src="http://api.tianditu.gov.cn/api?v=4.0&tk="+this.tk,t.onload=()=>{this.initMap()},document.body.appendChild(t)}initMap(){this.T=window.T,this.map=new this.T.Map("t-map-container");const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;var n=new this.T.LngLat(t,e);this.map.centerAndZoom(n,15),this.map.addEventListener("click",this.onclick);const r=new this.T.Control.Scale;this.map.addControl(r),setTimeout(()=>{this.$emit("complete",this.map)})}onclick(t){this.$emit("click",t),this.readOnly||this._setMark(t.lnglat)}clearOverLay(){this.map.clearOverLays()}_setMark(t){const{lat:e,lng:n}=t;this.autoTransform?this.$emit("change",this.transform(t,"gcj02")):this.$emit("change",{lat:e,lng:n}),this.clearOverLay();const r=this.transform(t,"gcj02"),a=new this.T.Label({text:`${this.autoTransform?r.lng:n},${this.autoTransform?r.lat:e}`,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(a);const o=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(o)}setMark(t){const{lat:e,lng:n}=this.autoTransform?this.transform(t,"wgs84"):t;this.clearOverLay();const r=new this.T.Label({text:`${n},${e}`,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(r);const a=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(a)}oninput(t){this.time&&clearTimeout(this.time),this.time=setTimeout(()=>{this.search(t.target.value),this.time=null},500)}search(t){i.a.get("http://api.tianditu.gov.cn/v2/search",{params:{postStr:{keyWord:t,mapBound:this.mapBound,level:12,queryType:1,start:0,count:10},type:"query",tk:this.tk}}).then(t=>{this.resultList=t.data.pois||[]})}confirmAddress(t){const[e,n]=t.lonlat.split(",");this._setMark({lng:e,lat:n}),this.setCenter({lng:e,lat:n}),this.resultList=[]}setCenter(t){const{lat:e,lng:n}=t;this.map.panTo(new this.T.LngLat(n,e))}transform(t,e){switch(e){case"gcj02":{const e=c.a.wgs84togcj02(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}case"wgs84":{const e=c.a.gcj02towgs84(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}default:return t}}};u([Object(a.Prop)({type:Number,default:108.320004}),d("design:type",Object)],l.prototype,"defaultLng",void 0),u([Object(a.Prop)({type:Number,default:22.82402}),d("design:type",Object)],l.prototype,"defaultLat",void 0),u([Object(a.Prop)({type:String,default:"b6943c056759dd3e6dc5a99faed7f9ab"}),d("design:type",Object)],l.prototype,"tk",void 0),u([Object(a.Prop)({type:String,default:"500px"}),d("design:type",Object)],l.prototype,"height",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!1}),d("design:type",Object)],l.prototype,"readOnly",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!0}),d("design:type",Object)],l.prototype,"autoTransform",void 0),l=u([Object(a.Component)({name:"TMap"})],l);var p=l;n(6);var f=function(t,e,n,r,a,o,i,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):a&&(c=s?function(){a.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(u.functional){u._injectStyles=c;var d=u.render;u.render=function(t,e){return c.call(e),d(t,e)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,c):[c]}return{exports:t,options:u}}(p,r,[],!1,null,"5ef7124e",null);e.a=f.exports},function(t,e,n){var r,a,o;a=[],void 0===(o="function"==typeof(r=function(){var t=52.35987755982988,e=3.141592653589793,n=6378245,r=.006693421622965943,a=function(t,n){var r=2*(t=+t)-100+3*(n=+n)+.2*n*n+.1*t*n+.2*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(n*e)+40*Math.sin(n/3*e))/3,r+=2*(160*Math.sin(n/12*e)+320*Math.sin(n*e/30))/3},o=function(t,n){var r=300+(t=+t)+2*(n=+n)+.1*t*t+.1*t*n+.1*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(t*e)+40*Math.sin(t/3*e))/3,r+=2*(150*Math.sin(t/12*e)+300*Math.sin(t/30*e))/3},i=function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)};return{bd09togcj02:function(e,n){var r=(e=+e)-.0065,a=(n=+n)-.006,o=Math.sqrt(r*r+a*a)-2e-5*Math.sin(a*t),i=Math.atan2(a,r)-3e-6*Math.cos(r*t);return[o*Math.cos(i),o*Math.sin(i)]},gcj02tobd09:function(e,n){n=+n,e=+e;var r=Math.sqrt(e*e+n*n)+2e-5*Math.sin(n*t),a=Math.atan2(n,e)+3e-6*Math.cos(e*t);return[r*Math.cos(a)+.0065,r*Math.sin(a)+.006]},wgs84togcj02:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),d=s/180*e,l=Math.sin(d);l=1-r*l*l;var p=Math.sqrt(l);return c=180*c/(n*(1-r)/(l*p)*e),[t+(u=180*u/(n/p*Math.cos(d)*e)),s+c]},gcj02towgs84:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),d=s/180*e,l=Math.sin(d);l=1-r*l*l;var p=Math.sqrt(l);return c=180*c/(n*(1-r)/(l*p)*e),[2*t-(t+(u=180*u/(n/p*Math.cos(d)*e))),2*s-(s+c)]}}})?r.apply(e,a):r)||(t.exports=o)},function(t,e,n){var r=n(7);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(8).default)("6cae409b",r,!1,{})},function(t,n){t.exports=e},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var a={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);r&&a[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){"use strict";n(3)},function(t,e,n){"use strict";n.r(e);var r=n(5),a=n.n(r)()((function(t){return t[1]}));a.push([t.i,"\n#t-map-container[data-v-5ef7124e] {\r\n position: relative;\n}\n#keyword[data-v-5ef7124e] {\r\n box-sizing: border-box;\r\n margin: 0;\r\n font-variant: tabular-nums;\r\n list-style: none;\r\n font-feature-settings: 'tnum';\r\n position: relative;\r\n display: inline-block;\r\n width: 100%;\r\n height: 32px;\r\n padding: 4px 11px;\r\n color: rgba(0, 0, 0, 0.65);\r\n font-size: 14px;\r\n line-height: 1.5;\r\n background-color: #fff;\r\n background-image: none;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 4px;\r\n transition: all 0.3s;\n}\n.search-content[data-v-5ef7124e] {\r\n margin-bottom: 4px;\n}\n.result[data-v-5ef7124e] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n background-color: #fff;\r\n padding: 8px 16px;\r\n z-index: 999;\n}\n.result-item[data-v-5ef7124e] {\r\n padding: 2px 0;\r\n border-bottom: #ddd;\r\n font-size: 14px;\r\n z-index: 999;\n}\n.result-item[data-v-5ef7124e]:hover {\r\n background-color: #e6f7ff;\n}\nul[data-v-5ef7124e] {\r\n padding: 0;\n}\nul > li[data-v-5ef7124e] {\r\n list-style: none;\n}\n.clear-info[data-v-5ef7124e] {\r\n text-align: center;\n}\n.address[data-v-5ef7124e] {\r\n margin-left: 4px;\r\n color: #999;\r\n font-size: 12px;\n}\r\n",""]),e.default=a},function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},a=0;a<e.length;a++){var o=e[a],i=o[0],s={id:t+":"+a,css:o[1],media:o[2],sourceMap:o[3]};r[i]?r[i].parts.push(s):n.push(r[i]={id:i,parts:[s]})}return n}n.r(e),n.d(e,"default",(function(){return f}));var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},i=a&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,u=!1,d=function(){},l=null,p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,n,a){u=n,l=a||{};var i=r(t,e);return h(i),function(e){for(var n=[],a=0;a<i.length;a++){var s=i[a];(c=o[s.id]).refs--,n.push(c)}e?h(i=r(t,e)):i=[];for(a=0;a<n.length;a++){var c;if(0===(c=n[a]).refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete o[c.id]}}}}function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=o[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(g(n.parts[a]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(a=0;a<n.parts.length;a++)i.push(g(n.parts[a]));o[n.id]={id:n.id,refs:1,parts:i}}}}function v(){var t=document.createElement("style");return t.type="text/css",i.appendChild(t),t}function g(t){var e,n,r=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(r){if(u)return d;r.parentNode.removeChild(r)}if(p){var a=c++;r=s||(s=v()),e=b.bind(null,r,a,!1),n=b.bind(null,r,a,!0)}else r=v(),e=M.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}var m,y=(m=[],function(t,e){return m[t]=e,m.filter(Boolean).join("\n")});function b(t,e,n,r){var a=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,a);else{var o=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(o,i[e]):t.appendChild(o)}}function M(t,e){var n=e.css,r=e.media,a=e.sourceMap;if(r&&t.setAttribute("media",r),l.ssrId&&t.setAttribute("data-vue-ssr-id",e.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},function(t,e,n){"use strict";n.r(e);var r=n(1);n.d(e,"TMap",(function(){return r.a}));const a=[r.a],o=function(t){a.map((function(e){t.component((null==e?void 0:e.extendOptions.name)||e.name,e)}))};window&&window.Vue&&o(window.Vue),e.default={install:o}}]).default}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue-property-decorator"),require("axios")):"function"==typeof define&&define.amd?define(["vue-property-decorator","axios"],e):"object"==typeof exports?exports.main=e(require("vue-property-decorator"),require("axios")):t.main=e(t["vue-property-decorator"],t.axios)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[t.readOnly?t._e():e("div",{staticClass:"search-content"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],attrs:{type:"text",id:"keyword"},domProps:{value:t.keyword},on:{input:[function(e){e.target.composing||(t.keyword=e.target.value)},t.oninput],focus:function(e){return t.search(t.keyword)}}})]),t._v(" "),e("div",{style:t.containerStyle,attrs:{id:"t-map-container"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.resultList.length,expression:"resultList.length"}],staticClass:"result"},[e("ul",t._l(t.resultList,(function(n,r){return e("li",{key:n.lonlat+r,staticClass:"result-item",on:{click:function(e){return e.stopPropagation(),t.confirmAddress(n)}}},[e("span",[t._v(t._s(n.name))]),t._v(" "),e("span",{staticClass:"address"},[t._v(t._s(n.address))])])})),0),t._v(" "),e("div",{staticClass:"clear-info",on:{click:function(e){e.stopPropagation(),t.resultList=[]}}},[t._v("关闭")])])])])};r._withStripped=!0;var a=n(0),o=n(4),i=n.n(o),s=n(2),c=n.n(s),u=function(t,e,n,r){var a,o=arguments.length,i=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,n,i):a(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},d=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let l=class extends a.Vue{constructor(){super(...arguments),this.resultList=[],this.keyword=""}get mapBound(){const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;return`${t-2},${e-2},${t+2},${e+2}`}get containerStyle(){return"width: 100%; height: "+this.height}created(){this.initMapObj()}initMapObj(){let t=document.getElementById("t-map");if(t)return this.initMap();t=document.createElement("script"),t.id="t-map",t.src="http://api.tianditu.gov.cn/api?v=4.0&tk="+this.tk,t.onload=()=>{this.initMap()},document.body.appendChild(t)}initMap(){this.T=window.T,this.map=new this.T.Map("t-map-container");const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;var n=new this.T.LngLat(t,e);this.map.centerAndZoom(n,15),this.map.addEventListener("click",this.onclick);const r=new this.T.Control.Scale;this.map.addControl(r),setTimeout(()=>{this.$emit("complete",this.map)})}onclick(t){this.$emit("click",t),this.readOnly||this._setMark(t.lnglat)}clearOverLay(){this.map.clearOverLays()}_setMark(t){const{lat:e,lng:n}=t;this.autoTransform?this.$emit("change",this.transform(t,"gcj02")):this.$emit("change",{lat:e,lng:n}),this.clearOverLay();const r=this.transform(t,"gcj02"),a=new this.T.Label({text:`${this.autoTransform?r.lng:n},${this.autoTransform?r.lat:e}`,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(a);const o=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(o)}setMark(t){const{lat:e,lng:n}=this.autoTransform?this.transform(t,"wgs84"):t,r=this.autoTransform?`${t.lng},${t.lat}`:`${n},${e}`;this.clearOverLay();const a=new this.T.Label({text:r,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(a);const o=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(o)}oninput(t){this.time&&clearTimeout(this.time),this.time=setTimeout(()=>{this.search(t.target.value),this.time=null},500)}search(t){i.a.get("http://api.tianditu.gov.cn/v2/search",{params:{postStr:{keyWord:t,mapBound:this.mapBound,level:12,queryType:1,start:0,count:10},type:"query",tk:this.tk}}).then(t=>{this.resultList=t.data.pois||[]})}confirmAddress(t){const[e,n]=t.lonlat.split(",");this._setMark({lng:e,lat:n}),this.setCenter({lng:e,lat:n}),this.resultList=[]}setCenter(t){const{lat:e,lng:n}=this.autoTransform?this.transform(t,"wgs84"):t;this.map.panTo(new this.T.LngLat(n,e))}transform(t,e){switch(e){case"gcj02":{const e=c.a.wgs84togcj02(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}case"wgs84":{const e=c.a.gcj02towgs84(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}default:return t}}};u([Object(a.Prop)({type:Number,default:108.320004}),d("design:type",Object)],l.prototype,"defaultLng",void 0),u([Object(a.Prop)({type:Number,default:22.82402}),d("design:type",Object)],l.prototype,"defaultLat",void 0),u([Object(a.Prop)({type:String,default:"b6943c056759dd3e6dc5a99faed7f9ab"}),d("design:type",Object)],l.prototype,"tk",void 0),u([Object(a.Prop)({type:String,default:"500px"}),d("design:type",Object)],l.prototype,"height",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!1}),d("design:type",Object)],l.prototype,"readOnly",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!0}),d("design:type",Object)],l.prototype,"autoTransform",void 0),l=u([Object(a.Component)({name:"TMap"})],l);var p=l;n(6);var f=function(t,e,n,r,a,o,i,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):a&&(c=s?function(){a.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(u.functional){u._injectStyles=c;var d=u.render;u.render=function(t,e){return c.call(e),d(t,e)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,c):[c]}return{exports:t,options:u}}(p,r,[],!1,null,"b1f01a12",null);e.a=f.exports},function(t,e,n){var r,a,o;a=[],void 0===(o="function"==typeof(r=function(){var t=52.35987755982988,e=3.141592653589793,n=6378245,r=.006693421622965943,a=function(t,n){var r=2*(t=+t)-100+3*(n=+n)+.2*n*n+.1*t*n+.2*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(n*e)+40*Math.sin(n/3*e))/3,r+=2*(160*Math.sin(n/12*e)+320*Math.sin(n*e/30))/3},o=function(t,n){var r=300+(t=+t)+2*(n=+n)+.1*t*t+.1*t*n+.1*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(t*e)+40*Math.sin(t/3*e))/3,r+=2*(150*Math.sin(t/12*e)+300*Math.sin(t/30*e))/3},i=function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)};return{bd09togcj02:function(e,n){var r=(e=+e)-.0065,a=(n=+n)-.006,o=Math.sqrt(r*r+a*a)-2e-5*Math.sin(a*t),i=Math.atan2(a,r)-3e-6*Math.cos(r*t);return[o*Math.cos(i),o*Math.sin(i)]},gcj02tobd09:function(e,n){n=+n,e=+e;var r=Math.sqrt(e*e+n*n)+2e-5*Math.sin(n*t),a=Math.atan2(n,e)+3e-6*Math.cos(e*t);return[r*Math.cos(a)+.0065,r*Math.sin(a)+.006]},wgs84togcj02:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),d=s/180*e,l=Math.sin(d);l=1-r*l*l;var p=Math.sqrt(l);return c=180*c/(n*(1-r)/(l*p)*e),[t+(u=180*u/(n/p*Math.cos(d)*e)),s+c]},gcj02towgs84:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),d=s/180*e,l=Math.sin(d);l=1-r*l*l;var p=Math.sqrt(l);return c=180*c/(n*(1-r)/(l*p)*e),[2*t-(t+(u=180*u/(n/p*Math.cos(d)*e))),2*s-(s+c)]}}})?r.apply(e,a):r)||(t.exports=o)},function(t,e,n){var r=n(7);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(8).default)("29e9259c",r,!1,{})},function(t,n){t.exports=e},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var a={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);r&&a[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){"use strict";n(3)},function(t,e,n){"use strict";n.r(e);var r=n(5),a=n.n(r)()((function(t){return t[1]}));a.push([t.i,"\n#t-map-container[data-v-b1f01a12] {\r\n position: relative;\n}\n#keyword[data-v-b1f01a12] {\r\n box-sizing: border-box;\r\n margin: 0;\r\n font-variant: tabular-nums;\r\n list-style: none;\r\n font-feature-settings: 'tnum';\r\n position: relative;\r\n display: inline-block;\r\n width: 100%;\r\n height: 32px;\r\n padding: 4px 11px;\r\n color: rgba(0, 0, 0, 0.65);\r\n font-size: 14px;\r\n line-height: 1.5;\r\n background-color: #fff;\r\n background-image: none;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 4px;\r\n transition: all 0.3s;\n}\n.search-content[data-v-b1f01a12] {\r\n margin-bottom: 4px;\n}\n.result[data-v-b1f01a12] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n background-color: #fff;\r\n padding: 8px 16px;\r\n z-index: 999;\n}\n.result-item[data-v-b1f01a12] {\r\n padding: 2px 0;\r\n border-bottom: #ddd;\r\n font-size: 14px;\r\n z-index: 999;\n}\n.result-item[data-v-b1f01a12]:hover {\r\n background-color: #e6f7ff;\n}\nul[data-v-b1f01a12] {\r\n padding: 0;\n}\nul > li[data-v-b1f01a12] {\r\n list-style: none;\n}\n.clear-info[data-v-b1f01a12] {\r\n text-align: center;\n}\n.address[data-v-b1f01a12] {\r\n margin-left: 4px;\r\n color: #999;\r\n font-size: 12px;\n}\r\n",""]),e.default=a},function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},a=0;a<e.length;a++){var o=e[a],i=o[0],s={id:t+":"+a,css:o[1],media:o[2],sourceMap:o[3]};r[i]?r[i].parts.push(s):n.push(r[i]={id:i,parts:[s]})}return n}n.r(e),n.d(e,"default",(function(){return f}));var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},i=a&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,u=!1,d=function(){},l=null,p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,n,a){u=n,l=a||{};var i=r(t,e);return h(i),function(e){for(var n=[],a=0;a<i.length;a++){var s=i[a];(c=o[s.id]).refs--,n.push(c)}e?h(i=r(t,e)):i=[];for(a=0;a<n.length;a++){var c;if(0===(c=n[a]).refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete o[c.id]}}}}function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=o[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(g(n.parts[a]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(a=0;a<n.parts.length;a++)i.push(g(n.parts[a]));o[n.id]={id:n.id,refs:1,parts:i}}}}function v(){var t=document.createElement("style");return t.type="text/css",i.appendChild(t),t}function g(t){var e,n,r=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(r){if(u)return d;r.parentNode.removeChild(r)}if(p){var a=c++;r=s||(s=v()),e=b.bind(null,r,a,!1),n=b.bind(null,r,a,!0)}else r=v(),e=M.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}var m,y=(m=[],function(t,e){return m[t]=e,m.filter(Boolean).join("\n")});function b(t,e,n,r){var a=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,a);else{var o=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(o,i[e]):t.appendChild(o)}}function M(t,e){var n=e.css,r=e.media,a=e.sourceMap;if(r&&t.setAttribute("media",r),l.ssrId&&t.setAttribute("data-vue-ssr-id",e.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},function(t,e,n){"use strict";n.r(e);var r=n(1);n.d(e,"TMap",(function(){return r.a}));const a=[r.a],o=function(t){a.map((function(e){t.component((null==e?void 0:e.extendOptions.name)||e.name,e)}))};window&&window.Vue&&o(window.Vue),e.default={install:o}}]).default}));

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue-property-decorator"),require("axios")):"function"==typeof define&&define.amd?define(["vue-property-decorator","axios"],e):"object"==typeof exports?exports["t-map"]=e(require("vue-property-decorator"),require("axios")):t["t-map"]=e(t["vue-property-decorator"],t.axios)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[t.readOnly?t._e():e("div",{staticClass:"search-content"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],attrs:{type:"text",id:"keyword"},domProps:{value:t.keyword},on:{input:[function(e){e.target.composing||(t.keyword=e.target.value)},t.oninput],focus:function(e){return t.search(t.keyword)}}})]),t._v(" "),e("div",{style:t.containerStyle,attrs:{id:"t-map-container"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.resultList.length,expression:"resultList.length"}],staticClass:"result"},[e("ul",t._l(t.resultList,(function(n,r){return e("li",{key:n.lonlat+r,staticClass:"result-item",on:{click:function(e){return e.stopPropagation(),t.confirmAddress(n)}}},[e("span",[t._v(t._s(n.name))]),t._v(" "),e("span",{staticClass:"address"},[t._v(t._s(n.address))])])})),0),t._v(" "),e("div",{staticClass:"clear-info",on:{click:function(e){e.stopPropagation(),t.resultList=[]}}},[t._v("关闭")])])])])};r._withStripped=!0;var a=n(0),o=n(4),i=n.n(o),s=n(2),c=n.n(s),u=function(t,e,n,r){var a,o=arguments.length,i=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,n,i):a(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let d=class extends a.Vue{constructor(){super(...arguments),this.resultList=[],this.keyword=""}get mapBound(){const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;return`${t-2},${e-2},${t+2},${e+2}`}get containerStyle(){return"width: 100%; height: "+this.height}created(){this.initMapObj()}initMapObj(){let t=document.getElementById("t-map");if(t)return this.initMap();t=document.createElement("script"),t.id="t-map",t.src="http://api.tianditu.gov.cn/api?v=4.0&tk="+this.tk,t.onload=()=>{this.initMap()},document.body.appendChild(t)}initMap(){this.T=window.T,this.map=new this.T.Map("t-map-container");const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;var n=new this.T.LngLat(t,e);this.map.centerAndZoom(n,15),this.map.addEventListener("click",this.onclick);const r=new this.T.Control.Scale;this.map.addControl(r),setTimeout(()=>{this.$emit("complete",this.map)})}onclick(t){this.$emit("click",t),this.readOnly||this._setMark(t.lnglat)}clearOverLay(){this.map.clearOverLays()}_setMark(t){const{lat:e,lng:n}=t;this.autoTransform?this.$emit("change",this.transform(t,"gcj02")):this.$emit("change",{lat:e,lng:n}),this.clearOverLay();const r=this.transform(t,"gcj02"),a=new this.T.Label({text:`${this.autoTransform?r.lng:n},${this.autoTransform?r.lat:e}`,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(a);const o=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(o)}setMark(t){const{lat:e,lng:n}=this.autoTransform?this.transform(t,"wgs84"):t;this.clearOverLay();const r=new this.T.Label({text:`${n},${e}`,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(r);const a=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(a)}oninput(t){this.time&&clearTimeout(this.time),this.time=setTimeout(()=>{this.search(t.target.value),this.time=null},500)}search(t){i.a.get("http://api.tianditu.gov.cn/v2/search",{params:{postStr:{keyWord:t,mapBound:this.mapBound,level:12,queryType:1,start:0,count:10},type:"query",tk:this.tk}}).then(t=>{this.resultList=t.data.pois||[]})}confirmAddress(t){const[e,n]=t.lonlat.split(",");this._setMark({lng:e,lat:n}),this.setCenter({lng:e,lat:n}),this.resultList=[]}setCenter(t){const{lat:e,lng:n}=t;this.map.panTo(new this.T.LngLat(n,e))}transform(t,e){switch(e){case"gcj02":{const e=c.a.wgs84togcj02(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}case"wgs84":{const e=c.a.gcj02towgs84(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}default:return t}}};u([Object(a.Prop)({type:Number,default:108.320004}),l("design:type",Object)],d.prototype,"defaultLng",void 0),u([Object(a.Prop)({type:Number,default:22.82402}),l("design:type",Object)],d.prototype,"defaultLat",void 0),u([Object(a.Prop)({type:String,default:"b6943c056759dd3e6dc5a99faed7f9ab"}),l("design:type",Object)],d.prototype,"tk",void 0),u([Object(a.Prop)({type:String,default:"500px"}),l("design:type",Object)],d.prototype,"height",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!1}),l("design:type",Object)],d.prototype,"readOnly",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!0}),l("design:type",Object)],d.prototype,"autoTransform",void 0),d=u([Object(a.Component)({name:"TMap"})],d);var p=d;n(6);var f=function(t,e,n,r,a,o,i,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):a&&(c=s?function(){a.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:u}}(p,r,[],!1,null,"5ef7124e",null);e.a=f.exports},function(t,e,n){var r,a,o;a=[],void 0===(o="function"==typeof(r=function(){var t=52.35987755982988,e=3.141592653589793,n=6378245,r=.006693421622965943,a=function(t,n){var r=2*(t=+t)-100+3*(n=+n)+.2*n*n+.1*t*n+.2*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(n*e)+40*Math.sin(n/3*e))/3,r+=2*(160*Math.sin(n/12*e)+320*Math.sin(n*e/30))/3},o=function(t,n){var r=300+(t=+t)+2*(n=+n)+.1*t*t+.1*t*n+.1*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(t*e)+40*Math.sin(t/3*e))/3,r+=2*(150*Math.sin(t/12*e)+300*Math.sin(t/30*e))/3},i=function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)};return{bd09togcj02:function(e,n){var r=(e=+e)-.0065,a=(n=+n)-.006,o=Math.sqrt(r*r+a*a)-2e-5*Math.sin(a*t),i=Math.atan2(a,r)-3e-6*Math.cos(r*t);return[o*Math.cos(i),o*Math.sin(i)]},gcj02tobd09:function(e,n){n=+n,e=+e;var r=Math.sqrt(e*e+n*n)+2e-5*Math.sin(n*t),a=Math.atan2(n,e)+3e-6*Math.cos(e*t);return[r*Math.cos(a)+.0065,r*Math.sin(a)+.006]},wgs84togcj02:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),l=s/180*e,d=Math.sin(l);d=1-r*d*d;var p=Math.sqrt(d);return c=180*c/(n*(1-r)/(d*p)*e),[t+(u=180*u/(n/p*Math.cos(l)*e)),s+c]},gcj02towgs84:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),l=s/180*e,d=Math.sin(l);d=1-r*d*d;var p=Math.sqrt(d);return c=180*c/(n*(1-r)/(d*p)*e),[2*t-(t+(u=180*u/(n/p*Math.cos(l)*e))),2*s-(s+c)]}}})?r.apply(e,a):r)||(t.exports=o)},function(t,e,n){var r=n(7);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(8).default)("6cae409b",r,!1,{})},function(t,n){t.exports=e},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var a={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);r&&a[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){"use strict";n(3)},function(t,e,n){"use strict";n.r(e);var r=n(5),a=n.n(r)()((function(t){return t[1]}));a.push([t.i,"\n#t-map-container[data-v-5ef7124e] {\r\n position: relative;\n}\n#keyword[data-v-5ef7124e] {\r\n box-sizing: border-box;\r\n margin: 0;\r\n font-variant: tabular-nums;\r\n list-style: none;\r\n font-feature-settings: 'tnum';\r\n position: relative;\r\n display: inline-block;\r\n width: 100%;\r\n height: 32px;\r\n padding: 4px 11px;\r\n color: rgba(0, 0, 0, 0.65);\r\n font-size: 14px;\r\n line-height: 1.5;\r\n background-color: #fff;\r\n background-image: none;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 4px;\r\n transition: all 0.3s;\n}\n.search-content[data-v-5ef7124e] {\r\n margin-bottom: 4px;\n}\n.result[data-v-5ef7124e] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n background-color: #fff;\r\n padding: 8px 16px;\r\n z-index: 999;\n}\n.result-item[data-v-5ef7124e] {\r\n padding: 2px 0;\r\n border-bottom: #ddd;\r\n font-size: 14px;\r\n z-index: 999;\n}\n.result-item[data-v-5ef7124e]:hover {\r\n background-color: #e6f7ff;\n}\nul[data-v-5ef7124e] {\r\n padding: 0;\n}\nul > li[data-v-5ef7124e] {\r\n list-style: none;\n}\n.clear-info[data-v-5ef7124e] {\r\n text-align: center;\n}\n.address[data-v-5ef7124e] {\r\n margin-left: 4px;\r\n color: #999;\r\n font-size: 12px;\n}\r\n",""]),e.default=a},function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},a=0;a<e.length;a++){var o=e[a],i=o[0],s={id:t+":"+a,css:o[1],media:o[2],sourceMap:o[3]};r[i]?r[i].parts.push(s):n.push(r[i]={id:i,parts:[s]})}return n}n.r(e),n.d(e,"default",(function(){return f}));var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},i=a&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,u=!1,l=function(){},d=null,p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,n,a){u=n,d=a||{};var i=r(t,e);return h(i),function(e){for(var n=[],a=0;a<i.length;a++){var s=i[a];(c=o[s.id]).refs--,n.push(c)}e?h(i=r(t,e)):i=[];for(a=0;a<n.length;a++){var c;if(0===(c=n[a]).refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete o[c.id]}}}}function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=o[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(g(n.parts[a]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(a=0;a<n.parts.length;a++)i.push(g(n.parts[a]));o[n.id]={id:n.id,refs:1,parts:i}}}}function v(){var t=document.createElement("style");return t.type="text/css",i.appendChild(t),t}function g(t){var e,n,r=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(r){if(u)return l;r.parentNode.removeChild(r)}if(p){var a=c++;r=s||(s=v()),e=b.bind(null,r,a,!1),n=b.bind(null,r,a,!0)}else r=v(),e=M.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}var m,y=(m=[],function(t,e){return m[t]=e,m.filter(Boolean).join("\n")});function b(t,e,n,r){var a=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,a);else{var o=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(o,i[e]):t.appendChild(o)}}function M(t,e){var n=e.css,r=e.media,a=e.sourceMap;if(r&&t.setAttribute("media",r),d.ssrId&&t.setAttribute("data-vue-ssr-id",e.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},,function(t,e,n){"use strict";n.r(e);var r=n(1);r.a.install=function(t){t.component(r.a.name,r.a)},e.default=r.a}]).default}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue-property-decorator"),require("axios")):"function"==typeof define&&define.amd?define(["vue-property-decorator","axios"],e):"object"==typeof exports?exports["t-map"]=e(require("vue-property-decorator"),require("axios")):t["t-map"]=e(t["vue-property-decorator"],t.axios)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[t.readOnly?t._e():e("div",{staticClass:"search-content"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],attrs:{type:"text",id:"keyword"},domProps:{value:t.keyword},on:{input:[function(e){e.target.composing||(t.keyword=e.target.value)},t.oninput],focus:function(e){return t.search(t.keyword)}}})]),t._v(" "),e("div",{style:t.containerStyle,attrs:{id:"t-map-container"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.resultList.length,expression:"resultList.length"}],staticClass:"result"},[e("ul",t._l(t.resultList,(function(n,r){return e("li",{key:n.lonlat+r,staticClass:"result-item",on:{click:function(e){return e.stopPropagation(),t.confirmAddress(n)}}},[e("span",[t._v(t._s(n.name))]),t._v(" "),e("span",{staticClass:"address"},[t._v(t._s(n.address))])])})),0),t._v(" "),e("div",{staticClass:"clear-info",on:{click:function(e){e.stopPropagation(),t.resultList=[]}}},[t._v("关闭")])])])])};r._withStripped=!0;var a=n(0),o=n(4),i=n.n(o),s=n(2),c=n.n(s),u=function(t,e,n,r){var a,o=arguments.length,i=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,n,i):a(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let d=class extends a.Vue{constructor(){super(...arguments),this.resultList=[],this.keyword=""}get mapBound(){const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;return`${t-2},${e-2},${t+2},${e+2}`}get containerStyle(){return"width: 100%; height: "+this.height}created(){this.initMapObj()}initMapObj(){let t=document.getElementById("t-map");if(t)return this.initMap();t=document.createElement("script"),t.id="t-map",t.src="http://api.tianditu.gov.cn/api?v=4.0&tk="+this.tk,t.onload=()=>{this.initMap()},document.body.appendChild(t)}initMap(){this.T=window.T,this.map=new this.T.Map("t-map-container");const t=this.defaultLng||108.320004,e=this.defaultLat||22.82402;var n=new this.T.LngLat(t,e);this.map.centerAndZoom(n,15),this.map.addEventListener("click",this.onclick);const r=new this.T.Control.Scale;this.map.addControl(r),setTimeout(()=>{this.$emit("complete",this.map)})}onclick(t){this.$emit("click",t),this.readOnly||this._setMark(t.lnglat)}clearOverLay(){this.map.clearOverLays()}_setMark(t){const{lat:e,lng:n}=t;this.autoTransform?this.$emit("change",this.transform(t,"gcj02")):this.$emit("change",{lat:e,lng:n}),this.clearOverLay();const r=this.transform(t,"gcj02"),a=new this.T.Label({text:`${this.autoTransform?r.lng:n},${this.autoTransform?r.lat:e}`,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(a);const o=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(o)}setMark(t){const{lat:e,lng:n}=this.autoTransform?this.transform(t,"wgs84"):t,r=this.autoTransform?`${t.lng},${t.lat}`:`${n},${e}`;this.clearOverLay();const a=new this.T.Label({text:r,position:new this.T.LngLat(n,e),offset:new this.T.Point(-80,-70)});this.map.addOverLay(a);const o=new this.T.Marker(new this.T.LngLat(n,e));this.map.addOverLay(o)}oninput(t){this.time&&clearTimeout(this.time),this.time=setTimeout(()=>{this.search(t.target.value),this.time=null},500)}search(t){i.a.get("http://api.tianditu.gov.cn/v2/search",{params:{postStr:{keyWord:t,mapBound:this.mapBound,level:12,queryType:1,start:0,count:10},type:"query",tk:this.tk}}).then(t=>{this.resultList=t.data.pois||[]})}confirmAddress(t){const[e,n]=t.lonlat.split(",");this._setMark({lng:e,lat:n}),this.setCenter({lng:e,lat:n}),this.resultList=[]}setCenter(t){const{lat:e,lng:n}=this.autoTransform?this.transform(t,"wgs84"):t;this.map.panTo(new this.T.LngLat(n,e))}transform(t,e){switch(e){case"gcj02":{const e=c.a.wgs84togcj02(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}case"wgs84":{const e=c.a.gcj02towgs84(t.lng,t.lat),[n,r]=e;return{lng:n,lat:r}}default:return t}}};u([Object(a.Prop)({type:Number,default:108.320004}),l("design:type",Object)],d.prototype,"defaultLng",void 0),u([Object(a.Prop)({type:Number,default:22.82402}),l("design:type",Object)],d.prototype,"defaultLat",void 0),u([Object(a.Prop)({type:String,default:"b6943c056759dd3e6dc5a99faed7f9ab"}),l("design:type",Object)],d.prototype,"tk",void 0),u([Object(a.Prop)({type:String,default:"500px"}),l("design:type",Object)],d.prototype,"height",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!1}),l("design:type",Object)],d.prototype,"readOnly",void 0),u([Object(a.Prop)({type:Boolean,default:()=>!0}),l("design:type",Object)],d.prototype,"autoTransform",void 0),d=u([Object(a.Component)({name:"TMap"})],d);var p=d;n(6);var f=function(t,e,n,r,a,o,i,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):a&&(c=s?function(){a.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:u}}(p,r,[],!1,null,"b1f01a12",null);e.a=f.exports},function(t,e,n){var r,a,o;a=[],void 0===(o="function"==typeof(r=function(){var t=52.35987755982988,e=3.141592653589793,n=6378245,r=.006693421622965943,a=function(t,n){var r=2*(t=+t)-100+3*(n=+n)+.2*n*n+.1*t*n+.2*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(n*e)+40*Math.sin(n/3*e))/3,r+=2*(160*Math.sin(n/12*e)+320*Math.sin(n*e/30))/3},o=function(t,n){var r=300+(t=+t)+2*(n=+n)+.1*t*t+.1*t*n+.1*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*e)+20*Math.sin(2*t*e))/3,r+=2*(20*Math.sin(t*e)+40*Math.sin(t/3*e))/3,r+=2*(150*Math.sin(t/12*e)+300*Math.sin(t/30*e))/3},i=function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)};return{bd09togcj02:function(e,n){var r=(e=+e)-.0065,a=(n=+n)-.006,o=Math.sqrt(r*r+a*a)-2e-5*Math.sin(a*t),i=Math.atan2(a,r)-3e-6*Math.cos(r*t);return[o*Math.cos(i),o*Math.sin(i)]},gcj02tobd09:function(e,n){n=+n,e=+e;var r=Math.sqrt(e*e+n*n)+2e-5*Math.sin(n*t),a=Math.atan2(n,e)+3e-6*Math.cos(e*t);return[r*Math.cos(a)+.0065,r*Math.sin(a)+.006]},wgs84togcj02:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),l=s/180*e,d=Math.sin(l);d=1-r*d*d;var p=Math.sqrt(d);return c=180*c/(n*(1-r)/(d*p)*e),[t+(u=180*u/(n/p*Math.cos(l)*e)),s+c]},gcj02towgs84:function(t,s){if(i(t=+t,s=+s))return[t,s];var c=a(t-105,s-35),u=o(t-105,s-35),l=s/180*e,d=Math.sin(l);d=1-r*d*d;var p=Math.sqrt(d);return c=180*c/(n*(1-r)/(d*p)*e),[2*t-(t+(u=180*u/(n/p*Math.cos(l)*e))),2*s-(s+c)]}}})?r.apply(e,a):r)||(t.exports=o)},function(t,e,n){var r=n(7);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(8).default)("29e9259c",r,!1,{})},function(t,n){t.exports=e},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var a={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);r&&a[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){"use strict";n(3)},function(t,e,n){"use strict";n.r(e);var r=n(5),a=n.n(r)()((function(t){return t[1]}));a.push([t.i,"\n#t-map-container[data-v-b1f01a12] {\r\n position: relative;\n}\n#keyword[data-v-b1f01a12] {\r\n box-sizing: border-box;\r\n margin: 0;\r\n font-variant: tabular-nums;\r\n list-style: none;\r\n font-feature-settings: 'tnum';\r\n position: relative;\r\n display: inline-block;\r\n width: 100%;\r\n height: 32px;\r\n padding: 4px 11px;\r\n color: rgba(0, 0, 0, 0.65);\r\n font-size: 14px;\r\n line-height: 1.5;\r\n background-color: #fff;\r\n background-image: none;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 4px;\r\n transition: all 0.3s;\n}\n.search-content[data-v-b1f01a12] {\r\n margin-bottom: 4px;\n}\n.result[data-v-b1f01a12] {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n background-color: #fff;\r\n padding: 8px 16px;\r\n z-index: 999;\n}\n.result-item[data-v-b1f01a12] {\r\n padding: 2px 0;\r\n border-bottom: #ddd;\r\n font-size: 14px;\r\n z-index: 999;\n}\n.result-item[data-v-b1f01a12]:hover {\r\n background-color: #e6f7ff;\n}\nul[data-v-b1f01a12] {\r\n padding: 0;\n}\nul > li[data-v-b1f01a12] {\r\n list-style: none;\n}\n.clear-info[data-v-b1f01a12] {\r\n text-align: center;\n}\n.address[data-v-b1f01a12] {\r\n margin-left: 4px;\r\n color: #999;\r\n font-size: 12px;\n}\r\n",""]),e.default=a},function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},a=0;a<e.length;a++){var o=e[a],i=o[0],s={id:t+":"+a,css:o[1],media:o[2],sourceMap:o[3]};r[i]?r[i].parts.push(s):n.push(r[i]={id:i,parts:[s]})}return n}n.r(e),n.d(e,"default",(function(){return f}));var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},i=a&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,u=!1,l=function(){},d=null,p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,n,a){u=n,d=a||{};var i=r(t,e);return h(i),function(e){for(var n=[],a=0;a<i.length;a++){var s=i[a];(c=o[s.id]).refs--,n.push(c)}e?h(i=r(t,e)):i=[];for(a=0;a<n.length;a++){var c;if(0===(c=n[a]).refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete o[c.id]}}}}function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=o[n.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](n.parts[a]);for(;a<n.parts.length;a++)r.parts.push(g(n.parts[a]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(a=0;a<n.parts.length;a++)i.push(g(n.parts[a]));o[n.id]={id:n.id,refs:1,parts:i}}}}function v(){var t=document.createElement("style");return t.type="text/css",i.appendChild(t),t}function g(t){var e,n,r=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(r){if(u)return l;r.parentNode.removeChild(r)}if(p){var a=c++;r=s||(s=v()),e=b.bind(null,r,a,!1),n=b.bind(null,r,a,!0)}else r=v(),e=M.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}var m,y=(m=[],function(t,e){return m[t]=e,m.filter(Boolean).join("\n")});function b(t,e,n,r){var a=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,a);else{var o=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(o,i[e]):t.appendChild(o)}}function M(t,e){var n=e.css,r=e.media,a=e.sourceMap;if(r&&t.setAttribute("media",r),d.ssrId&&t.setAttribute("data-vue-ssr-id",e.id),a&&(n+="\n/*# sourceURL="+a.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},,function(t,e,n){"use strict";n.r(e);var r=n(1);r.a.install=function(t){t.component(r.a.name,r.a)},e.default=r.a}]).default}));
{
"name": "@rjgf/rj-components",
"version": "1.0.5",
"version": "1.0.6",
"description": "rj-components",

@@ -5,0 +5,0 @@ "main": "./dist/main.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc