From 25e94237c28f82cbd4b47eb9dd6d181a40849664 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 31 Oct 2017 10:20:34 +0800 Subject: [PATCH 1/6] use ScreenSpaceEventHandler for the action in multi-devices --- .../gallery/Imagery Layers Split.html | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/Apps/Sandcastle/gallery/Imagery Layers Split.html b/Apps/Sandcastle/gallery/Imagery Layers Split.html index adec29907a4a..4ce92ef04a20 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Split.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Split.html @@ -26,7 +26,7 @@ left: 50%; top: 0px; background-color: #D3D3D3; - width: 2px; + width: 5px; height: 100%; z-index: 9999; } @@ -68,27 +68,40 @@ var slider = document.getElementById('slider'); viewer.scene.imagerySplitPosition = (slider.offsetLeft) / slider.parentElement.offsetWidth; -var dragStartX = 0; +var handler = new Cesium.ScreenSpaceEventHandler(slider); -document.getElementById('slider').addEventListener('mousedown', mouseDown, false); -window.addEventListener('mouseup', mouseUp, false); +var bMoveActive = false; -function mouseUp() { - window.removeEventListener('mousemove', sliderMove, true); -} +function move(movement){ + if(!bMoveActive) + return; -function mouseDown(e) { - var slider = document.getElementById('slider'); - dragStartX = e.clientX - slider.offsetLeft; - window.addEventListener('mousemove', sliderMove, true); + var nMove = movement.endPosition.x ;//- movement.startPosition.x; + var splitPosition = (slider.offsetLeft + nMove) / slider.parentElement.offsetWidth; + slider.style.left = 100.0 * splitPosition + "%"; + viewer.scene.imagerySplitPosition = splitPosition; } -function sliderMove(e) { - var slider = document.getElementById('slider'); - var splitPosition = (e.clientX - dragStartX) / slider.parentElement.offsetWidth; - slider.style.left = 100.0 * splitPosition + "%"; - viewer.scene.imagerySplitPosition = splitPosition; -} +handler.setInputAction(function(movement) { + bMoveActive = true; +}, Cesium.ScreenSpaceEventType.LEFT_DOWN); +handler.setInputAction(function(movement) { + bMoveActive = true; +}, Cesium.ScreenSpaceEventType.PINCH_START); + +handler.setInputAction(function(movement) { + move(movement); +}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); +handler.setInputAction(function(movement) { + move(movement); +}, Cesium.ScreenSpaceEventType.PINCH_MOVE); + +handler.setInputAction(function(movement) { + bMoveActive = false; +}, Cesium.ScreenSpaceEventType.LEFT_UP); +handler.setInputAction(function(movement) { + bMoveActive = false; +}, Cesium.ScreenSpaceEventType.PINCH_END); //Sandcastle_End From aecdc10295b4c613e4d09fc36dcbc4378cc5d4ae Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 31 Oct 2017 10:40:49 +0800 Subject: [PATCH 2/6] add '{}' after if to satisfy the Syntax check --- Apps/Sandcastle/gallery/Imagery Layers Split.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Apps/Sandcastle/gallery/Imagery Layers Split.html b/Apps/Sandcastle/gallery/Imagery Layers Split.html index 4ce92ef04a20..3fc34ff2b2c3 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Split.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Split.html @@ -73,8 +73,9 @@ var bMoveActive = false; function move(movement){ - if(!bMoveActive) + if(!bMoveActive){ return; + } var nMove = movement.endPosition.x ;//- movement.startPosition.x; var splitPosition = (slider.offsetLeft + nMove) / slider.parentElement.offsetWidth; From 735f3a74b7afe34858a3a9052a5476f8c3c4b590 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 1 Nov 2017 10:00:32 +0800 Subject: [PATCH 3/6] 1 add infobox:false when creating the viewer 2 variety name bMoveActive -> moveActive 3 function move(movement){ -> function move(movement) { if(!bMoveActive){ -> if (!bMoveActive) { 4 variety name nMove -> relativeOffset 5 remove the extra comment 6 use single quotes 7 modify handler.setInputAction --- .../gallery/Imagery Layers Split.html | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/Apps/Sandcastle/gallery/Imagery Layers Split.html b/Apps/Sandcastle/gallery/Imagery Layers Split.html index 3fc34ff2b2c3..ff9594838cea 100644 --- a/Apps/Sandcastle/gallery/Imagery Layers Split.html +++ b/Apps/Sandcastle/gallery/Imagery Layers Split.html @@ -53,7 +53,8 @@ imageryProvider : new Cesium.ArcGisMapServerImageryProvider({ url : 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer' }), - baseLayerPicker : false + baseLayerPicker : false, + infoBox : false }); var layers = viewer.imageryLayers; @@ -70,38 +71,34 @@ var handler = new Cesium.ScreenSpaceEventHandler(slider); -var bMoveActive = false; +var moveActive = false; -function move(movement){ - if(!bMoveActive){ +function move(movement) { + if(!moveActive) { return; } - var nMove = movement.endPosition.x ;//- movement.startPosition.x; - var splitPosition = (slider.offsetLeft + nMove) / slider.parentElement.offsetWidth; - slider.style.left = 100.0 * splitPosition + "%"; + var relativeOffset = movement.endPosition.x ; + var splitPosition = (slider.offsetLeft + relativeOffset) / slider.parentElement.offsetWidth; + slider.style.left = 100.0 * splitPosition + '%'; viewer.scene.imagerySplitPosition = splitPosition; } -handler.setInputAction(function(movement) { - bMoveActive = true; +handler.setInputAction(function() { + moveActive = true; }, Cesium.ScreenSpaceEventType.LEFT_DOWN); -handler.setInputAction(function(movement) { - bMoveActive = true; +handler.setInputAction(function() { + moveActive = true; }, Cesium.ScreenSpaceEventType.PINCH_START); -handler.setInputAction(function(movement) { - move(movement); -}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); -handler.setInputAction(function(movement) { - move(movement); -}, Cesium.ScreenSpaceEventType.PINCH_MOVE); +handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE); +handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE); -handler.setInputAction(function(movement) { - bMoveActive = false; +handler.setInputAction(function() { + moveActive = false; }, Cesium.ScreenSpaceEventType.LEFT_UP); -handler.setInputAction(function(movement) { - bMoveActive = false; +handler.setInputAction(function() { + moveActive = false; }, Cesium.ScreenSpaceEventType.PINCH_END); From e9579033ac2a46ed903c9e2034a95fc881eb568f Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 1 Nov 2017 10:02:05 +0800 Subject: [PATCH 4/6] add description for the Imagery Layers Split demo application --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 666d114b9b18..f838a4f8b3e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Change Log * Improved CZML Reference Properties example [#5754](https://github.com/AnalyticalGraphicsInc/cesium/pull/5754) * Fixed bug with placemarks in imported KML: placemarks with no specified icon would be displayed with default icon. [#5819](https://github.com/AnalyticalGraphicsInc/cesium/issues/5819) * Fixed bright fog when terrain lighting is enabled and added `Fog.minimumBrightness` to affect how bright the fog will be when in complete darkness. [#5934](https://github.com/AnalyticalGraphicsInc/cesium/pull/5934) +* Added ability to support touch event in Imagery Layers Split demo application. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948) ### 1.38 - 2017-10-02 From af804cc58040b4d31097c7db79511899c3648bc2 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 1 Nov 2017 10:06:16 +0800 Subject: [PATCH 5/6] update to the latest CHANGES.md --- CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index f838a4f8b3e6..1ab867777183 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,7 @@ Change Log * Added support for the layer.json `parentUrl` property in `CesiumTerrainProvider` to allow for compositing of tilesets. * Fixed a bug that caused KML ground overlays to appear distorted when rotation was applied. [#5914](https://github.com/AnalyticalGraphicsInc/cesium/issues/5914) * Added two new properties to `ImageryLayer` that allow for adjusting the texture sampler used for up- and down-sampling of image tiles, namely `minificationFilter` and `magnificationFilter` with possible values `LINEAR` (the default) and `NEAREST` defined in `TextureMinificationFilter` and `TextureMagnificationFilter`. [#5846](https://github.com/AnalyticalGraphicsInc/cesium/issues/5846) -* The enums `TextureMinificationFilter` and `TextureMagnificationFilter` have been made public to support the new texture filter properties mentioned above. +* The enums `TextureMinificationFilter` and `TextureMagnificationFilter` have been made public to support the new texture filter properties mentioned above. * KML files load when a Network Link fails [#5871](https://github.com/AnalyticalGraphicsInc/cesium/pull/5871) * Adds `invertClassification` and `invertClassificationColor` to `Scene`. When `invertClassification` is `true`, any 3D Tiles geometry that is not classified by a `ClassificationPrimitive` or `GroundPrimitive` will have its color multiplied by `invertClassificationColor`. [#5836](https://github.com/AnalyticalGraphicsInc/cesium/pull/5836) * Added `eyeSeparation` and `focalLength` properties to `Scene` to configure VR settings. [#5917](https://github.com/AnalyticalGraphicsInc/cesium/pull/5917) @@ -17,6 +17,7 @@ Change Log * Improved CZML Reference Properties example [#5754](https://github.com/AnalyticalGraphicsInc/cesium/pull/5754) * Fixed bug with placemarks in imported KML: placemarks with no specified icon would be displayed with default icon. [#5819](https://github.com/AnalyticalGraphicsInc/cesium/issues/5819) * Fixed bright fog when terrain lighting is enabled and added `Fog.minimumBrightness` to affect how bright the fog will be when in complete darkness. [#5934](https://github.com/AnalyticalGraphicsInc/cesium/pull/5934) +* Fixed using arrow keys in geocoder widget to select search suggestions. [#5943](https://github.com/AnalyticalGraphicsInc/cesium/issues/5943) * Added ability to support touch event in Imagery Layers Split demo application. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948) ### 1.38 - 2017-10-02 From 76446d57fdc1dfa7e33496139b7b69b614ad587e Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 2 Nov 2017 09:05:24 +0800 Subject: [PATCH 6/6] update to the latest CHANGES.md --- CHANGES.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1ab867777183..fa2be9350acc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,24 +1,28 @@ Change Log ========== +### 1.40 - 2017-12-01 + +* Added ability to support touch event in Imagery Layers Split demo application. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948) + ### 1.39 - 2017-11-01 -* Added support for right-to-left language detection in labels, currently Hebrew and Arabic are supported. To enable it, set `Cesium.Label.enableRightToLeftDetection = true` at the beginning of your application. [#5771](https://github.com/AnalyticalGraphicsInc/cesium/pull/5771) -* Added the ability to load Cesium's assets from the local file system if security permissions allow it. [#5830](https://github.com/AnalyticalGraphicsInc/cesium/issues/5830) -* Added function that inserts missing namespace declarations into KML files. [#5860](https://github.com/AnalyticalGraphicsInc/cesium/pull/5860) -* Added support for the layer.json `parentUrl` property in `CesiumTerrainProvider` to allow for compositing of tilesets. +* Cesium now officially supports webpack. See our [Integrating Cesium and webpack blog post](https://cesium.com/blog/2017/10/18/cesium-and-webpack/) for more details. +* Added support for right-to-left language detection in labels, currently Hebrew and Arabic are supported. To enable it, set `Cesium.Label.enableRightToLeftDetection = true` at the start of your application. [#5771](https://github.com/AnalyticalGraphicsInc/cesium/pull/5771) +* Fixed handling of KML files with missing `xsi` namespace declarations. [#5860](https://github.com/AnalyticalGraphicsInc/cesium/pull/5860) * Fixed a bug that caused KML ground overlays to appear distorted when rotation was applied. [#5914](https://github.com/AnalyticalGraphicsInc/cesium/issues/5914) -* Added two new properties to `ImageryLayer` that allow for adjusting the texture sampler used for up- and down-sampling of image tiles, namely `minificationFilter` and `magnificationFilter` with possible values `LINEAR` (the default) and `NEAREST` defined in `TextureMinificationFilter` and `TextureMagnificationFilter`. [#5846](https://github.com/AnalyticalGraphicsInc/cesium/issues/5846) -* The enums `TextureMinificationFilter` and `TextureMagnificationFilter` have been made public to support the new texture filter properties mentioned above. -* KML files load when a Network Link fails [#5871](https://github.com/AnalyticalGraphicsInc/cesium/pull/5871) -* Adds `invertClassification` and `invertClassificationColor` to `Scene`. When `invertClassification` is `true`, any 3D Tiles geometry that is not classified by a `ClassificationPrimitive` or `GroundPrimitive` will have its color multiplied by `invertClassificationColor`. [#5836](https://github.com/AnalyticalGraphicsInc/cesium/pull/5836) -* Added `eyeSeparation` and `focalLength` properties to `Scene` to configure VR settings. [#5917](https://github.com/AnalyticalGraphicsInc/cesium/pull/5917) -* Added `customTags` property to the UrlTemplateImageryProvider to allow custom keywords in the template URL. [#5696](https://github.com/AnalyticalGraphicsInc/cesium/pull/5696) -* Improved CZML Reference Properties example [#5754](https://github.com/AnalyticalGraphicsInc/cesium/pull/5754) -* Fixed bug with placemarks in imported KML: placemarks with no specified icon would be displayed with default icon. [#5819](https://github.com/AnalyticalGraphicsInc/cesium/issues/5819) +* Fixed a bug where KML placemarks with no specified icon would be displayed with default icon. [#5819](https://github.com/AnalyticalGraphicsInc/cesium/issues/5819) +* Changed KML loading to ignore NetworkLink failures and continue to load the rest of the document. [#5871](https://github.com/AnalyticalGraphicsInc/cesium/pull/5871) +* Added the ability to load Cesium's assets from the local file system if security permissions allow it. [#5830](https://github.com/AnalyticalGraphicsInc/cesium/issues/5830) +* Added two new properties to `ImageryLayer` that allow for adjusting the texture sampler used for up and down-sampling of imagery tiles, namely `minificationFilter` and `magnificationFilter` with possible values `LINEAR` (the default) and `NEAREST` defined in `TextureMinificationFilter` and `TextureMagnificationFilter`. [#5846](https://github.com/AnalyticalGraphicsInc/cesium/issues/5846) +* Fixed flickering artifacts with 3D Tiles tilesets with thin walls. [#5940](https://github.com/AnalyticalGraphicsInc/cesium/pull/5940) * Fixed bright fog when terrain lighting is enabled and added `Fog.minimumBrightness` to affect how bright the fog will be when in complete darkness. [#5934](https://github.com/AnalyticalGraphicsInc/cesium/pull/5934) * Fixed using arrow keys in geocoder widget to select search suggestions. [#5943](https://github.com/AnalyticalGraphicsInc/cesium/issues/5943) -* Added ability to support touch event in Imagery Layers Split demo application. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948) +* Added support for the layer.json `parentUrl` property in `CesiumTerrainProvider` to allow for compositing of tilesets. [#5864](https://github.com/AnalyticalGraphicsInc/cesium/pull/5864) +* Added `invertClassification` and `invertClassificationColor` to `Scene`. When `invertClassification` is `true`, any 3D Tiles geometry that is not classified by a `ClassificationPrimitive` or `GroundPrimitive` will have its color multiplied by `invertClassificationColor`. [#5836](https://github.com/AnalyticalGraphicsInc/cesium/pull/5836) +* Added `customTags` property to the UrlTemplateImageryProvider to allow custom keywords in the template URL. [#5696](https://github.com/AnalyticalGraphicsInc/cesium/pull/5696) +* Added `eyeSeparation` and `focalLength` properties to `Scene` to configure VR settings. [#5917](https://github.com/AnalyticalGraphicsInc/cesium/pull/5917) +* Improved CZML Reference Properties example [#5754](https://github.com/AnalyticalGraphicsInc/cesium/pull/5754) ### 1.38 - 2017-10-02