bbj-screen-widget 2.4.66 → 2.4.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/bbj-screen-widget.d.ts +38 -33
  2. package/bbj-screen-widget.metadata.json +1 -1
  3. package/bundles/bbj-screen-widget-core.umd.js +148 -5
  4. package/bundles/bbj-screen-widget-core.umd.js.map +1 -1
  5. package/bundles/bbj-screen-widget-core.umd.min.js +1 -1
  6. package/bundles/bbj-screen-widget-core.umd.min.js.map +1 -1
  7. package/bundles/bbj-screen-widget.umd.js +1886 -401
  8. package/bundles/bbj-screen-widget.umd.js.map +1 -1
  9. package/bundles/bbj-screen-widget.umd.min.js +1 -1
  10. package/bundles/bbj-screen-widget.umd.min.js.map +1 -1
  11. package/core/bbj-screen-widget-core.metadata.json +1 -1
  12. package/core/public_api.d.ts +2 -0
  13. package/core/util/map.util.d.ts +23 -0
  14. package/core/util/scale.util.d.ts +4 -0
  15. package/esm2015/bbj-screen-widget.js +39 -34
  16. package/esm2015/core/public_api.js +3 -1
  17. package/esm2015/core/service/baidu-map.service.js +2 -2
  18. package/esm2015/core/util/map.util.js +104 -0
  19. package/esm2015/core/util/scale.util.js +33 -0
  20. package/esm2015/lib/custom-baidu-map/baidu-fence/baidu-fence.component.js +168 -88
  21. package/esm2015/lib/custom-baidu-map/baidu-lushu/baidu-lushu.component.js +222 -0
  22. package/esm2015/lib/custom-baidu-map/custom-baidu-map.component.js +5 -42
  23. package/esm2015/lib/custom-baidu-map/custom-baidu-map.module.js +6 -1
  24. package/esm2015/lib/screen-widget.module.js +7 -1
  25. package/esm2015/lib/tianditu/base-layer.js +80 -0
  26. package/esm2015/lib/tianditu/tianditu-marker/tianditu-marker.component.js +666 -0
  27. package/esm2015/lib/tianditu/tianditu.component.js +399 -0
  28. package/esm2015/lib/tianditu/tianditu.module.js +21 -0
  29. package/fesm2015/bbj-screen-widget-core.js +139 -2
  30. package/fesm2015/bbj-screen-widget-core.js.map +1 -1
  31. package/fesm2015/bbj-screen-widget.js +1581 -176
  32. package/fesm2015/bbj-screen-widget.js.map +1 -1
  33. package/lib/custom-baidu-map/baidu-fence/baidu-fence.component.d.ts +20 -2
  34. package/lib/custom-baidu-map/baidu-lushu/baidu-lushu.component.d.ts +31 -0
  35. package/lib/custom-baidu-map/custom-baidu-map.component.d.ts +1 -1
  36. package/lib/tianditu/base-layer.d.ts +20 -0
  37. package/lib/tianditu/tianditu-marker/tianditu-marker.component.d.ts +63 -0
  38. package/lib/tianditu/tianditu.component.d.ts +53 -0
  39. package/lib/tianditu/tianditu.module.d.ts +4 -0
  40. package/package.json +1 -1
  41. package/src/assets/img/screen/car.png +0 -0
  42. package/src/assets/js/BMapGL/Lushu.js +815 -0
  43. package/src/assets/js/BMapGL/Lushu.min.js +1 -0
@@ -0,0 +1 @@
1
+ var BMapGLLib=window.BMapGLLib=BMapGLLib||{};(function(){var T;var q=T=q||{version:'gl 1.0'};q.guid='$BAIDU$';(function(){window[q.guid]=window[q.guid]||{};q.dom=q.dom||{};q.dom.g=function(a){if('string'==typeof a||a instanceof String){return document.getElementById(a)}else if(a&&a.nodeName&&(a.nodeType==1||a.nodeType==9)){return a}return null};q.g=q.G=q.dom.g;q.lang=q.lang||{};q.lang.isString=function(a){return'[object String]'==Object.prototype.toString.call(a)};q.isString=q.lang.isString;q.dom._g=function(a){if(q.lang.isString(a)){return document.getElementById(a)}return a};q._g=q.dom._g;q.dom.getDocument=function(a){a=q.dom.g(a);return a.nodeType==9?a:a.ownerDocument||a.document};q.browser=q.browser||{};q.browser.ie=q.ie=/msie (\d+\.\d+)/i.test(navigator.userAgent)?(document.documentMode||+RegExp['\x241']):undefined;q.dom.getComputedStyle=function(a,b){a=q.dom._g(a);var c=q.dom.getDocument(a),styles;if(c.defaultView&&c.defaultView.getComputedStyle){styles=c.defaultView.getComputedStyle(a,null);if(styles){return styles[b]||styles.getPropertyValue(b)}}return''};q.dom._styleFixer=q.dom._styleFixer||{};q.dom._styleFilter=q.dom._styleFilter||[];q.dom._styleFilter.filter=function(a,b,c){var d=q.dom._styleFilter;var e;for(var i=0;e=d[i];i++){if(e=e[c]){b=e(a,b)}}return b};q.string=q.string||{};q.string.toCamelCase=function(b){if(b.indexOf('-')<0&&b.indexOf('_')<0){return b}return b.replace(/[-_][^-_]/g,function(a){return a.charAt(1).toUpperCase()})};q.dom.getStyle=function(a,b){var c=q.dom;a=c.g(a);b=q.string.toCamelCase(b);var d=a.style[b]||(a.currentStyle?a.currentStyle[b]:'')||c.getComputedStyle(a,b);if(!d){var e=c._styleFixer[b];if(e){d=e.get?e.get(a):q.dom.getStyle(a,e)}}if(e=c._styleFilter){d=e.filter(b,d,'get')}return d};q.getStyle=q.dom.getStyle;q.dom._NAME_ATTRS=(function(){var a={'cellpadding':'cellPadding','cellspacing':'cellSpacing','colspan':'colSpan','rowspan':'rowSpan','valign':'vAlign','usemap':'useMap','frameborder':'frameBorder'};if(q.browser.ie<8){a['for']='htmlFor';a['class']='className'}else{a['htmlFor']='for';a['className']='class'}return a})();q.dom.setAttr=function(a,b,c){a=q.dom.g(a);if('style'==b){a.style.cssText=c}else{b=q.dom._NAME_ATTRS[b]||b;a.setAttribute(b,c)}return a};q.setAttr=q.dom.setAttr;q.dom.setAttrs=function(a,b){a=q.dom.g(a);for(var c in b){q.dom.setAttr(a,c,b[c])}return a};q.setAttrs=q.dom.setAttrs;q.dom.create=function(a,b){var c=document.createElement(a),attributes=b||{};return q.dom.setAttrs(c,attributes)};q.object=q.object||{};q.extend=q.object.extend=function(a,b){for(var p in b){if(b.hasOwnProperty(p)){a[p]=b[p]}}return a}})();WORLD_SIZE_MC_HALF=20037726.372307256;WORLD_SIZE_MC=WORLD_SIZE_MC_HALF*2;var r=BMapGLLib.LuShu=function(a,b,c){if(!b||b.length<1){return}this._map=a;if(c['geodesic']){this.path=getGeodesicPath(b)}else{this.path=b}this.i=0;this._setTimeoutQuene=[];this._opts={icon:null,speed:400,defaultContent:''};if(!c['landmarkPois']){c['landmarkPois']=[]}this._setOptions(c);this._rotation=0;if(!(this._opts.icon instanceof BMapGL.Icon)){this._opts.icon=defaultIcon}}r.prototype._setOptions=function(a){if(!a){return}for(var p in a){if(a.hasOwnProperty(p)){this._opts[p]=a[p]}}}r.prototype.start=function(){var a=this,len=a.path.length;if(a.i&&a.i<len-1){if(!a._fromPause){return}else if(!a._fromStop){a._moveNext(++a.i)}}else{a._addMarker();a._timeoutFlag=setTimeout(function(){a._addInfoWin();if(a._opts.defaultContent==""){a.hideInfoWindow()}a._moveNext(a.i)},400)}this._fromPause=false;this._fromStop=false};r.prototype.stop=function(){this.i=0;this._fromStop=true;clearInterval(this._intervalFlag);this._clearTimeout();for(var i=0,t=this._opts.landmarkPois,len=t.length;i<len;i++){t[i].bShow=false}};r.prototype.clear=function(){this._clear()};r.prototype.pause=function(){clearInterval(this._intervalFlag);this._fromPause=true;this._clearTimeout()};r.prototype.hideInfoWindow=function(){this._overlay._div.style.visibility='hidden'};r.prototype.showInfoWindow=function(){this._overlay._div.style.visibility='visible'};q.object.extend(r.prototype,{_addMarker:function(a){if(this._marker){this.stop();this._map.removeOverlay(this._marker);this._map.removeOverlay(this._markerL);this._map.removeOverlay(this._markerR);clearTimeout(this._timeoutFlag)}this._overlay&&this._map.removeOverlay(this._overlay);var b=new BMapGL.Marker(this.path[0]);this._opts.icon&&b.setIcon(this._opts.icon);this._map.addOverlay(b);b.setAnimation(BMAP_ANIMATION_DROP);this._marker=b;var c=new BMapGL.Marker(this.path[0],{left:true});this._opts.icon&&c.setIcon(this._opts.icon);this._map.addOverlay(c);c.setAnimation(BMAP_ANIMATION_DROP);this._markerL=c;var d=new BMapGL.Marker(this.path[0],{right:true});this._opts.icon&&d.setIcon(this._opts.icon);this._map.addOverlay(d);d.setAnimation(BMAP_ANIMATION_DROP);this._markerR=d},_addInfoWin:function(){var a=this;var b=new CustomOverlay(a._marker.getPosition(),a._opts.defaultContent);b.setRelatedClass(this);this._overlay=b;this._map.addOverlay(b)},_getMercator:function(a){return this._map.getMapType().getProjection().lngLatToPoint(a)},_getDistance:function(a,b){return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2))},_move:function(b,c,d){var e=this,currentCount=0,timer=10,step=this._opts.speed/(1000/timer),init_pos=BMapGL.Projection.convertLL2MC(b),target_pos=BMapGL.Projection.convertLL2MC(c);init_pos=new BMapGL.Pixel(init_pos.lng,init_pos.lat);target_pos=new BMapGL.Pixel(target_pos.lng,target_pos.lat);var f=e._getDistance(init_pos,target_pos);var g=null;if(f>30037726){if(target_pos.x<init_pos.x){target_pos.x+=WORLD_SIZE_MC;g='right'}else{target_pos.x-=WORLD_SIZE_MC;g='left'}}var h=Math.round(e._getDistance(init_pos,target_pos)/step);if(h<1){const t=setTimeout(()=>{e._moveNext(++e.i)},0)e._setTimeoutQuene.push(t)}e._intervalFlag=setInterval(function(){if(currentCount>=h){clearInterval(e._intervalFlag);if(e.i>e.path.length){return}e._moveNext(++e.i)}else{currentCount++;var x=d(init_pos.x,target_pos.x,currentCount,h),y=d(init_pos.y,target_pos.y,currentCount,h),pos=BMapGL.Projection.convertMC2LL(new BMapGL.Point(x,y));if(pos.lng>180){pos.lng=pos.lng-360}if(pos.lng<-180){pos.lng=pos.lng+360}if(currentCount==1){var a=null;if(e.i-1>=0){a=e.path[e.i-1]}if(e._opts.enableRotation==true){e.setRotation(a,b,c,g)}if(e._opts.autoView){if(!e._map.getBounds().containsPoint(pos)){e._map.setCenter(pos)}}}e._marker.setPosition(pos);e._markerL.setPosition(pos);e._markerR.setPosition(pos);e._setInfoWin(pos)}},timer)},setRotation:function(a,b,c,d){var e=this;var f=0;b=e._map.pointToPixel(b);c=e._map.pointToPixel(c);if(c.x!=b.x){var g=(c.y-b.y)/(c.x-b.x),atan=Math.atan(g);f=atan*360/(2*Math.PI);if((!d&&c.x<b.x)||(d==='left')){f=-f+90+90}else{f=-f}e._marker.setRotation(-f);e._markerL.setRotation(-f);e._markerR.setRotation(-f)}else{var h=c.y-b.y;var i=0;if(h>0){i=-1}else{i=1}e._marker.setRotation(-i*90);e._markerL.setRotation(-i*90);e._markerR.setRotation(-i*90)}return},linePixellength:function(a,b){return Math.sqrt(Math.abs(a.x-b.x)*Math.abs(a.x-b.x)+Math.abs(a.y-b.y)*Math.abs(a.y-b.y))},pointToPoint:function(a,b){return Math.abs(a.x-b.x)*Math.abs(a.x-b.x)+Math.abs(a.y-b.y)*Math.abs(a.y-b.y)},_moveNext:function(a){var b=this;if(a<this.path.length-1){b._move(b.path[a],b.path[a+1],b._tween.linear)}},_setInfoWin:function(a){var b=this;if(!b._overlay){return}b._overlay.setPosition(a,b._marker.getIcon().size);var c=b._troughPointIndex(a);if(c!=-1){clearInterval(b._intervalFlag);b._overlay.setHtml(b._opts.landmarkPois[c].html);b._overlay.setPosition(a,b._marker.getIcon().size);b._pauseForView(c)}else{b._overlay.setHtml(b._opts.defaultContent)}},_pauseForView:function(a){var b=this;var t=setTimeout(function(){b._moveNext(++b.i)},b._opts.landmarkPois[a].pauseTime*1000);b._setTimeoutQuene.push(t)},_clearTimeout:function(){for(var i in this._setTimeoutQuene){clearTimeout(this._setTimeoutQuene[i])}this._setTimeoutQuene.length=0},_clear:function(){var a=this;if(a._marker){a.stop();a._map.removeOverlay(a._marker);a._map.removeOverlay(a._markerL);a._map.removeOverlay(a._markerR);clearTimeout(a._timeoutFlag);a._marker=null;a._markerL=null;a._markerR=null}if(a._overlay){a._map.removeOverlay(a._overlay);a._overlay=null}},_tween:{linear:function(a,e,f,g){var b=a;var c=e-a;var t=f;var d=g;return c*t/d+b}},_troughPointIndex:function(a){var t=this._opts.landmarkPois;var b;for(var i=0,len=t.length;i<len;i++){if(!t[i].bShow){b=this._map.getDistance(new BMapGL.Point(t[i].lng,t[i].lat),a);if(b<10){t[i].bShow=true;return i}}}return-1}});function getGeodesicPath(a){var b=[];for(var i=0;i<a.length-1;i++){var c=calcGreatCirclePath(a[i],a[i+1]);b=b.concat(c)}b=b.concat(a[a.length-1])return b}function calcGreatCirclePath(a,b){if(a.equals(b)){return[a]}var c=BMapGL.Projection.getDistance(toRadian(a.lng),toRadian(a.lat),toRadian(b.lng),toRadian(b.lat));var c=BMapGL.Projection.getDistanceByLL(a,b);if(c<250000){return[a]}var d=[];var e=Math.round(c/150000);var f=calcAngularDistance(a,b);d.push(a);for(var i=0;i<e;i++){var g=calcMiddlePoint(a,b,i/e,f);d.push(g)}d.push(b);return d}function calcMiddlePoint(c,d,f,e){var g=c.lat;var h=d.lat;var i=c.lng;var j=d.lng;var k=toRadian(g);var l=toRadian(h);var m=toRadian(i);var n=toRadian(j);var a=Math.sin((1-f)*e)/Math.sin(e);var b=Math.sin(f*e)/Math.sin(e);var x=a*Math.cos(k)*Math.cos(m)+b*Math.cos(l)*Math.cos(n);var y=a*Math.cos(k)*Math.sin(m)+b*Math.cos(l)*Math.sin(n);var z=a*Math.sin(k)+b*Math.sin(l);var o=Math.atan2(z,Math.sqrt(Math.pow(x,2)+Math.pow(y,2)));var p=Math.atan2(y,x);return new BMapGL.Point(toAngle(p),toAngle(o))}function toRadian(a){return a*Math.PI/180}function toAngle(a){return a/Math.PI*180}function calcAngularDistance(a,b){var c=toRadian(a.lat);var d=toRadian(b.lat);var e=toRadian(a.lng);var f=toRadian(b.lng);return Math.acos(Math.sin(c)*Math.sin(d)+Math.cos(c)*Math.cos(d)*Math.cos(Math.abs(f-e)))}function CustomOverlay(a,b){this._point=a;this._html=b}CustomOverlay.prototype=new BMapGL.Overlay();CustomOverlay.prototype.initialize=function(a){var b=this._div=q.dom.create('div',{style:'border:solid 1px #ccc;width:auto;min-width:50px;text-align:center;position:absolute;background:#fff;color:#000;font-size:12px;border-radius: 10px;padding:5px;white-space: nowrap;'});b.innerHTML=this._html;a.getPanes().floatPane.appendChild(b);this._map=a;return b}CustomOverlay.prototype.draw=function(){this.setPosition(this.lushuMain._marker.getPosition(),this.lushuMain._marker.getIcon().size)}q.object.extend(CustomOverlay.prototype,{setPosition:function(a,b){var c=this._map.pointToOverlayPixel(a);var d=q.dom.getStyle(this._div,'width');var e=q.dom.getStyle(this._div,'height');var f=parseInt(this._div.clientWidth||d,10);var g=parseInt(this._div.clientHeight||e,10);this._div.style.left=c.x-f/2+'px';this._div.style.bottom=-(c.y-b.height)+'px'},setHtml:function(a){this._div.innerHTML=a},setRelatedClass:function(a){this.lushuMain=a}})})();