itowns 2.37.0 → 2.38.2

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 (77) hide show
  1. package/README.md +12 -1
  2. package/changelog.md +101 -0
  3. package/dist/debug.js +1 -1
  4. package/dist/debug.js.LICENSE.txt +2 -2
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +1 -1
  7. package/dist/itowns.js.LICENSE.txt +2 -2
  8. package/dist/itowns.js.map +1 -1
  9. package/dist/itowns_widgets.js +1 -1
  10. package/dist/itowns_widgets.js.map +1 -1
  11. package/examples/config.json +4 -1
  12. package/examples/css/example.css +21 -1
  13. package/examples/css/widgets.css +118 -6
  14. package/examples/images/code-logo.svg +43 -0
  15. package/examples/index.html +5 -5
  16. package/examples/mars.html +0 -1
  17. package/examples/misc_orthographic_camera.html +7 -19
  18. package/examples/vector_tile_3d_mesh.html +155 -0
  19. package/examples/vector_tile_raster_3d.html +0 -5
  20. package/examples/view_25d_map.html +6 -19
  21. package/examples/view_2d_map.html +6 -19
  22. package/examples/view_3d_map.html +106 -81
  23. package/examples/widgets_minimap.html +3 -1
  24. package/examples/widgets_navigation.html +6 -1
  25. package/examples/widgets_scale.html +96 -0
  26. package/examples/widgets_searchbar.html +124 -0
  27. package/lib/Controls/PlanarControls.js +10 -42
  28. package/lib/Converter/Feature2Mesh.js +225 -61
  29. package/lib/Converter/Feature2Texture.js +4 -3
  30. package/lib/Converter/convertToTile.js +10 -5
  31. package/lib/Core/Feature.js +57 -30
  32. package/lib/Core/MainLoop.js +136 -62
  33. package/lib/Core/TileMesh.js +21 -5
  34. package/lib/Core/View.js +46 -15
  35. package/lib/Layer/FeatureGeometryLayer.js +37 -10
  36. package/lib/Layer/GeoidLayer.js +17 -6
  37. package/lib/Layer/GeometryLayer.js +6 -54
  38. package/lib/Layer/OrientedImageLayer.js +1 -0
  39. package/lib/Layer/RasterLayer.js +3 -1
  40. package/lib/Layer/ReferencingLayerProperties.js +50 -0
  41. package/lib/Main.js +1 -1
  42. package/lib/Parser/B3dmParser.js +3 -2
  43. package/lib/Parser/GeoJsonParser.js +29 -7
  44. package/lib/Parser/VectorTileParser.js +5 -4
  45. package/lib/Parser/deprecated/LegacyGLTFLoader.js +3 -3
  46. package/lib/Process/3dTilesProcessing.js +3 -3
  47. package/lib/Process/FeatureProcessing.js +36 -86
  48. package/lib/Process/LayeredMaterialNodeProcessing.js +9 -3
  49. package/lib/Process/ObjectRemovalHelper.js +4 -0
  50. package/lib/Provider/3dTilesProvider.js +2 -7
  51. package/lib/Provider/Fetcher.js +5 -2
  52. package/lib/Provider/TileProvider.js +18 -2
  53. package/lib/Renderer/Camera.js +33 -12
  54. package/lib/Renderer/ColorLayersOrdering.js +3 -1
  55. package/lib/Renderer/LayeredMaterial.js +32 -7
  56. package/lib/Renderer/OBB.js +8 -4
  57. package/lib/Renderer/OrientedImageMaterial.js +8 -5
  58. package/lib/Renderer/PointsMaterial.js +1 -0
  59. package/lib/Renderer/RenderMode.js +3 -1
  60. package/lib/Renderer/Shader/ShaderChunk.js +5 -1
  61. package/lib/Renderer/c3DEngine.js +9 -6
  62. package/lib/Source/FileSource.js +8 -1
  63. package/lib/Source/VectorTilesSource.js +5 -0
  64. package/lib/Source/WFSSource.js +9 -3
  65. package/lib/ThreeExtended/{WebGL.js → capabilities/WebGL.js} +8 -7
  66. package/lib/ThreeExtended/loaders/GLTFLoader.js +3 -4
  67. package/lib/Utils/DEMUtils.js +3 -1
  68. package/lib/Utils/gui/Main.js +39 -0
  69. package/lib/Utils/gui/Minimap.js +195 -0
  70. package/lib/Utils/gui/Navigation.js +322 -0
  71. package/lib/Utils/gui/Scale.js +154 -0
  72. package/lib/Utils/gui/Searchbar.js +299 -0
  73. package/lib/Utils/gui/Widget.js +119 -0
  74. package/package.json +27 -22
  75. package/examples/images/compass.svg +0 -60
  76. package/examples/images/widget-logo.svg +0 -66
  77. package/examples/js/Scale.js +0 -41
@@ -1,2 +1,2 @@
1
- "use strict";!function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("itowns_widgets",[],o):"object"==typeof exports?exports.itowns_widgets=o():t.itowns_widgets=o()}(self,(function(){return(self.webpackChunk_name_=self.webpackChunk_name_||[]).push([[318],{58702:(t,o,e)=>{e.r(o),e.d(o,{Minimap:()=>g,Navigation:()=>m});var n=e(15671),i=e(43144),a=e(79340),r=e(82963),s=e(61120),c=e(95769);const l=(0,i.Z)((function t(o){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;(0,n.Z)(this,t),this.parentElement=e.parentElement||o.domElement,this.position=e.position||i.position,["top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"].includes(this.position)||(console.warn("'position' optional parameter for 'Widget' constructor is not a valid option. "+"It will be set to '".concat(i.position,"'.")),this.position=i.position),this.domElement=document.createElement("div"),this.parentElement.appendChild(this.domElement),this.domElement.style.width="".concat(e.width||e.size||i.width,"px"),this.domElement.style.height="".concat(e.height||e.size||i.height,"px");var a=this.position.split("-");if(this.domElement.classList.add("".concat(a[0],"-widget")),a[1])this.domElement.classList.add("".concat(a[1],"-widget"));else switch(a[0]){case"top":case"bottom":this.domElement.style.left="calc(50% - ".concat(this.domElement.offsetWidth/2,"px)");break;case"left":case"right":this.domElement.style.top="calc(50% - ".concat(this.domElement.offsetHeight/2,"px)")}e.translate&&(this.domElement.style.transform="translate(".concat(e.translate.x||0,"px, ").concat(e.translate.y||0,"px)"))}));var d={parentElement:document.body,displayCompass:!0,display3DToggle:!0,displayZoomIn:!0,displayZoomOut:!0,animationDuration:500,position:"bottom-left",direction:"column"};const m=function(t){(0,a.Z)(m,t);var o,e,l=(o=m,e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,s.Z)(o);if(e){var i=(0,s.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,r.Z)(this,t)});function m(t){var o,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.Z)(this,m),["top","bottom","left","right"].includes(e.position)&&(console.warn("'position' optional parameter for 'Navigation' is not a valid option. "+"It will be set to '".concat(d.position,"'.")),e.position=d.position),(o=l.call(this,t,e,d)).direction=e.direction||d.direction,["column","row"].includes(o.direction)||(console.warn("'direction' optional parameter for 'Navigation' constructor is not a valid option. "+"It will be set to '".concat(d.direction,"'.")),o.direction=d.direction),o.animationDuration=void 0===e.animationDuration?d.animationDuration:e.animationDuration,o.domElement.id="widgets-navigation",o.domElement.classList.add("".concat(o.direction,"-widget")),(void 0===e.displayCompass?d.displayCompass:e.displayCompass)&&(o.compass=o.addButton("compass","",(function(){t.controls.lookAtCoordinate({heading:0,tilt:89.5,time:o.animationDuration})}),"widgets"),t.addEventListener(c.b.CAMERA_MOVED,(function(t){o.compass.style.transform="rotate(".concat(-t.heading,"deg)")}))),(void 0===e.display3DToggle?d.display3DToggle:e.display3DToggle)&&(o.switch3dButton=o.addButton("3d-button","3D",(function(){var e;e=t.controls.getTilt()<89?89.5:40,t.controls.lookAtCoordinate({tilt:e,time:o.animationDuration})})),t.addEventListener(c.b.CAMERA_MOVED,(function(t){o.switch3dButton.innerHTML=t.tilt<89?"2D":"3D"}))),(void 0===e.displayZoomIn?d.displayZoomIn:e.displayZoomIn)&&(o.zoomInButton=o.addButton("zoom-in-button",'<span class="widget-zoom-button-logo"></span>',(function(){t.controls.lookAtCoordinate({zoom:Math.min(20,t.controls.getZoom()+1),time:o.animationDuration})}),"zoom-button-bar")),(void 0===e.displayZoomOut?d.displayZoomOut:e.displayZoomOut)&&(o.zoomOutButton=o.addButton("zoom-out-button",'<span id="zoom-out-logo" class="widget-zoom-button-logo"></span>',(function(){t.controls.lookAtCoordinate({zoom:Math.max(3,t.controls.getZoom()-1),time:o.animationDuration})}),"zoom-button-bar")),o}return(0,i.Z)(m,[{key:"addButton",value:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=arguments.length>3?arguments[3]:void 0,i=document.getElementById(n);i||(i=this.addButtonBar(n));var a=document.createElement("button");return a.className="widget-button",a.id=t,a.innerHTML=o,i.appendChild(a),a.addEventListener("click",e),a}},{key:"addButtonBar",value:function(t){var o=document.createElement("div");return o.className="widget-button-bar",t&&(o.id=t),this.domElement.appendChild(o),o}}]),m}(l);var u=e(60145),p=e(49469),f=e(48682),h=e(800);var v={minScale:2e-6,maxScale:2e-9,zoomRatio:1/30,width:150,height:150,position:"bottom-left"};const g=function(t){(0,a.Z)(l,t);var o,e,c=(o=l,e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,s.Z)(o);if(e){var i=(0,s.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,r.Z)(this,t)});function l(t,o){var e,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,n.Z)(this,l),!t.isGlobeView)throw new Error("'Minimap' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");if(!o.isColorLayer)throw new Error("'layer' parameter form 'Minimap' constructor should be a 'ColorLayer'.");if((e=c.call(this,t,i,v)).minScale=i.minScale||v.minScale,e.maxScale=i.maxScale||v.maxScale,e.zoomRatio=i.zoomRatio||v.zoomRatio,e.domElement.id="widgets-minimap",i.cursor){var a=document.createElement("div");a.id="cursor-wrapper",e.domElement.appendChild(a),"string"==typeof i.cursor?a.innerHTML=i.cursor:i.cursor instanceof HTMLElement&&a.appendChild(i.cursor)}e.view=new f.Z(e.domElement,o.source.extent,{camera:{type:h.P.ORTHOGRAPHIC},placement:o.source.extent,noControls:!0,maxSubdivisionLevel:t.tileLayer.maxSubdivisionLevel}),e.view.addLayer(o),t.domElement.focus(),e.domElement.addEventListener("pointerdown",(function(t){t.stopPropagation(),t.preventDefault()}));var r=e.view.camera.camera3D,s=e.view.getScale(i.pitch),d=r.zoom*e.maxScale/s,m=r.zoom*e.minScale/s,g=new u.Z(t.referenceCrs),y=new u.Z(e.view.referenceCrs),w=t.controls.getCameraTargetPosition();return t.addFrameRequester(p.Ao.AFTER_RENDER,(function(){var o=t.camera.camera3D.position.distanceTo(w),n=t.getScaleFromDistance(i.pitch,o);r.zoom=e.zoomRatio*m*n/e.minScale,r.zoom=Math.min(Math.max(r.zoom,d),m),r.updateProjectionMatrix(),g.setFromVector3(t.controls.getCameraTargetPosition()),g.as(e.view.referenceCrs,y),r.position.x=y.x,r.position.y=y.y,r.updateMatrixWorld(!0),e.view.notifyChange(r)})),e}return(0,i.Z)(l)}(l)}},t=>(58702,t(t.s=58702))])}));
1
+ "use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("itowns_widgets",[],e):"object"==typeof exports?exports.itowns_widgets=e():t.itowns_widgets=e()}(self,(()=>(self.webpackChunkitowns=self.webpackChunkitowns||[]).push([[318],{75462:(t,e,o)=>{o.r(e),o.d(e,{Minimap:()=>P,Navigation:()=>M,Scale:()=>G,Searchbar:()=>Q});var n=o(15671),i=o(43144),a=o(97326),r=o(79340),c=o(82963),s=o(61120),l=o(13092),d=o(86033),u=o(41933);function m(t,e,o){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,o)}var p=new WeakMap;const f=function(){function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;(0,n.Z)(this,t),m(this,p,{writable:!0,value:void 0}),this.parentElement=o.parentElement||e.domElement,this.position=o.position||i.position,["top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"].includes(this.position)||(console.warn("'position' optional parameter for 'Widget' constructor is not a valid option. "+"It will be set to '".concat(i.position,"'.")),this.position=i.position),this.domElement=document.createElement("div"),this.parentElement.appendChild(this.domElement),this.domElement.style.width="".concat(o.width||o.size||i.width,"px"),this.domElement.style.height="".concat(o.height||o.size||i.height,"px");var a=this.position.split("-");if(this.domElement.classList.add("".concat(a[0],"-widget")),a[1])this.domElement.classList.add("".concat(a[1],"-widget"));else switch(a[0]){case"top":case"bottom":this.domElement.style.left="calc(50% - ".concat(this.domElement.offsetWidth/2,"px)");break;case"left":case"right":this.domElement.style.top="calc(50% - ".concat(this.domElement.offsetHeight/2,"px)")}o.translate&&(this.domElement.style.transform="translate(".concat(o.translate.x||0,"px, ").concat(o.translate.y||0,"px)")),this.domElement.addEventListener("pointerdown",(function(t){t.stopPropagation()})),this.domElement.addEventListener("mousedown",(function(t){t.stopPropagation()}))}return(0,i.Z)(t,[{key:"show",value:function(){this.domElement.style.display=(0,d.Z)(this,p)}},{key:"hide",value:function(){(0,l.Z)(this,p,window.getComputedStyle(this.domElement).display),this.domElement.style.display="none"}}]),t}();function h(t,e){w(t,e),e.add(t)}function v(t,e,o){w(t,e),e.set(t,o)}function w(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(t,e,o){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return o}var E={displayCompass:!0,display3DToggle:!0,displayZoomIn:!0,displayZoomOut:!0,animationDuration:500,position:"bottom-left",direction:"column"},y={id:"compass",content:"",info:"Rotate the camera to face North",parentId:"widgets"},Z={id:"3d-button",content:"3D",info:"Tilt the camera"},b={id:"zoom-in-button",content:'<span class="widget-zoom-button-logo"></span>',info:"Zoom in",parentId:"zoom-button-bar"},x={id:"zoom-out-button",content:'<span id="zoom-out-logo" class="widget-zoom-button-logo"></span>',info:"Zoom out",parentId:"zoom-button-bar"},L=new WeakMap,S=new WeakSet,z=new WeakSet;function C(t){return t.time=this.animationDuration,(0,d.Z)(this,L).controls.lookAtCoordinate(t)}function R(t,e){return this.addButton(t.id,t.content,t.info,e,t.parentId)}const M=function(t){(0,r.Z)(p,t);var e,o,m=(e=p,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,s.Z)(e);if(o){var i=(0,s.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,c.Z)(this,t)});function p(t){var e,o,i,r,c,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,n.Z)(this,p),!t.isGlobeView)throw new Error("'Navigation' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");return["top","bottom","left","right"].includes(s.position)&&(console.warn("'position' optional parameter for 'Navigation' is not a valid option. "+"It will be set to '".concat(E.position,"'.")),s.position=E.position),c=m.call(this,t,s,E),h((0,a.Z)(c),z),h((0,a.Z)(c),S),v((0,a.Z)(c),L,{writable:!0,value:void 0}),(0,l.Z)((0,a.Z)(c),L,t),c.direction=s.direction||E.direction,["column","row"].includes(c.direction)||(console.warn("'direction' optional parameter for 'Navigation' constructor is not a valid option. "+"It will be set to '".concat(E.direction,"'.")),c.direction=E.direction),c.animationDuration=void 0===s.animationDuration?E.animationDuration:s.animationDuration,c.domElement.id="widgets-navigation",c.domElement.classList.add("".concat(c.direction,"-widget")),(null!==(e=s.displayCompass)&&void 0!==e?e:E.displayCompass)&&(c.compass=g((0,a.Z)(c),z,R).call((0,a.Z)(c),y,(function(){g((0,a.Z)(c),S,C).call((0,a.Z)(c),{heading:0,tilt:89.5})})),t.addEventListener(u.b.CAMERA_MOVED,(function(t){c.compass.style.transform="rotate(".concat(-t.heading,"deg)")}))),(null!==(o=s.display3DToggle)&&void 0!==o?o:E.display3DToggle)&&(c.toggle3D=g((0,a.Z)(c),z,R).call((0,a.Z)(c),Z,(function(){g((0,a.Z)(c),S,C).call((0,a.Z)(c),{tilt:(0,d.Z)((0,a.Z)(c),L).controls.getTilt()<89?89.5:40})})),t.addEventListener(u.b.CAMERA_MOVED,(function(t){c.toggle3D.innerHTML=t.tilt<89?"2D":"3D"}))),(null!==(i=s.displayZoomIn)&&void 0!==i?i:E.displayZoomIn)&&(c.zoomIn=g((0,a.Z)(c),z,R).call((0,a.Z)(c),b,(function(){g((0,a.Z)(c),S,C).call((0,a.Z)(c),{zoom:Math.min(20,(0,d.Z)((0,a.Z)(c),L).controls.getZoom()+1)})}))),(null!==(r=s.displayZoomOut)&&void 0!==r?r:E.displayZoomOut)&&(c.zoomOut=g((0,a.Z)(c),z,R).call((0,a.Z)(c),x,(function(){g((0,a.Z)(c),S,C).call((0,a.Z)(c),{zoom:Math.max(3,(0,d.Z)((0,a.Z)(c),L).controls.getZoom()-1)})}))),c}return(0,i.Z)(p,[{key:"addButton",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=arguments.length>4?arguments[4]:void 0,r=document.getElementById(a);r||(r=this.addButtonBar(a));var c=document.createElement("button");return c.className="widget-button",c.id=t,c.innerHTML=o,c.title=n,c.onclick=i,r.appendChild(c),c.tabIndex=-1,window.addEventListener("pointerup",(function(){document.activeElement===c&&(0,d.Z)(e,L).domElement.focus()})),c}},{key:"addButtonBar",value:function(t){var e=document.createElement("div");return e.className="widget-button-bar",t&&(e.id=t),this.domElement.appendChild(e),e}}]),p}(f);var T=o(60145),D=o(49469),k=o(48682),I=o(800);var A={minScale:2e-6,maxScale:2e-9,zoomRatio:1/30,width:150,height:150,position:"bottom-left"};const P=function(t){(0,r.Z)(l,t);var e,o,a=(e=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,s.Z)(e);if(o){var i=(0,s.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,c.Z)(this,t)});function l(t,e){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,n.Z)(this,l),!t.isGlobeView)throw new Error("'Minimap' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");if(!e.isColorLayer)throw new Error("'layer' parameter form 'Minimap' constructor should be a 'ColorLayer'.");if((o=a.call(this,t,i,A)).minScale=i.minScale||A.minScale,o.maxScale=i.maxScale||A.maxScale,o.zoomRatio=i.zoomRatio||A.zoomRatio,o.domElement.id="widgets-minimap",i.cursor){var r=document.createElement("div");r.id="cursor-wrapper",o.domElement.appendChild(r),"string"==typeof i.cursor?r.innerHTML=i.cursor:i.cursor instanceof HTMLElement&&r.appendChild(i.cursor)}o.view=new k.Z(o.domElement,e.source.extent,{camera:{type:I.P.ORTHOGRAPHIC},placement:e.source.extent,noControls:!0,maxSubdivisionLevel:t.tileLayer.maxSubdivisionLevel,disableFocusOnStart:!0}),o.view.addLayer(e),o.domElement.addEventListener("pointerdown",(function(t){t.preventDefault()}));var c=o.view.camera.camera3D,s=o.view.getScale(i.pitch),d=c.zoom*o.maxScale/s,u=c.zoom*o.minScale/s,m=new T.Z(t.referenceCrs),p=new T.Z(o.view.referenceCrs),f=t.controls.getCameraTargetPosition();return t.addFrameRequester(D.Ao.AFTER_RENDER,(function(){var e=t.camera.camera3D.position.distanceTo(f),n=t.getScaleFromDistance(i.pitch,e);c.zoom=o.zoomRatio*u*n/o.minScale,c.zoom=Math.min(Math.max(c.zoom,d),u),c.updateProjectionMatrix(),m.setFromVector3(t.controls.getCameraTargetPosition()),m.as(o.view.referenceCrs,p),c.position.x=p.x,c.position.y=p.y,c.updateMatrixWorld(!0),o.view.notifyChange(c)})),o}return(0,i.Z)(l)}(f);var B=o(11925),O=o(91742),N=o(44450);var V={width:200,height:30,position:"bottom-left"};const G=function(t){(0,r.Z)(l,t);var e,o,a=(e=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,s.Z)(e);if(o){var i=(0,s.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,c.Z)(this,t)});function l(t){var e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.Z)(this,l),(e=a.call(this,t,o,V)).domElement.id="widgets-scale",e.view=t,e.domElement.innerHTML="Scale",e.width=o.width||V.width,e.view.isGlobeView?(e.view.addEventListener(O.b.GLOBE_INITIALIZED,(function(){e.update()})),e.view.controls.addEventListener(B.Q.RANGE_CHANGED,(function(){e.update()}))):e.view.isPlanarView?(e.view.addEventListener(u.b.INITIALIZED,(function(){e.update()})),e.view.addEventListener(N.uZ.MOVED,(function(){e.update()}))):console.warn("The 'view' linked to scale widget is neither a 'GlobeView' nor a 'PlanarView'. The scale wont automatically update. You can implement its update automation using 'Scale.update' method."),e}return(0,i.Z)(l,[{key:"addEventListeners",value:function(){}},{key:"update",value:function(){var t=Math.round(this.view.getPixelsToMeters(this.width)),e=Math.pow(10,t.toString().length-1);t=Math.round(t/e)*e;var o=this.view.getMetersToPixels(t),n="m";t>=1e3&&(t/=1e3,n="km"),this.domElement.innerHTML="".concat(t," ").concat(n),this.domElement.style.width="".concat(o,"px")}}]),l}(f);var H=o(33347);function j(t,e,o){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,o)}var W={width:300,height:38,position:"top",maxSuggestionNumber:10,fontSize:16,placeholder:"Search location"};function _(t,e){var o;return t?(F(t),e>=t.length?e=0:e<0&&(e=t.length-1),null===(o=t[e])||void 0===o||o.classList.add("active"),e):e}function F(t){for(var e=0;e<t.length;e++)t[e].classList.remove("active")}function U(t){for(;t.children.length>1;)t.removeChild(t.lastChild)}var q=new WeakMap;const Q=function(t){(0,r.Z)(m,t);var e,o,u=(e=m,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,s.Z)(e);if(o){var i=(0,s.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,c.Z)(this,t)});function m(t,e){var o,i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,n.Z)(this,m),i=u.call(this,t,r,W),j((0,a.Z)(i),q,{writable:!0,value:void 0}),!e||!e.url||!e.parser||"function"!=typeof e.parser)throw new Error("'geocodingOptions' parameter for 'Searchbar' constructor is not a valid option. Please refer to the documentation.");(0,l.Z)((0,a.Z)(i),q,null!==(o=e.onSelected)&&void 0!==o?o:function(){}),i.domElement.id="widgets-searchbar",i.domElement.style.height="auto";var c=document.createElement("form");c.setAttribute("autocomplete","off"),c.id="searchbar-autocompletion-form",i.domElement.appendChild(c);var s,p=document.createElement("input");p.setAttribute("type","text"),p.setAttribute("name","mySearch"),p.setAttribute("placeholder",r.placeholder||W.placeholder),p.style.height="".concat(r.height||r.size||W.height,"px"),p.style.fontSize="".concat(r.fontSize||W.fontSize,"px"),c.appendChild(p),p.addEventListener("input",(function(){var t=p.value;if(U(c),s=-1,!t)return!1;e.url.searchParams.set("text",t),H.Z.json(e.url).then((function(o){var n=e.parser(o),l=0;n.forEach((function(e,o){if(l!==Math.min(n.size,r.maxSuggestionNumber||W.maxSuggestionNumber)){var u=l;l++;var m=o.toUpperCase().indexOf(t.toUpperCase());if(m>-1){var f=document.createElement("div");f.style.minHeight=p.style.height,f.style.fontSize="".concat(r.fontSize||W.fontSize,"px");var h=o.slice(0,m),v=o.slice(m,m+t.length),w=o.slice(m+t.length,o.length);f.innerHTML="<p>".concat(h,"<strong>").concat(v,"</strong>").concat(w,"</p>"),f.setAttribute("location",o),c.appendChild(f),f.addEventListener("mouseover",(function(){F(c.children),s=u,f.classList.add("active")})),f.addEventListener("click",(function(){(0,d.Z)((0,a.Z)(i),q).call((0,a.Z)(i),e),p.value=f.getAttribute("location"),U(c)}))}}}))}))}));var f=(r.position||W.position).includes("top")?1:-1;return p.addEventListener("keydown",(function(e){e.stopPropagation();var o=c.getElementsByTagName("div");switch(e.code){case"Escape":U(c),p.value="",t.domElement.focus();break;case"ArrowDown":e.preventDefault(),s=_(o,s+f);break;case"ArrowUp":e.preventDefault(),s=_(o,s-f);break;case"Enter":e.preventDefault(),o[Math.max(s,0)]&&(o[Math.max(s,0)].click(),t.domElement.focus())}})),p.addEventListener("focus",(function(){c.classList.add("focus")})),p.addEventListener("blur",(function(){c.classList.remove("focus"),F(c.children)})),c.addEventListener("mouseleave",(function(){F(c.children),s=-1})),i}return(0,i.Z)(m)}(f)}},t=>(75462,t(t.s=75462))])));
2
2
  //# sourceMappingURL=itowns_widgets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"itowns_widgets.js","mappings":"cAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,iBAAkB,GAAIH,GACH,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,IAR3B,CASGK,MAAM,WACT,O,uMC6CA,SApD0B,QAAa,SAASC,EAAOC,GACrD,IAAIC,EAAUC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,GAC9EG,EAAiBH,UAAUC,OAAS,EAAID,UAAU,QAAKE,GAE3D,OAAgBE,KAAMP,GAEtBO,KAAKC,cAAgBN,EAAQM,eAAiBP,EAAKQ,WACnDF,KAAK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f,EAAMgC,SAAWwB,EAC3CI,EAAUL,EAASxC,KAAOf,EAAM+B,SAAWyB,EAE3CK,EAAsB,IAAIC,EAAA,EAAY3H,EAAK4H,cAC3CC,EAAkB,IAAIF,EAAA,EAAY9D,EAAM7D,KAAK4H,cAC7CE,EAAiB9H,EAAKiE,SAAS8D,0BAiBnC,OAhBA/H,EAAKgI,kBAAkB,mBAA+B,WAEpD,IAAIC,EAAWjI,EAAK0G,OAAOU,SAAS3G,SAASyH,WAAWJ,GACpDK,EAAQnI,EAAKoI,qBAAqBnI,EAAQsH,MAAOU,GACrDb,EAASxC,KAAOf,EAAMiC,UAAY2B,EAAUU,EAAQtE,EAAM+B,SAC1DwB,EAASxC,KAAOC,KAAKC,IAAID,KAAKI,IAAImC,EAASxC,KAAM4C,GAAUC,GAC3DL,EAASiB,yBAETX,EAAoBY,eAAetI,EAAKiE,SAAS8D,2BACjDL,EAAoBa,GAAG1E,EAAM7D,KAAK4H,aAAcC,GAChDT,EAAS3G,SAASsB,EAAI8F,EAAgB9F,EACtCqF,EAAS3G,SAASuB,EAAI6F,EAAgB7F,EACtCoF,EAASoB,mBAAkB,GAE3B3E,EAAM7D,KAAKyI,aAAarB,MAEnBvD,EAGT,OAAO,OAAakC,GAzIK,CA0IzB,K","sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/./utils/gui/Widget.js","webpack://[name]/./utils/gui/Navigation.js","webpack://[name]/./utils/gui/Minimap.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(\"itowns_widgets\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"itowns_widgets\"] = factory();\n\telse\n\t\troot[\"itowns_widgets\"] = factory();\n})(self, function() {\nreturn ","import _createClass from \"@babel/runtime/helpers/createClass\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\n\nvar Widget = /*#__PURE__*/_createClass(function Widget(view) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var defaultOptions = arguments.length > 2 ? arguments[2] : undefined;\n\n _classCallCheck(this, Widget);\n\n this.parentElement = options.parentElement || view.domElement;\n this.position = options.position || defaultOptions.position;\n\n if (!['top-left', 'top-right', 'bottom-left', 'bottom-right', 'top', 'bottom', 'left', 'right'].includes(this.position)) {\n console.warn('\\'position\\' optional parameter for \\'Widget\\' constructor is not a valid option. ' + \"It will be set to '\".concat(defaultOptions.position, \"'.\"));\n this.position = defaultOptions.position;\n } // ---------- CREATE A DomElement WITH id, classes AND style RELEVANT TO THE WIDGET PROPERTIES : ----------\n // Create a div containing minimap widget and add it to its specified parent.\n\n\n this.domElement = document.createElement('div');\n this.parentElement.appendChild(this.domElement); // Size widget according to options.\n\n this.domElement.style.width = \"\".concat(options.width || options.size || defaultOptions.width, \"px\");\n this.domElement.style.height = \"\".concat(options.height || options.size || defaultOptions.height, \"px\"); // Position widget according to options.\n\n var positionArray = this.position.split('-');\n this.domElement.classList.add(\"\".concat(positionArray[0], \"-widget\"));\n\n if (positionArray[1]) {\n this.domElement.classList.add(\"\".concat(positionArray[1], \"-widget\"));\n } else {\n // If only one position parameter was given, center the domElement on the other axis.\n // TODO : at this stage, offsetWidth and offsetHeight do no include borders. This should be worked around.\n switch (positionArray[0]) {\n case 'top':\n case 'bottom':\n this.domElement.style.left = \"calc(50% - \".concat(this.domElement.offsetWidth / 2, \"px)\");\n break;\n\n case 'left':\n case 'right':\n this.domElement.style.top = \"calc(50% - \".concat(this.domElement.offsetHeight / 2, \"px)\");\n break;\n\n default:\n break;\n }\n } // Translate widget div according to optional translate parameter.\n\n\n if (options.translate) {\n this.domElement.style.transform = \"translate(\".concat(options.translate.x || 0, \"px, \").concat(options.translate.y || 0, \"px)\");\n }\n});\n\nexport default Widget;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nimport { VIEW_EVENTS } from \"../../src/Core/View\";\nimport Widget from \"./Widget\";\nvar DEFAULT_OPTIONS = {\n parentElement: document.body,\n displayCompass: true,\n display3DToggle: true,\n displayZoomIn: true,\n displayZoomOut: true,\n animationDuration: 500,\n position: 'bottom-left',\n direction: 'column'\n};\n/**\n * A widget menu manager for navigation.\n *\n * @property {HTMLElement} domElement An html div containing all navigation widgets.\n * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.\n */\n\nvar Navigation = /*#__PURE__*/function (_Widget) {\n _inherits(Navigation, _Widget);\n\n var _super = _createSuper(Navigation);\n\n /**\n * @param {View} view The iTowns view the navigation should be linked\n * to.\n * @param {Object} options The navigation menu optional configuration.\n * @param {HTMLElement} [options.parentElement=document.body] The parent HTML container of the div which\n * contains navigation widgets.\n * @param {boolean} [options.displayCompass=true] Whether the compass widget should be displayed.\n * @param {boolean} [options.display3DToggle=true] Whether the navigation should include a widget\n * to toggle between top and oblique view.\n * @param {boolean} [options.displayZoomIn=true] Whether the zoom-in widget should be displayed.\n * @param {boolean} [options.displayZoomOut=true] Whether the zoom-out widget should be displayed.\n * @param {number} [options.animationDuration=500] The duration of travel animations, when clicking\n * navigation widgets.\n * @param {string} [options.position='bottom-left'] Defines which corner of the `parentElement` the\n * navigation menu should be displayed to.\n * Possible values are `top-left`, `top-right`,\n * `bottom-left` and `bottom-right`. If the input\n * value does not match one of these, it will be\n * defaulted to `bottom-left`.\n * @param {string} [options.direction='column'] Whether the navigation menu should expand\n * horizontally or vertically. Possible values\n * are `column` and `row`. If the input value\n * does not match one of these, it will be\n * defaulted to `column`.\n * @param {Object} [options.translate] An optional translation of the navigation menu.\n * @param {number} [options.translate.x=0] The navigation menu translation along the page\n * x-axis.\n * @param {number} [options.translate.y=0] The navigation menu translation along the page\n * y-axis.\n */\n function Navigation(view) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Navigation);\n\n // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------\n // `top`, `bottom`, `left` and `right` values for `position` option are not relevant for navigation widget.\n if (['top', 'bottom', 'left', 'right'].includes(options.position)) {\n console.warn('\\'position\\' optional parameter for \\'Navigation\\' is not a valid option. ' + \"It will be set to '\".concat(DEFAULT_OPTIONS.position, \"'.\"));\n options.position = DEFAULT_OPTIONS.position;\n }\n\n _this = _super.call(this, view, options, DEFAULT_OPTIONS);\n _this.direction = options.direction || DEFAULT_OPTIONS.direction;\n\n if (!['column', 'row'].includes(_this.direction)) {\n console.warn('\\'direction\\' optional parameter for \\'Navigation\\' constructor is not a valid option. ' + \"It will be set to '\".concat(DEFAULT_OPTIONS.direction, \"'.\"));\n _this.direction = DEFAULT_OPTIONS.direction;\n }\n\n _this.animationDuration = options.animationDuration === undefined ? DEFAULT_OPTIONS.animationDuration : options.animationDuration; // ---------- CREATE A DomElement WITH id AND classes RELEVANT TO THE WIDGET PROPERTIES : ----------\n // Create a div containing all widgets and add it to its specified parent.\n\n _this.domElement.id = 'widgets-navigation'; // Position widget div according to options.\n\n _this.domElement.classList.add(\"\".concat(_this.direction, \"-widget\")); // ---------- CREATE THE DEFAULT WIDGETS IF NOT HIDDEN (COMPASS, 3D AND ZOOM BUTTONS) : ----------\n // Add a compass widget if requested.\n\n\n if (options.displayCompass === undefined ? DEFAULT_OPTIONS.displayCompass : options.displayCompass) {\n _this.compass = _this.addButton('compass', '', function () {\n view.controls.lookAtCoordinate({\n heading: 0,\n tilt: 89.5,\n time: _this.animationDuration\n });\n }, 'widgets'); // Manage compass rotation when the view's camera is moved.\n\n view.addEventListener(VIEW_EVENTS.CAMERA_MOVED, function (event) {\n _this.compass.style.transform = \"rotate(\".concat(-event.heading, \"deg)\");\n });\n } // Add a 3D toggle button if requested.\n\n\n if (options.display3DToggle === undefined ? DEFAULT_OPTIONS.display3DToggle : options.display3DToggle) {\n _this.switch3dButton = _this.addButton('3d-button', '3D', function () {\n var tilt;\n\n if (view.controls.getTilt() < 89) {\n tilt = 89.5;\n } else {\n tilt = 40;\n }\n\n view.controls.lookAtCoordinate({\n tilt: tilt,\n time: _this.animationDuration\n });\n }); // Manage button content toggle when the view's camera is moved.\n\n view.addEventListener(VIEW_EVENTS.CAMERA_MOVED, function (event) {\n _this.switch3dButton.innerHTML = event.tilt < 89 ? '2D' : '3D';\n });\n } // Add a zoom-in button if requested.\n\n\n if (options.displayZoomIn === undefined ? DEFAULT_OPTIONS.displayZoomIn : options.displayZoomIn) {\n _this.zoomInButton = _this.addButton('zoom-in-button', '<span class=\"widget-zoom-button-logo\"></span>', function () {\n view.controls.lookAtCoordinate({\n zoom: Math.min(20, view.controls.getZoom() + 1),\n time: _this.animationDuration\n });\n }, 'zoom-button-bar');\n } // Add a zoom-out button if requested.\n\n\n if (options.displayZoomOut === undefined ? DEFAULT_OPTIONS.displayZoomOut : options.displayZoomOut) {\n _this.zoomOutButton = _this.addButton('zoom-out-button', '<span id=\"zoom-out-logo\" class=\"widget-zoom-button-logo\"></span>', function () {\n view.controls.lookAtCoordinate({\n zoom: Math.max(3, view.controls.getZoom() - 1),\n time: _this.animationDuration\n });\n }, 'zoom-button-bar');\n }\n\n return _this;\n }\n /**\n *\n * @param {string} id The unique id the created button should be given.\n * @param {string} [content=''] An HTML string defining the content of the button.\n * @param {function} [actionOnClick] The method that should be executed when the button is clicked on.\n * @param {string} [parentId] The unique id of a button bar in which the created button should be added.\n * A button bar is a group which contains one or several buttons. All\n * buttons created with Navigation are in a button bar. If the given id does\n * not match an already existing button bar, a new button bar will be created\n * with this id. If no id is given, a button bar will be created with no id.\n * The later case can be useful for creating isolated buttons.\n *\n * @returns {HTMLButtonElement} The created button.\n */\n\n\n _createClass(Navigation, [{\n key: \"addButton\",\n value: function addButton(id) {\n var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var actionOnClick = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};\n var parentId = arguments.length > 3 ? arguments[3] : undefined;\n var buttonBar = document.getElementById(parentId);\n\n if (!buttonBar) {\n buttonBar = this.addButtonBar(parentId);\n }\n\n var button = document.createElement('button');\n button.className = 'widget-button';\n button.id = id;\n button.innerHTML = content;\n buttonBar.appendChild(button);\n button.addEventListener('click', actionOnClick);\n return button;\n }\n }, {\n key: \"addButtonBar\",\n value: function addButtonBar(id) {\n var buttonBar = document.createElement('div');\n buttonBar.className = 'widget-button-bar';\n\n if (id) {\n buttonBar.id = id;\n }\n\n this.domElement.appendChild(buttonBar);\n return buttonBar;\n }\n }]);\n\n return Navigation;\n}(Widget);\n\nexport default Navigation;","import _createClass from \"@babel/runtime/helpers/createClass\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nimport Coordinates from \"../../src/Core/Geographic/Coordinates\";\nimport { MAIN_LOOP_EVENTS } from \"../../src/Core/MainLoop\";\nimport PlanarView from \"../../src/Core/Prefab/PlanarView\";\nimport { CAMERA_TYPE } from \"../../src/Renderer/Camera\";\nimport Widget from \"./Widget\";\nvar DEFAULT_OPTIONS = {\n minScale: 1 / 500000,\n maxScale: 1 / 5E8,\n zoomRatio: 1 / 30,\n width: 150,\n height: 150,\n position: 'bottom-left'\n};\n/**\n * A widget for minimap\n *\n * @property {HTMLElement} domElement An html div containing the minimap.\n * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.\n */\n\nvar Minimap = /*#__PURE__*/function (_Widget) {\n _inherits(Minimap, _Widget);\n\n var _super = _createSuper(Minimap);\n\n /**\n * @param {GlobeView} view The iTowns view the minimap should be\n * linked to. Only {@link GlobeView} is\n * supported at the moment.\n * @param {ColorLayer} layer The {@link ColorLayer} that should be\n * displayed on the minimap.\n * @param {Object} [options] The minimap optional configuration.\n * @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div\n * which contains minimap widgets.\n * @param {number} [options.size] The size of the minimap. It is a number\n * that describing both width and height\n * in pixels of the minimap.\n * @param {number} [options.width=150] The width in pixels of the minimap.\n * @param {number} [options.height=150] The height in pixels of the minimap.\n * @param {string} [options.position='bottom-left'] Defines which corner of the\n * `parentElement` the minimap should be\n * displayed to. Possible values are\n * `top-left`, `top-right`, `bottom-left`\n * and `bottom-right`. If the input value\n * does not match one of these, it will\n * be defaulted to `bottom-left`.\n * @param {Object} [options.translate] An optional translation of the minimap.\n * @param {number} [options.translate.x=0] The minimap translation along the page\n * x-axis.\n * @param {number} [options.translate.y=0] The minimap translation along the page\n * y-axis.\n * @param {HTMLElement|string} [options.cursor] An html element or an HTML string\n * describing a cursor showing minimap\n * view camera target position at the\n * center of the minimap.\n * @param {number} [options.minScale=1/2000] The minimal scale the minimap can reach.\n * @param {number} [options.maxScale=1/1_250_000] The maximal scale the minimap can reach.\n * @param {number} [options.zoomRatio=1/30] The ratio between minimap camera zoom\n * and view camera zoom.\n * @param {number} [options.pitch=0.28] The screen pixel pitch, used to compute\n * view and minimap scale.\n */\n function Minimap(view, layer) {\n var _this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _classCallCheck(this, Minimap);\n\n // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------\n if (!view.isGlobeView) {\n throw new Error('\\'Minimap\\' plugin only supports \\'GlobeView\\'. Therefore, the \\'view\\' parameter must be a ' + '\\'GlobeView\\'.');\n }\n\n if (!layer.isColorLayer) {\n throw new Error('\\'layer\\' parameter form \\'Minimap\\' constructor should be a \\'ColorLayer\\'.');\n }\n\n _this = _super.call(this, view, options, DEFAULT_OPTIONS);\n _this.minScale = options.minScale || DEFAULT_OPTIONS.minScale;\n _this.maxScale = options.maxScale || DEFAULT_OPTIONS.maxScale; // TODO : it could be interesting to be able to specify a method as zoomRatio parameter. This method could\n // return a zoom ratio from the scale of the minimap.\n\n _this.zoomRatio = options.zoomRatio || DEFAULT_OPTIONS.zoomRatio; // ---------- this.domElement SETTINGS SPECIFIC TO MINIMAP : ----------\n\n _this.domElement.id = 'widgets-minimap'; // Display a cursor at the center of the minimap, if requested.\n\n if (options.cursor) {\n // Wrap cursor domElement inside a div to center it in minimap.\n var cursorWrapper = document.createElement('div');\n cursorWrapper.id = 'cursor-wrapper';\n\n _this.domElement.appendChild(cursorWrapper); // Add specified cursor to its wrapper.\n\n\n if (typeof options.cursor === 'string') {\n cursorWrapper.innerHTML = options.cursor;\n } else if (options.cursor instanceof HTMLElement) {\n cursorWrapper.appendChild(options.cursor);\n }\n } // ---------- CREATE A MINIMAP View AND DISPLAY DATA PASSED IN Layer PARAMETER : ----------\n\n\n _this.view = new PlanarView(_this.domElement, layer.source.extent, {\n camera: {\n type: CAMERA_TYPE.ORTHOGRAPHIC\n },\n placement: layer.source.extent,\n // TODO : the default placement should be the view extent for ortho camera\n noControls: true,\n maxSubdivisionLevel: view.tileLayer.maxSubdivisionLevel\n });\n\n _this.view.addLayer(layer); // TODO : should this promise be returned by constructor so that user can use it ?\n // Give the focus back to the main view. Indeed, `View` constructor takes the focus, and we don't want the focus\n // on the latest created `View`, which is the minimap view.\n\n\n view.domElement.focus(); // Prevent the minimap domElement to get focus when clicked, and prevent click event to be propagated to the\n // main view controls.\n\n _this.domElement.addEventListener('pointerdown', function (event) {\n event.stopPropagation();\n event.preventDefault();\n }); // Store minimap view camera3D in constant for code convenience.\n\n\n var camera3D = _this.view.camera.camera3D; // ---------- UPDATE MINIMAP VIEW WHEN UPDATING THE MAIN VIEW : ----------\n // The minimal and maximal value the minimap camera3D zoom can reach in order to stay in the scale limits.\n\n var initialScale = _this.view.getScale(options.pitch);\n\n var minZoom = camera3D.zoom * _this.maxScale / initialScale;\n var maxZoom = camera3D.zoom * _this.minScale / initialScale; // Coordinates used to transform position vectors from the main view CRS to the minimap view CRS.\n\n var mainViewCoordinates = new Coordinates(view.referenceCrs);\n var viewCoordinates = new Coordinates(_this.view.referenceCrs);\n var targetPosition = view.controls.getCameraTargetPosition();\n view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_RENDER, function () {\n // Update minimap camera zoom\n var distance = view.camera.camera3D.position.distanceTo(targetPosition);\n var scale = view.getScaleFromDistance(options.pitch, distance);\n camera3D.zoom = _this.zoomRatio * maxZoom * scale / _this.minScale;\n camera3D.zoom = Math.min(Math.max(camera3D.zoom, minZoom), maxZoom);\n camera3D.updateProjectionMatrix(); // Update minimap camera position.\n\n mainViewCoordinates.setFromVector3(view.controls.getCameraTargetPosition());\n mainViewCoordinates.as(_this.view.referenceCrs, viewCoordinates);\n camera3D.position.x = viewCoordinates.x;\n camera3D.position.y = viewCoordinates.y;\n camera3D.updateMatrixWorld(true);\n\n _this.view.notifyChange(camera3D);\n });\n return _this;\n }\n\n return _createClass(Minimap);\n}(Widget);\n\nexport default Minimap;"],"names":["root","factory","exports","module","define","amd","self","Widget","view","options","arguments","length","undefined","defaultOptions","this","parentElement","domElement","position","includes","console","warn","concat","document","createElement","appendChild","style","width","size","height","positionArray","split","classList","add","left","offsetWidth","top","offsetHeight","translate","transform","x","y","DEFAULT_OPTIONS","body","displayCompass","display3DToggle","displayZoomIn","displayZoomOut","animationDuration","direction","_Widget","Navigation","Derived","hasNativeReflectConstruct","_super","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_isNativeReflectConstruct","result","Super","NewTarget","constructor","apply","_this","id","compass","addButton","controls","lookAtCoordinate","heading","tilt","time","addEventListener","event","switch3dButton","getTilt","innerHTML","zoomInButton","zoom","Math","min","getZoom","zoomOutButton","max","key","value","content","actionOnClick","parentId","buttonBar","getElementById","addButtonBar","button","className","minScale","maxScale","zoomRatio","Minimap","layer","isGlobeView","Error","isColorLayer","cursor","cursorWrapper","HTMLElement","PlanarView","source","extent","camera","type","placement","noControls","maxSubdivisionLevel","tileLayer","addLayer","focus","stopPropagation","preventDefault","camera3D","initialScale","getScale","pitch","minZoom","maxZoom","mainViewCoordinates","Coordinates","referenceCrs","viewCoordinates","targetPosition","getCameraTargetPosition","addFrameRequester","distance","distanceTo","scale","getScaleFromDistance","updateProjectionMatrix","setFromVector3","as","updateMatrixWorld","notifyChange"],"sourceRoot":""}
1
+ {"version":3,"file":"itowns_widgets.js","mappings":"cAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,iBAAkB,GAAIH,GACH,iBAAZC,QACdA,Q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,EAAiBI,EAAKC,UACtBW,EAAeQ,EACfG,EAAiB1L,UAAUC,IAAI,aAEjCyL,EAAiBhL,iBAAiB,SAAS,YACzC,QAAsB,OAAuB4D,GAAQiG,GAAa5G,MAAK,OAAuBW,GAAQtC,GAEtGgJ,EAAMjN,MAAQ2N,EAAiBM,aAAa,YAC5C9B,EAAoBC,iBAS9B,IAAI8B,GAAexN,EAAQS,UAAY,EAAgBA,UAAUC,SAAS,OAAS,GAAK,EAmDxF,OAlDA6L,EAAMtK,iBAAiB,WAAW,SAAUkE,GAC1CA,EAAMhE,kBACN,IAAIsL,EAAwB/B,EAAKgC,qBAAqB,OAEtD,OAAQvH,EAAMwH,MACZ,IAAK,SACHlC,EAAoBC,GACpBa,EAAMjN,MAAQ,GACdS,EAAKS,WAAW+G,QAChB,MAEF,IAAK,YACHpB,EAAMyC,iBACN0D,EAAepB,EAAUuC,EAAuBnB,EAAekB,GAC/D,MAEF,IAAK,UACHrH,EAAMyC,iBACN0D,EAAepB,EAAUuC,EAAuBnB,EAAekB,GAC/D,MAEF,IAAK,QACHrH,EAAMyC,iBAEF6E,EAAsBhH,KAAKI,IAAIyF,EAAc,MAC/CmB,EAAsBhH,KAAKI,IAAIyF,EAAc,IAAIsB,QACjD7N,EAAKS,WAAW+G,aAWxBgF,EAAMtK,iBAAiB,SAAS,WAC9ByJ,EAAKnK,UAAUC,IAAI,YAGrB+K,EAAMtK,iBAAiB,QAAQ,WAC7ByJ,EAAKnK,UAAUiK,OAAO,SACtBF,EAAiBI,EAAKC,aAGxBD,EAAKzJ,iBAAiB,cAAc,WAClCqJ,EAAiBI,EAAKC,UACtBW,GAAgB,KAEXzG,EAGT,OAAO,OAAakG,GA3MO,CA4M3B,K","sources":["webpack://itowns/webpack/universalModuleDefinition","webpack://itowns/./src/Utils/gui/Widget.js","webpack://itowns/./src/Utils/gui/Navigation.js","webpack://itowns/./src/Utils/gui/Minimap.js","webpack://itowns/./src/Utils/gui/Scale.js","webpack://itowns/./src/Utils/gui/Searchbar.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(\"itowns_widgets\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"itowns_widgets\"] = factory();\n\telse\n\t\troot[\"itowns_widgets\"] = factory();\n})(self, () => {\nreturn ","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet\";\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nvar _display = /*#__PURE__*/new WeakMap();\n\n/**\n * An interface that stores common methods for all specific widgets.\n *\n * @hideconstructor\n */\nvar Widget = /*#__PURE__*/function () {\n function Widget(view) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var defaultOptions = arguments.length > 2 ? arguments[2] : undefined;\n\n _classCallCheck(this, Widget);\n\n _classPrivateFieldInitSpec(this, _display, {\n writable: true,\n value: void 0\n });\n\n this.parentElement = options.parentElement || view.domElement;\n this.position = options.position || defaultOptions.position;\n\n if (!['top-left', 'top-right', 'bottom-left', 'bottom-right', 'top', 'bottom', 'left', 'right'].includes(this.position)) {\n console.warn('\\'position\\' optional parameter for \\'Widget\\' constructor is not a valid option. ' + \"It will be set to '\".concat(defaultOptions.position, \"'.\"));\n this.position = defaultOptions.position;\n } // ---------- CREATE A DomElement WITH id, classes AND style RELEVANT TO THE WIDGET PROPERTIES : ----------\n // Create a div containing minimap widget and add it to its specified parent.\n\n\n this.domElement = document.createElement('div');\n this.parentElement.appendChild(this.domElement); // Size widget according to options.\n\n this.domElement.style.width = \"\".concat(options.width || options.size || defaultOptions.width, \"px\");\n this.domElement.style.height = \"\".concat(options.height || options.size || defaultOptions.height, \"px\"); // Position widget according to options.\n\n var positionArray = this.position.split('-');\n this.domElement.classList.add(\"\".concat(positionArray[0], \"-widget\"));\n\n if (positionArray[1]) {\n this.domElement.classList.add(\"\".concat(positionArray[1], \"-widget\"));\n } else {\n // If only one position parameter was given, center the domElement on the other axis.\n // TODO : at this stage, offsetWidth and offsetHeight do no include borders. This should be worked around.\n switch (positionArray[0]) {\n case 'top':\n case 'bottom':\n this.domElement.style.left = \"calc(50% - \".concat(this.domElement.offsetWidth / 2, \"px)\");\n break;\n\n case 'left':\n case 'right':\n this.domElement.style.top = \"calc(50% - \".concat(this.domElement.offsetHeight / 2, \"px)\");\n break;\n\n default:\n break;\n }\n } // Translate widget div according to optional translate parameter.\n\n\n if (options.translate) {\n this.domElement.style.transform = \"translate(\".concat(options.translate.x || 0, \"px, \").concat(options.translate.y || 0, \"px)\");\n } // Prevent triggering `GlobeControls` and `PlanarControls` mouse or pointer events when clicking the search bar.\n // For example, this prevents triggering an animated travel when double-clicking search bar in a `GlobeView`.\n\n\n this.domElement.addEventListener('pointerdown', function (e) {\n e.stopPropagation();\n });\n this.domElement.addEventListener('mousedown', function (e) {\n e.stopPropagation();\n });\n }\n /**\n * Change the widget style `display` property so that the widget becomes visible.\n */\n\n\n _createClass(Widget, [{\n key: \"show\",\n value: function show() {\n this.domElement.style.display = _classPrivateFieldGet(this, _display);\n }\n /**\n * Change the widget style `display` property so that the widget becomes invisible.\n */\n\n }, {\n key: \"hide\",\n value: function hide() {\n _classPrivateFieldSet(this, _display, window.getComputedStyle(this.domElement).display);\n\n this.domElement.style.display = 'none';\n }\n }]);\n\n return Widget;\n}();\n\nexport default Widget;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nfunction _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\n\nimport { VIEW_EVENTS } from \"../../Core/View\";\nimport Widget from \"./Widget\";\nvar DEFAULT_OPTIONS = {\n displayCompass: true,\n display3DToggle: true,\n displayZoomIn: true,\n displayZoomOut: true,\n animationDuration: 500,\n position: 'bottom-left',\n direction: 'column'\n};\nvar DEFAULT_BUTTONS = {\n compass: {\n id: 'compass',\n content: '',\n info: 'Rotate the camera to face North',\n parentId: 'widgets'\n },\n toggle3D: {\n id: '3d-button',\n content: '3D',\n info: 'Tilt the camera'\n },\n zoomIn: {\n id: 'zoom-in-button',\n content: '<span class=\"widget-zoom-button-logo\"></span>',\n info: 'Zoom in',\n parentId: 'zoom-button-bar'\n },\n zoomOut: {\n id: 'zoom-out-button',\n content: '<span id=\"zoom-out-logo\" class=\"widget-zoom-button-logo\"></span>',\n info: 'Zoom out',\n parentId: 'zoom-button-bar'\n }\n};\n/**\n * A widget menu manager for navigation.\n *\n * To use it, you need to link the widgets' stylesheet to your html webpage. This stylesheet is included in\n * [itowns bundles](https://github.com/iTowns/itowns/releases) if you downloaded them, or it can be found in\n * `node_modules/itowns/examples/css` if you installed iTowns with npm. Otherwise, it can be found at\n * [this link](https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css). See\n * [this example](http://www.itowns-project.org/itowns/examples/#widgets_navigation) for more details.\n *\n * @extends Widget\n *\n * @property {HTMLElement} domElement An html div containing all navigation widgets.\n * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.\n * @property {HTMLButtonElement} compass The HTML button for the compass.\n * @property {HTMLButtonElement} toggle3D The HTML button for the 3D/2D toggle button.\n * @property {HTMLButtonElement} zoomIn The HTML button for the zoom-in button.\n * @property {HTMLButtonElement} zoomOut The HTML button for the zoom-out button.\n *\n * @example\n * // Create a Navigation widget in the bottom-right corner of an iTowns view domElement\n * const navigation = new Navigation(view, { position: 'bottom-right' };\n *\n * // Change the tooltip for the compass :\n * navigation.compass.title = 'new tooltip';\n *\n * // Change the method ran when clicking zoom-in button :\n * function newMethod() {\n * // do something\n * }\n * navigation.zoomIn.onclick = newMethod;\n */\n\nvar _view = /*#__PURE__*/new WeakMap();\n\nvar _action = /*#__PURE__*/new WeakSet();\n\nvar _addDefaultButton = /*#__PURE__*/new WeakSet();\n\nvar Navigation = /*#__PURE__*/function (_Widget) {\n _inherits(Navigation, _Widget);\n\n var _super = _createSuper(Navigation);\n\n /**\n * @param {GlobeView} view The iTowns view the navigation should be linked\n * to. For the moment, only `{@link GlobeView}`\n * is supported.\n * @param {Object} options The navigation menu optional configuration.\n * @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div which\n * contains navigation widgets.\n * @param {boolean} [options.displayCompass=true] Whether the compass widget should be displayed.\n * @param {boolean} [options.display3DToggle=true] Whether the navigation should include a widget\n * to toggle between top and oblique view.\n * @param {boolean} [options.displayZoomIn=true] Whether the zoom-in widget should be displayed.\n * @param {boolean} [options.displayZoomOut=true] Whether the zoom-out widget should be displayed.\n * @param {number} [options.animationDuration=500] The duration of travel animations, when clicking\n * navigation widgets.\n * @param {string} [options.position='bottom-left'] Defines which corner of the `parentElement` the\n * navigation menu should be displayed to.\n * Possible values are `top-left`, `top-right`,\n * `bottom-left` and `bottom-right`. If the input\n * value does not match one of these, it will be\n * defaulted to `bottom-left`.\n * @param {string} [options.direction='column'] Whether the navigation menu should expand\n * horizontally or vertically. Possible values\n * are `column` and `row`. If the input value\n * does not match one of these, it will be\n * defaulted to `column`.\n * @param {Object} [options.translate] An optional translation of the navigation menu.\n * @param {number} [options.translate.x=0] The navigation menu translation along the page\n * x-axis.\n * @param {number} [options.translate.y=0] The navigation menu translation along the page\n * y-axis.\n */\n function Navigation(view) {\n var _options$displayCompa, _options$display3DTog, _options$displayZoomI, _options$displayZoomO;\n\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Navigation);\n\n // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------\n // Check if the view is supported.\n if (!view.isGlobeView) {\n throw new Error('\\'Navigation\\' plugin only supports \\'GlobeView\\'. Therefore, the \\'view\\' parameter must be a ' + '\\'GlobeView\\'.');\n } // `top`, `bottom`, `left` and `right` values for `position` option are not relevant for navigation widget.\n\n\n if (['top', 'bottom', 'left', 'right'].includes(options.position)) {\n console.warn('\\'position\\' optional parameter for \\'Navigation\\' is not a valid option. ' + \"It will be set to '\".concat(DEFAULT_OPTIONS.position, \"'.\"));\n options.position = DEFAULT_OPTIONS.position;\n }\n\n _this = _super.call(this, view, options, DEFAULT_OPTIONS);\n\n _classPrivateMethodInitSpec(_assertThisInitialized(_this), _addDefaultButton);\n\n _classPrivateMethodInitSpec(_assertThisInitialized(_this), _action);\n\n _classPrivateFieldInitSpec(_assertThisInitialized(_this), _view, {\n writable: true,\n value: void 0\n });\n\n _classPrivateFieldSet(_assertThisInitialized(_this), _view, view);\n\n _this.direction = options.direction || DEFAULT_OPTIONS.direction;\n\n if (!['column', 'row'].includes(_this.direction)) {\n console.warn('\\'direction\\' optional parameter for \\'Navigation\\' constructor is not a valid option. ' + \"It will be set to '\".concat(DEFAULT_OPTIONS.direction, \"'.\"));\n _this.direction = DEFAULT_OPTIONS.direction;\n }\n\n _this.animationDuration = options.animationDuration === undefined ? DEFAULT_OPTIONS.animationDuration : options.animationDuration; // ---------- CREATE A DomElement WITH id AND classes RELEVANT TO THE WIDGET PROPERTIES : ----------\n // Create a div containing all widgets and add it to its specified parent.\n\n _this.domElement.id = 'widgets-navigation'; // Position widget div according to options.\n\n _this.domElement.classList.add(\"\".concat(_this.direction, \"-widget\")); // ---------- CREATE THE DEFAULT WIDGETS IF NOT HIDDEN (COMPASS, 3D AND ZOOM BUTTONS) : ----------\n // Add a compass widget if requested.\n\n\n if ((_options$displayCompa = options.displayCompass) !== null && _options$displayCompa !== void 0 ? _options$displayCompa : DEFAULT_OPTIONS.displayCompass) {\n _this.compass = _classPrivateMethodGet(_assertThisInitialized(_this), _addDefaultButton, _addDefaultButton2).call(_assertThisInitialized(_this), DEFAULT_BUTTONS.compass, function () {\n _classPrivateMethodGet(_assertThisInitialized(_this), _action, _action2).call(_assertThisInitialized(_this), {\n heading: 0,\n tilt: 89.5\n });\n }); // Manage compass rotation when the view's camera is moved.\n\n view.addEventListener(VIEW_EVENTS.CAMERA_MOVED, function (event) {\n _this.compass.style.transform = \"rotate(\".concat(-event.heading, \"deg)\");\n });\n } // Add a 3D toggle button if requested.\n\n\n if ((_options$display3DTog = options.display3DToggle) !== null && _options$display3DTog !== void 0 ? _options$display3DTog : DEFAULT_OPTIONS.display3DToggle) {\n _this.toggle3D = _classPrivateMethodGet(_assertThisInitialized(_this), _addDefaultButton, _addDefaultButton2).call(_assertThisInitialized(_this), DEFAULT_BUTTONS.toggle3D, function () {\n _classPrivateMethodGet(_assertThisInitialized(_this), _action, _action2).call(_assertThisInitialized(_this), {\n tilt: _classPrivateFieldGet(_assertThisInitialized(_this), _view).controls.getTilt() < 89 ? 89.5 : 40\n });\n }); // Manage button content toggle when the view's camera is moved.\n\n view.addEventListener(VIEW_EVENTS.CAMERA_MOVED, function (event) {\n _this.toggle3D.innerHTML = event.tilt < 89 ? '2D' : '3D';\n });\n } // Add a zoom-in button if requested.\n\n\n if ((_options$displayZoomI = options.displayZoomIn) !== null && _options$displayZoomI !== void 0 ? _options$displayZoomI : DEFAULT_OPTIONS.displayZoomIn) {\n _this.zoomIn = _classPrivateMethodGet(_assertThisInitialized(_this), _addDefaultButton, _addDefaultButton2).call(_assertThisInitialized(_this), DEFAULT_BUTTONS.zoomIn, function () {\n _classPrivateMethodGet(_assertThisInitialized(_this), _action, _action2).call(_assertThisInitialized(_this), {\n zoom: Math.min(20, _classPrivateFieldGet(_assertThisInitialized(_this), _view).controls.getZoom() + 1)\n });\n });\n } // Add a zoom-out button if requested.\n\n\n if ((_options$displayZoomO = options.displayZoomOut) !== null && _options$displayZoomO !== void 0 ? _options$displayZoomO : DEFAULT_OPTIONS.displayZoomOut) {\n _this.zoomOut = _classPrivateMethodGet(_assertThisInitialized(_this), _addDefaultButton, _addDefaultButton2).call(_assertThisInitialized(_this), DEFAULT_BUTTONS.zoomOut, function () {\n _classPrivateMethodGet(_assertThisInitialized(_this), _action, _action2).call(_assertThisInitialized(_this), {\n zoom: Math.max(3, _classPrivateFieldGet(_assertThisInitialized(_this), _view).controls.getZoom() - 1)\n });\n });\n }\n\n return _this;\n }\n /**\n *\n * @param {string} id The unique id the created button should be given.\n * @param {string} [content=''] An HTML string defining the content of the button.\n * @param {string} [title=''] An HTML string defining information on the button. This string will be\n * displayed in a tooltip when hovering the button.\n * @param {function} [onclick] The method that should be executed when the button is clicked on.\n * @param {string} [parentId] The unique id of a button bar in which the created button should be added.\n * A button bar is a group which contains one or several buttons. All\n * buttons created with Navigation are in a button bar. If the given id does\n * not match an already existing button bar, a new button bar will be created\n * with this id. If no id is given, a button bar will be created with no id.\n * The later case can be useful for creating isolated buttons.\n *\n * @returns {HTMLButtonElement} The created button.\n */\n\n\n _createClass(Navigation, [{\n key: \"addButton\",\n value: function addButton(id) {\n var _this2 = this;\n\n var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var title = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var onclick = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};\n var parentId = arguments.length > 4 ? arguments[4] : undefined;\n var buttonBar = document.getElementById(parentId);\n\n if (!buttonBar) {\n buttonBar = this.addButtonBar(parentId);\n }\n\n var button = document.createElement('button');\n button.className = 'widget-button';\n button.id = id;\n button.innerHTML = content;\n button.title = title;\n button.onclick = onclick;\n buttonBar.appendChild(button); // The buttons must not be focused using tab key.\n\n button.tabIndex = -1; // When releasing the mouse after clicking the button, we give the focus back to the view. Therefore, we can use\n // key events on the view without having to click the view to grant it focus.\n\n window.addEventListener('pointerup', function () {\n if (document.activeElement === button) {\n _classPrivateFieldGet(_this2, _view).domElement.focus();\n }\n });\n return button;\n }\n }, {\n key: \"addButtonBar\",\n value: function addButtonBar(id) {\n var buttonBar = document.createElement('div');\n buttonBar.className = 'widget-button-bar';\n\n if (id) {\n buttonBar.id = id;\n }\n\n this.domElement.appendChild(buttonBar);\n return buttonBar;\n }\n }]);\n\n return Navigation;\n}(Widget);\n\nfunction _action2(params) {\n params.time = this.animationDuration;\n return _classPrivateFieldGet(this, _view).controls.lookAtCoordinate(params);\n}\n\nfunction _addDefaultButton2(settings, onclick) {\n return this.addButton(settings.id, settings.content, settings.info, onclick, settings.parentId);\n}\n\nexport default Navigation;","import _createClass from \"@babel/runtime/helpers/createClass\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nimport Coordinates from \"../../Core/Geographic/Coordinates\";\nimport { MAIN_LOOP_EVENTS } from \"../../Core/MainLoop\";\nimport PlanarView from \"../../Core/Prefab/PlanarView\";\nimport { CAMERA_TYPE } from \"../../Renderer/Camera\";\nimport Widget from \"./Widget\";\nvar DEFAULT_OPTIONS = {\n minScale: 1 / 500000,\n maxScale: 1 / 5E8,\n zoomRatio: 1 / 30,\n width: 150,\n height: 150,\n position: 'bottom-left'\n};\n/**\n * A widget for minimap\n *\n * To use it, you need to link the widgets' stylesheet to your html webpage. This stylesheet is included in\n * [itowns bundles](https://github.com/iTowns/itowns/releases) if you downloaded them, or it can be found in\n * `node_modules/itowns/examples/css` if you installed iTowns with npm. Otherwise, it can be found at\n * [this link](https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css). See\n * [this example](http://www.itowns-project.org/itowns/examples/#widgets_minimap) for more details.\n *\n * @extends Widget\n *\n * @property {HTMLElement} domElement An html div containing the minimap.\n * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.\n */\n\nvar Minimap = /*#__PURE__*/function (_Widget) {\n _inherits(Minimap, _Widget);\n\n var _super = _createSuper(Minimap);\n\n /**\n * @param {GlobeView} view The iTowns view the minimap should be\n * linked to. Only {@link GlobeView} is\n * supported at the moment.\n * @param {ColorLayer} layer The {@link ColorLayer} that should be\n * displayed on the minimap.\n * @param {Object} [options] The minimap optional configuration.\n * @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div\n * which contains minimap widgets.\n * @param {number} [options.size] The size of the minimap. It is a number\n * that describes both width and height\n * in pixels of the minimap.\n * @param {number} [options.width=150] The width in pixels of the minimap.\n * @param {number} [options.height=150] The height in pixels of the minimap.\n * @param {string} [options.position='bottom-left'] Defines which position within the\n * `parentElement` the minimap should be\n * displayed to. Possible values are\n * `top`, `bottom`, `left`, `right`,\n * `top-left`, `top-right`, `bottom-left`\n * and `bottom-right`. If the input value\n * does not match one of these, it will\n * be defaulted to `bottom-left`.\n * @param {Object} [options.translate] An optional translation of the minimap.\n * @param {number} [options.translate.x=0] The minimap translation along the page\n * x-axis.\n * @param {number} [options.translate.y=0] The minimap translation along the page\n * y-axis.\n * @param {HTMLElement|string} [options.cursor] An html element or an HTML string\n * describing a cursor showing minimap\n * view camera target position at the\n * center of the minimap.\n * @param {number} [options.minScale=1/2000] The minimal scale the minimap can reach.\n * @param {number} [options.maxScale=1/1_250_000] The maximal scale the minimap can reach.\n * @param {number} [options.zoomRatio=1/30] The ratio between minimap camera zoom\n * and view camera zoom.\n * @param {number} [options.pitch=0.28] The screen pixel pitch, used to compute\n * view and minimap scale.\n */\n function Minimap(view, layer) {\n var _this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _classCallCheck(this, Minimap);\n\n // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------\n if (!view.isGlobeView) {\n throw new Error('\\'Minimap\\' plugin only supports \\'GlobeView\\'. Therefore, the \\'view\\' parameter must be a ' + '\\'GlobeView\\'.');\n }\n\n if (!layer.isColorLayer) {\n throw new Error('\\'layer\\' parameter form \\'Minimap\\' constructor should be a \\'ColorLayer\\'.');\n }\n\n _this = _super.call(this, view, options, DEFAULT_OPTIONS);\n _this.minScale = options.minScale || DEFAULT_OPTIONS.minScale;\n _this.maxScale = options.maxScale || DEFAULT_OPTIONS.maxScale; // TODO : it could be interesting to be able to specify a method as zoomRatio parameter. This method could\n // return a zoom ratio from the scale of the minimap.\n\n _this.zoomRatio = options.zoomRatio || DEFAULT_OPTIONS.zoomRatio; // ---------- this.domElement SETTINGS SPECIFIC TO MINIMAP : ----------\n\n _this.domElement.id = 'widgets-minimap'; // Display a cursor at the center of the minimap, if requested.\n\n if (options.cursor) {\n // Wrap cursor domElement inside a div to center it in minimap.\n var cursorWrapper = document.createElement('div');\n cursorWrapper.id = 'cursor-wrapper';\n\n _this.domElement.appendChild(cursorWrapper); // Add specified cursor to its wrapper.\n\n\n if (typeof options.cursor === 'string') {\n cursorWrapper.innerHTML = options.cursor;\n } else if (options.cursor instanceof HTMLElement) {\n cursorWrapper.appendChild(options.cursor);\n }\n } // ---------- CREATE A MINIMAP View AND DISPLAY DATA PASSED IN Layer PARAMETER : ----------\n\n\n _this.view = new PlanarView(_this.domElement, layer.source.extent, {\n camera: {\n type: CAMERA_TYPE.ORTHOGRAPHIC\n },\n placement: layer.source.extent,\n // TODO : the default placement should be the view extent for ortho camera\n noControls: true,\n maxSubdivisionLevel: view.tileLayer.maxSubdivisionLevel,\n disableFocusOnStart: true\n });\n\n _this.view.addLayer(layer); // TODO : should this promise be returned by constructor so that user can use it ?\n // Prevent the minimap domElement to get focus when clicked, and prevent click event to be propagated to the\n // main view controls.\n\n\n _this.domElement.addEventListener('pointerdown', function (event) {\n event.preventDefault();\n }); // Store minimap view camera3D in constant for code convenience.\n\n\n var camera3D = _this.view.camera.camera3D; // ---------- UPDATE MINIMAP VIEW WHEN UPDATING THE MAIN VIEW : ----------\n // The minimal and maximal value the minimap camera3D zoom can reach in order to stay in the scale limits.\n\n var initialScale = _this.view.getScale(options.pitch);\n\n var minZoom = camera3D.zoom * _this.maxScale / initialScale;\n var maxZoom = camera3D.zoom * _this.minScale / initialScale; // Coordinates used to transform position vectors from the main view CRS to the minimap view CRS.\n\n var mainViewCoordinates = new Coordinates(view.referenceCrs);\n var viewCoordinates = new Coordinates(_this.view.referenceCrs);\n var targetPosition = view.controls.getCameraTargetPosition();\n view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_RENDER, function () {\n // Update minimap camera zoom\n var distance = view.camera.camera3D.position.distanceTo(targetPosition);\n var scale = view.getScaleFromDistance(options.pitch, distance);\n camera3D.zoom = _this.zoomRatio * maxZoom * scale / _this.minScale;\n camera3D.zoom = Math.min(Math.max(camera3D.zoom, minZoom), maxZoom);\n camera3D.updateProjectionMatrix(); // Update minimap camera position.\n\n mainViewCoordinates.setFromVector3(view.controls.getCameraTargetPosition());\n mainViewCoordinates.as(_this.view.referenceCrs, viewCoordinates);\n camera3D.position.x = viewCoordinates.x;\n camera3D.position.y = viewCoordinates.y;\n camera3D.updateMatrixWorld(true);\n\n _this.view.notifyChange(camera3D);\n });\n return _this;\n }\n\n return _createClass(Minimap);\n}(Widget);\n\nexport default Minimap;","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nimport { CONTROL_EVENTS } from \"../../Controls/GlobeControls\";\nimport { GLOBE_VIEW_EVENTS } from \"../../Core/Prefab/GlobeView\";\nimport { PLANAR_CONTROL_EVENT } from \"../../Controls/PlanarControls\";\nimport { VIEW_EVENTS } from \"../../Core/View\";\nimport Widget from \"./Widget\";\nvar DEFAULT_OPTIONS = {\n width: 200,\n height: 30,\n position: 'bottom-left'\n};\n/**\n * A widget for scale\n *\n * To use it, you need to link the widgets' stylesheet to your html webpage. This stylesheet is included in\n * [itowns bundles](https://github.com/iTowns/itowns/releases) if you downloaded them, or it can be found in\n * `node_modules/itowns/examples/css` if you installed iTowns with npm. Otherwise, it can be found at\n * [this link](https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css). See\n * [this example](http://www.itowns-project.org/itowns/examples/#widgets_scale) for more details.\n *\n * @extends Widget\n *\n * @property {HTMLElement} domElement An html div containing the scale.\n * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.\n */\n\nvar Scale = /*#__PURE__*/function (_Widget) {\n _inherits(Scale, _Widget);\n\n var _super = _createSuper(Scale);\n\n /**\n * @param {View} view The iTowns view the scale should be\n * linked to. If it is a\n * {@link PlanarView} or a\n * {@link GlobeView}, the scale will be\n * automatically updated. Otherwise, user\n * will need to implement the update\n * automation using the `Scale.update`\n * method.\n * @param {Object} [options] The scale optional configuration.\n * @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div\n * which contains scale widgets.\n * @param {number} [options.width=200] The width in pixels of the scale.\n * @param {number} [options.height=30] The height in pixels of the scale.\n * @param {string} [options.position='bottom-left'] Defines which position within the\n * `parentElement` the scale should be\n * displayed to. Possible values are\n * `top`, `bottom`, `left`, `right`,\n * `top-left`, `top-right`, `bottom-left`\n * and `bottom-right`. If the input value\n * does not match one of these, it will\n * be defaulted to `bottom-left`.\n * @param {Object} [options.translate] An optional translation of the scale.\n * @param {number} [options.translate.x=0] The scale translation along the page\n * x-axis.\n * @param {number} [options.translate.y=0] The scale translation along the page\n * y-axis.\n */\n function Scale(view) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Scale);\n\n // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------\n _this = _super.call(this, view, options, DEFAULT_OPTIONS); // ---------- this.domElement SETTINGS SPECIFIC TO SCALE : ----------\n\n _this.domElement.id = 'widgets-scale';\n _this.view = view; // Initialize the text content of the scale, which will later be updated by a numerical value.\n\n _this.domElement.innerHTML = 'Scale';\n _this.width = options.width || DEFAULT_OPTIONS.width;\n\n if (_this.view.isGlobeView) {\n _this.view.addEventListener(GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, function () {\n _this.update();\n });\n\n _this.view.controls.addEventListener(CONTROL_EVENTS.RANGE_CHANGED, function () {\n _this.update();\n });\n } else if (_this.view.isPlanarView) {\n _this.view.addEventListener(VIEW_EVENTS.INITIALIZED, function () {\n _this.update();\n });\n\n _this.view.addEventListener(PLANAR_CONTROL_EVENT.MOVED, function () {\n _this.update();\n });\n } else {\n console.warn('The \\'view\\' linked to scale widget is neither a \\'GlobeView\\' nor a \\'PlanarView\\'. The ' + 'scale wont automatically update. You can implement its update automation using \\'Scale.update\\' ' + 'method.');\n }\n\n return _this;\n }\n\n _createClass(Scale, [{\n key: \"addEventListeners\",\n value: function addEventListeners() {}\n /**\n * Update the scale size and content according to view camera position.\n */\n\n }, {\n key: \"update\",\n value: function update() {\n // Calculate the rounded metric distance which matches the scale width in pixels.\n var metricDistance = Math.round(this.view.getPixelsToMeters(this.width));\n var digit = Math.pow(10, metricDistance.toString().length - 1);\n metricDistance = Math.round(metricDistance / digit) * digit;\n var pixelDistance = this.view.getMetersToPixels(metricDistance);\n var unit = 'm';\n\n if (metricDistance >= 1000) {\n metricDistance /= 1000;\n unit = 'km';\n }\n\n this.domElement.innerHTML = \"\".concat(metricDistance, \" \").concat(unit);\n this.domElement.style.width = \"\".concat(pixelDistance, \"px\");\n }\n }]);\n\n return Scale;\n}(Widget);\n\nexport default Scale;","import _createClass from \"@babel/runtime/helpers/createClass\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nimport Fetcher from \"../../Provider/Fetcher\";\nimport Widget from \"./Widget\";\nvar DEFAULT_OPTIONS = {\n width: 300,\n height: 38,\n position: 'top',\n maxSuggestionNumber: 10,\n fontSize: 16,\n placeholder: 'Search location'\n};\n\nfunction addActive(htmlElements, index) {\n var _htmlElements$index;\n\n if (!htmlElements) {\n return index;\n }\n\n removeAllActives(htmlElements);\n\n if (index >= htmlElements.length) {\n index = 0;\n } else if (index < 0) {\n index = htmlElements.length - 1;\n }\n\n (_htmlElements$index = htmlElements[index]) === null || _htmlElements$index === void 0 ? void 0 : _htmlElements$index.classList.add('active');\n return index;\n}\n\nfunction removeAllActives(htmlElements) {\n for (var i = 0; i < htmlElements.length; i++) {\n htmlElements[i].classList.remove('active');\n }\n}\n\nfunction eraseSuggestionList(form) {\n while (form.children.length > 1) {\n form.removeChild(form.lastChild);\n }\n}\n/**\n * A widget for searchbar\n *\n * To use it, you need to link the widgets' stylesheet to your html webpage. This stylesheet is included in\n * [itowns bundles](https://github.com/iTowns/itowns/releases) if you downloaded them, or it can be found in\n * `node_modules/itowns/examples/css` if you installed iTowns with npm. Otherwise, it can be found at\n * [this link](https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css). See\n * [this example](http://www.itowns-project.org/itowns/examples/#widgets_searchbar) for more details.\n *\n * @extends Widget\n *\n * @property {HTMLElement} domElement An html div containing the searchbar.\n * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.\n */\n\n\nvar _onSelected = /*#__PURE__*/new WeakMap();\n\nvar Searchbar = /*#__PURE__*/function (_Widget) {\n _inherits(Searchbar, _Widget);\n\n var _super = _createSuper(Searchbar);\n\n /**\n * @param {View} view The iTowns view the searchbar should be linked\n * to.\n *\n * @param {Object} geocodingOptions Configuration for geocoding.\n * @param {URL} geocodingOptions.url The URL of a geocoding service that should be\n * used to build suggestions.\n * @param {function} geocodingOptions.parser A method to parse fetched results from geocoding\n * url into a Map object. For each entry of this\n * Map, the key must be a string that will be\n * displayed as the html content of each\n * suggestion bellow the searchbar. The value\n * associated to the key is whatever the user\n * wants. The value is the parameter that is\n * passed to the `onSelected` method (specified\n * in another `geocodingOptions` parameter).\n * @param {function} [geocodingOptions.onSelected] A method which describes what should be done\n * when user selects a location (by clicking or\n * hitting enter on a suggestion). The only\n * parameter of this method is the value mapped\n * with `geocodingOptions.parser` method.\n *\n * @param {Object} [options] The searchbar optional configuration.\n * @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div which\n * contains searchbar widgets.\n * @param {number} [options.size] The size of the searchbar. It is a number that\n * describes both width and height in pixels of\n * the searchbar.\n * @param {number} [options.width=300] The width in pixels of the searchbar.\n * @param {number} [options.height=38] The height in pixels of the searchbar.\n * @param {string} [options.position='top'] Defines which position within the\n * `parentElement` the searchbar should be\n * displayed to. Possible values are `top`,\n * `bottom`, `left`, `right`, `top-left`,\n * `top-right`, `bottom-left` and `bottom-right`.\n * If the input value does not match one of\n * these, it will be defaulted to `top`.\n * @param {Object} [options.translate] An optional translation of the searchbar.\n * @param {number} [options.translate.x=0] The searchbar translation along the page x-axis.\n * @param {number} [options.translate.y=0] The searchbar translation along the page y-axis.\n * @param {number} [options.fontSize=16] The font size in pixel of the searchbar content.\n * @param {number} [options.maxSuggestionNumber=10] The maximum number of suggestions that should\n * appear under the searchbar.\n * @param {string} [options.placeholder='Search location'] The placeholder that appears in the searchbar\n * when nothing has yet been typed.\n */\n function Searchbar(view, geocodingOptions) {\n var _geocodingOptions$onS;\n\n var _this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _classCallCheck(this, Searchbar);\n\n // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------\n _this = _super.call(this, view, options, DEFAULT_OPTIONS); // Check if `geocodingOptions` parameter was correctly specified.\n\n _classPrivateFieldInitSpec(_assertThisInitialized(_this), _onSelected, {\n writable: true,\n value: void 0\n });\n\n if (!geocodingOptions || !geocodingOptions.url || !geocodingOptions.parser || typeof geocodingOptions.parser !== 'function') {\n throw new Error('\\'geocodingOptions\\' parameter for \\'Searchbar\\' constructor is not a valid option. Please refer to ' + 'the documentation.');\n }\n\n _classPrivateFieldSet(_assertThisInitialized(_this), _onSelected, (_geocodingOptions$onS = geocodingOptions.onSelected) !== null && _geocodingOptions$onS !== void 0 ? _geocodingOptions$onS : function () {}); // ---------- this.domElement SETTINGS SPECIFIC TO SEARCHBAR : ----------\n\n\n _this.domElement.id = 'widgets-searchbar';\n _this.domElement.style.height = 'auto';\n var form = document.createElement('form');\n form.setAttribute('autocomplete', 'off');\n form.id = 'searchbar-autocompletion-form';\n\n _this.domElement.appendChild(form);\n\n var input = document.createElement('input');\n input.setAttribute('type', 'text');\n input.setAttribute('name', 'mySearch');\n input.setAttribute('placeholder', options.placeholder || DEFAULT_OPTIONS.placeholder);\n input.style.height = \"\".concat(options.height || options.size || DEFAULT_OPTIONS.height, \"px\");\n input.style.fontSize = \"\".concat(options.fontSize || DEFAULT_OPTIONS.fontSize, \"px\");\n form.appendChild(input); // currentFocus variable stores the index of the suggestions that is focused by user, either with mouse or arrow\n // keys.\n\n var currentFocus; // ---------- BUILD AUTOCOMPLETION SUGGESTIONS LIST WHEN TYPING THE SEARCHBAR INPUT : ----------\n\n input.addEventListener('input', function () {\n var value = input.value; // Close any already opened list of autocompleted values\n\n eraseSuggestionList(form);\n currentFocus = -1;\n\n if (!value) {\n return false;\n }\n\n geocodingOptions.url.searchParams.set('text', value);\n Fetcher.json(geocodingOptions.url).then(function (geocodingResult) {\n var result = geocodingOptions.parser(geocodingResult);\n var i = 0;\n result.forEach(function (info, location) {\n // Stop looping through the map if enough location have been proceeded.\n if (i === Math.min(result.size, options.maxSuggestionNumber || DEFAULT_OPTIONS.maxSuggestionNumber)) {\n return;\n }\n\n var mapIndex = i;\n i++;\n var index = location.toUpperCase().indexOf(value.toUpperCase());\n\n if (index > -1) {\n var autocompleteItem = document.createElement('div');\n autocompleteItem.style.minHeight = input.style.height;\n autocompleteItem.style.fontSize = \"\".concat(options.fontSize || DEFAULT_OPTIONS.fontSize, \"px\"); // Make the matching letters bold.\n\n var start = location.slice(0, index);\n var bold = location.slice(index, index + value.length);\n var end = location.slice(index + value.length, location.length);\n autocompleteItem.innerHTML = \"<p>\".concat(start, \"<strong>\").concat(bold, \"</strong>\").concat(end, \"</p>\"); // Store the current location value as an attribute of autocompleteItem div.\n\n autocompleteItem.setAttribute('location', location);\n form.appendChild(autocompleteItem); // eslint-disable-next-line no-loop-func\n\n autocompleteItem.addEventListener('mouseover', function () {\n removeAllActives(form.children);\n currentFocus = mapIndex;\n autocompleteItem.classList.add('active');\n });\n autocompleteItem.addEventListener('click', function () {\n _classPrivateFieldGet(_assertThisInitialized(_this), _onSelected).call(_assertThisInitialized(_this), info);\n\n input.value = autocompleteItem.getAttribute('location');\n eraseSuggestionList(form);\n });\n }\n });\n });\n }); // ---------- MANAGE KEYBOARD INTERACTIONS ON AUTOCOMPLETION SUGGESTIONS : ----------\n // When searchbar is positioned at the bottom of the screen (therefore is a flex with `column-reverse`\n // direction, we must exchange up and down arrow actions.\n\n var topOrBottom = (options.position || DEFAULT_OPTIONS.position).includes('top') ? 1 : -1;\n input.addEventListener('keydown', function (event) {\n event.stopPropagation();\n var completionSuggestions = form.getElementsByTagName('div');\n\n switch (event.code) {\n case 'Escape':\n eraseSuggestionList(form);\n input.value = '';\n view.domElement.focus();\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n currentFocus = addActive(completionSuggestions, currentFocus + topOrBottom);\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n currentFocus = addActive(completionSuggestions, currentFocus - topOrBottom);\n break;\n\n case 'Enter':\n event.preventDefault();\n\n if (completionSuggestions[Math.max(currentFocus, 0)]) {\n completionSuggestions[Math.max(currentFocus, 0)].click();\n view.domElement.focus();\n }\n\n break;\n\n default:\n break;\n }\n }); // ---------- MANAGE FOCUS AND ACTIVE SUGGESTION WHEN USER ENTERS OR LEAVES THE SEARCHBAR : ----------\n // User clicks the searchbar.\n\n input.addEventListener('focus', function () {\n form.classList.add('focus');\n }); // User clicks out of the searchbar.\n\n input.addEventListener('blur', function () {\n form.classList.remove('focus');\n removeAllActives(form.children);\n }); // Cursor leaves the searchbar.\n\n form.addEventListener('mouseleave', function () {\n removeAllActives(form.children);\n currentFocus = -1;\n });\n return _this;\n }\n\n return _createClass(Searchbar);\n}(Widget);\n\nexport default Searchbar;"],"names":["root","factory","exports","module","define","amd","self","_classPrivateFieldInitSpec","obj","privateMap","value","privateCollection","has","TypeError","_checkPrivateRedeclaration","set","_display","WeakMap","Widget","view","options","arguments","length","undefined","defaultOptions","this","writable","parentElement","domElement","position","includes","console","warn","concat","document","createElement","appendChild","style","width","size","height","positionArray","split","classList","add","left","offsetWidth","top","offsetHeight","translate","transform","x","y","addEventListener","e","stopPropagation","key","display","window","getComputedStyle","_classPrivateMethodInitSpec","privateSet","_classPrivateMethodGet","receiver","fn","DEFAULT_OPTIONS","displayCompass","display3DToggle","displayZoomIn","displayZoomOut","animationDuration","direction","DEFAULT_BUTTONS","id","content","info","parentId","_view","_action","WeakSet","_addDefaultButton","_action2","params","time","controls","lookAtCoordinate","_addDefaultButton2","settings","onclick","addButton","_Widget","Navigation","Derived","hasNativeReflectConstruct","_super","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","_isNativeReflectConstruct","result","Super","NewTarget","constructor","apply","_options$displayCompa","_options$display3DTog","_options$displayZoomI","_options$displayZoomO","_this","isGlobeView","Error","compass","heading","tilt","event","toggle3D","getTilt","innerHTML","zoomIn","zoom","Math","min","getZoom","zoomOut","max","_this2","title","buttonBar","getElementById","addButtonBar","button","className","tabIndex","activeElement","focus","minScale","maxScale","zoomRatio","Minimap","layer","isColorLayer","cursor","cursorWrapper","HTMLElement","PlanarView","source","extent","camera","type","placement","noControls","maxSubdivisionLevel","tileLayer","disableFocusOnStart","addLayer","preventDefault","camera3D","initialScale","getScale","pitch","minZoom","maxZoom","mainViewCoordinates","Coordinates","referenceCrs","viewCoordinates","targetPosition","getCameraTargetPosition","addFrameRequester","distance","distanceTo","scale","getScaleFromDistance","updateProjectionMatrix","setFromVector3","as","updateMatrixWorld","notifyChange","Scale","update","isPlanarView","metricDistance","round","getPixelsToMeters","digit","pow","toString","pixelDistance","getMetersToPixels","unit","maxSuggestionNumber","fontSize","placeholder","addActive","htmlElements","index","_htmlElements$index","removeAllActives","i","remove","eraseSuggestionList","form","children","removeChild","lastChild","_onSelected","Searchbar","geocodingOptions","_geocodingOptions$onS","url","parser","onSelected","setAttribute","currentFocus","input","searchParams","Fetcher","then","geocodingResult","forEach","location","mapIndex","toUpperCase","indexOf","autocompleteItem","minHeight","start","slice","bold","end","getAttribute","topOrBottom","completionSuggestions","getElementsByTagName","code","click"],"sourceRoot":""}
@@ -29,6 +29,7 @@
29
29
  "Vector tiles": {
30
30
  "vector_tile_raster_3d": "Raster on 3D map",
31
31
  "vector_tile_raster_2d": "Raster on 2D map",
32
+ "vector_tile_3d_mesh": "Vector tile to 3d objects",
32
33
  "vector_tile_dragndrop": "Drag and drop a style"
33
34
  },
34
35
 
@@ -80,7 +81,9 @@
80
81
 
81
82
  "Widgets": {
82
83
  "widgets_navigation": "Navigation",
83
- "widgets_minimap": "Minimap"
84
+ "widgets_minimap": "Minimap",
85
+ "widgets_scale": "Scale",
86
+ "widgets_searchbar": "Searchbar"
84
87
  },
85
88
 
86
89
  "Plugins": {
@@ -75,8 +75,28 @@ body {
75
75
 
76
76
  #view-source {
77
77
  position: fixed;
78
- right: 10px;
78
+ right: 25px;
79
79
  bottom: 10px;
80
+ width: 30px;
81
+ height: 30px;
82
+ padding: 0;
83
+ box-sizing: border-box;
84
+
85
+ border: 1px solid #222222;
86
+ border-radius: 7px;
87
+ background-color: #313336bb;
88
+
89
+ background-image: url('../images/code-logo.svg');
90
+ background-repeat: no-repeat;
91
+ background-position: center;
92
+ background-size: 90%;
93
+ }
94
+
95
+ #view-source:hover {
96
+ cursor: pointer;
97
+ }
98
+ #view-source:active {
99
+ background-color: #222222;
80
100
  }
81
101
 
82
102
  /* NAVIGATION (LEFT) */
@@ -161,10 +161,10 @@
161
161
  }
162
162
 
163
163
  /* Zoom buttons shape and position within a COLUMN direction widget group. */
164
- #widgets-navigation.column-widget #zoom-button-bar > .widget-button:first-child {
164
+ #widgets-navigation.column-widget #zoom-button-bar > .widget-button:first-child:not(:only-child) {
165
165
  border-radius: 7px 7px 0 0;
166
166
  }
167
- #widgets-navigation.column-widget #zoom-button-bar > .widget-button:last-child {
167
+ #widgets-navigation.column-widget #zoom-button-bar > .widget-button:last-child:not(:only-child) {
168
168
  border-radius: 0 0 7px 7px;
169
169
  }
170
170
  #widgets-navigation.column-widget.bottom-widget #zoom-button-bar > .widget-button:not(:last-child) {
@@ -173,10 +173,10 @@
173
173
  }
174
174
 
175
175
  /* Zoom buttons shape and position within a ROW direction navigation menu. */
176
- #widgets-navigation.row-widget #zoom-button-bar > .widget-button:first-child {
176
+ #widgets-navigation.row-widget #zoom-button-bar > .widget-button:first-child:not(:only-child) {
177
177
  border-radius: 0 7px 7px 0;
178
178
  }
179
- #widgets-navigation.row-widget #zoom-button-bar > .widget-button:last-child {
179
+ #widgets-navigation.row-widget #zoom-button-bar > .widget-button:last-child:not(:only-child) {
180
180
  border-radius: 7px 0 0 7px;
181
181
  }
182
182
  #widgets-navigation.row-widget.left-widget #zoom-button-bar > .widget-button:not(:last-child) {
@@ -194,7 +194,7 @@
194
194
  width: 50%;
195
195
  height: 50%;
196
196
 
197
- background-image: url('../images/widget-logo.svg');
197
+ background-image: url('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/GUI/widget-logo.svg');
198
198
  background-size: 100%;
199
199
  }
200
200
  #widgets-navigation #zoom-out-logo {
@@ -211,7 +211,7 @@
211
211
 
212
212
  border-radius: 50%;
213
213
 
214
- background-image: url('../images/compass.svg');
214
+ background-image: url('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/GUI/compass.svg');
215
215
  background-repeat: no-repeat;
216
216
  background-size: auto 90%;
217
217
  background-position: center;
@@ -246,3 +246,115 @@
246
246
  font-size: 40px;
247
247
  color: #222222;
248
248
  }
249
+
250
+
251
+
252
+ /* ---------- SCALE WIDGET SETTINGS : ------------------------------------------------------------------------------- */
253
+
254
+ #widgets-scale {
255
+ user-select: none;
256
+
257
+ position: absolute;
258
+ z-index: 10;
259
+ padding: 0 10px;
260
+ box-sizing: border-box;
261
+
262
+ display: flex;
263
+ align-items: center;
264
+
265
+ border: 1px solid #ffffffcc;
266
+ border-radius: 0 0 7px 7px;
267
+ border-top: none;
268
+
269
+ background-image: linear-gradient(#31333600, #313336ff);
270
+
271
+ color: #ffffff;
272
+ font-family: 'Open Sans', sans-serif;
273
+ font-size: 15px;
274
+ }
275
+
276
+ #widgets-scale.left-widget {
277
+ justify-content: flex-start;
278
+ }
279
+ #widgets-scale.right-widget {
280
+ justify-content: flex-end;
281
+ }
282
+
283
+
284
+
285
+ /* ---------- SEARCHBAR WIDGET SETTINGS : --------------------------------------------------------------------------- */
286
+
287
+ #widgets-searchbar {
288
+ position: absolute;
289
+ z-index: 10;
290
+ }
291
+
292
+ #widgets-searchbar > form {
293
+ display: flex;
294
+ flex-direction: column;
295
+ margin: 0;
296
+ border-radius: 7px;
297
+ }
298
+ #widgets-searchbar.top-widget > form {
299
+ flex-direction: column;
300
+ }
301
+ #widgets-searchbar.bottom-widget > form {
302
+ flex-direction: column-reverse;
303
+ }
304
+ #widgets-searchbar > form.focus {
305
+ box-shadow: 0 0 10px #222222;
306
+ }
307
+
308
+
309
+
310
+ /* ---------- SEARCHBAR INPUT AND SUGGESTIONS : --------------------------------------------------------------------- */
311
+
312
+ #widgets-searchbar:not(.bottom-widget) form > *:last-child:not(:only-child),
313
+ #widgets-searchbar.bottom-widget form > *:first-child:not(:only-child) {
314
+ border-radius: 0 0 7px 7px;
315
+ }
316
+ #widgets-searchbar:not(.bottom-widget) form > *:first-child:not(:only-child),
317
+ #widgets-searchbar.bottom-widget form > *:last-child:not(:only-child) {
318
+ border-radius: 7px 7px 0 0;
319
+ }
320
+ #widgets-searchbar form > *:only-child {
321
+ border-radius: 7px;
322
+ }
323
+ #widgets-searchbar:not(.bottom-widget) form > *:not(:first-child):not(:last-child) {
324
+ border-bottom: none;
325
+ }
326
+ #widgets-searchbar.bottom-widget form > *:not(:first-child):not(:last-child) {
327
+ border-top: none;
328
+ }
329
+
330
+ #widgets-searchbar form > * {
331
+ box-sizing: border-box;
332
+ width: 100%;
333
+ padding: 0 10px;
334
+ background-color: #313336bb;
335
+ border: 1px solid #222222;
336
+ color: #ffffff;
337
+ font-family: Arial;
338
+ }
339
+
340
+ #widgets-searchbar form > input::placeholder {
341
+ color: #ffffff80;
342
+ }
343
+ #widgets-searchbar form > input:focus {
344
+ outline: none !important;
345
+ }
346
+
347
+ #widgets-searchbar form > div {
348
+ display: flex;
349
+ align-items: center;
350
+ }
351
+ #widgets-searchbar form > div.active {
352
+ background-color: #222222;
353
+ }
354
+ #widgets-searchbar form > div:hover {
355
+ cursor: pointer;
356
+ }
357
+
358
+ #widgets-searchbar form > div > p {
359
+ margin: 8px 0;
360
+ }
@@ -0,0 +1,43 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ width="24px"
4
+ height="24px"
5
+ viewBox="0 0 24 24"
6
+ fill="#000000"
7
+ version="1.1"
8
+ id="svg6"
9
+ sodipodi:docname="code-logo.svg"
10
+ inkscape:version="1.1.2 (76b9e6a115, 2022-02-25)"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ xmlns:svg="http://www.w3.org/2000/svg">
15
+ <defs
16
+ id="defs10" />
17
+ <sodipodi:namedview
18
+ id="namedview8"
19
+ pagecolor="#ffffff"
20
+ bordercolor="#666666"
21
+ borderopacity="1.0"
22
+ inkscape:pageshadow="2"
23
+ inkscape:pageopacity="0.0"
24
+ inkscape:pagecheckerboard="0"
25
+ showgrid="false"
26
+ inkscape:zoom="32"
27
+ inkscape:cx="10.78125"
28
+ inkscape:cy="13.359375"
29
+ inkscape:window-width="1920"
30
+ inkscape:window-height="1020"
31
+ inkscape:window-x="1920"
32
+ inkscape:window-y="28"
33
+ inkscape:window-maximized="1"
34
+ inkscape:current-layer="svg6" />
35
+ <path
36
+ fill="none"
37
+ d="M0 0h24v24H0V0z"
38
+ id="path2" />
39
+ <path
40
+ d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"
41
+ id="path4"
42
+ style="fill:#ffffff" />
43
+ </svg>
@@ -11,7 +11,7 @@
11
11
 
12
12
  <div id="main">
13
13
  <iframe id="content" class="scroll-section" frameborder="0" height="100%"></iframe>
14
- <div id="view-source" class="text"></div>
14
+ <button id="view-source" class="text" title="View source"></button>
15
15
  </div>
16
16
 
17
17
  <nav class="scroll-section">
@@ -50,10 +50,10 @@
50
50
  iframe.src = url.replace('index.html', '');
51
51
  iframe.focus();
52
52
 
53
- var viewSrc = '<a href="https://github.com/iTowns/itowns/blob/master/examples/';
54
- viewSrc += window.location.hash.substr(1) || 'view_3d_map';
55
- viewSrc += '.html" target="_blank">View source</a>';
56
- document.getElementById('view-source').innerHTML = viewSrc;
53
+ let viewSrc = `https://github.com/iTowns/itowns/blob/master/examples/${
54
+ window.location.hash.substr(1) || 'view_3d_map'
55
+ }.html`;
56
+ document.getElementById('view-source').onclick = () => { window.open(viewSrc); };
57
57
  }
58
58
 
59
59
  function initNavigation(list) {
@@ -11,7 +11,6 @@
11
11
  </head>
12
12
  <body>
13
13
  <div id="viewerDiv"></div>
14
- <span id="divScaleWidget"> Scale </span>
15
14
  <div id="miniDiv"></div>
16
15
 
17
16
  <script src="js/GUI/GuiTools.js"></script>