-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gallery::Imagery Layers Split #5948
Conversation
@pasu, thanks for the pull request! Maintainers, we have a signed CLA from @pasu, so you can review this at any time.
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this update @pasu!
For reference, the style/formatting suggestions I made are based on our Coding Guide.
Make sure to update CHANGES.md as well.
@@ -68,27 +68,41 @@ | |||
var slider = document.getElementById('slider'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really relevant to your changes, but can you add infoBox: false
as an option when creating the viewer? It will keep the infobox from popping up without any information.
|
||
document.getElementById('slider').addEventListener('mousedown', mouseDown, false); | ||
window.addEventListener('mouseup', mouseUp, false); | ||
var bMoveActive = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please call this just moveActive
, (or maybe slideActive
).
function mouseUp() { | ||
window.removeEventListener('mousemove', sliderMove, true); | ||
} | ||
function move(movement){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting should be consistant with the rest of the code base.
function move(movement){
-> function move(movement) {
if(!bMoveActive){
-> if (!bMoveActive) {
var slider = document.getElementById('slider'); | ||
dragStartX = e.clientX - slider.offsetLeft; | ||
window.addEventListener('mousemove', sliderMove, true); | ||
var nMove = movement.endPosition.x ;//- movement.startPosition.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nMove
-> movementAmount
or something more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the extra comment
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 + "%"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use single quotes '
throughout our js
slider.style.left = 100.0 * splitPosition + "%"; | ||
viewer.scene.imagerySplitPosition = splitPosition; | ||
} | ||
handler.setInputAction(function(movement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to include the movement
parameter in the function if you're not going to use it.
bMoveActive = true; | ||
}, Cesium.ScreenSpaceEventType.PINCH_START); | ||
|
||
handler.setInputAction(function(movement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be shoehorned to
handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE);
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
Hi, @ggetz , thanks for your kind review, I did it. |
Hey @pasu, thanks for the updates! Code looks good to me now. For CHANGES.md, you should be able to fetch cesium/master and merge it into your branch. You can then resolve any conflicts. However, you'll want to put your changes in a new release ( |
ok, I fix the conflicts. |
Thanks @pasu! |
### 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggetz are you sure this CHANGES.md diff is OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjcozzi I'm not sure what went wrong with this diff, but I just checked and CHANGES is correct in master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks!
optimizer this example
the detail is here:#5781