-
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
Geocoding widget #1157
Geocoding widget #1157
Conversation
Conflicts: Source/Core/BingMapsApi.js
I'll get this party started. I absolutely hate the location in the upper right. I have two thoughts:
The upper left is the natural best fit and that's where it should go. Now with that out of the way, I'll spend some time this week looking at the code and playing with the widget. |
Ha, well, give it some time. It grew on me quite a bit. I think we're really used to something like that being in the upper left. But that's because we're thinking of apps like Google Maps, where that widget practically is the application. It makes sense for it to be in the most prominent location - the upper left. In Cesium, geocoding is useful, but it's not what we're all about. It makes sense to me to de-emphasize it by moving it elsewhere. And it's pragmatic, too. At one point I had it to the left of the buttons, instead of above them. I liked that better, but it didn't work well on mobile, at least in portrait mode. I could see putting it back there and making it narrower, and then using some CSS magic to make it wider when it's selected. I definitely think this belongs in the Viewer widget though. Sure, it may not be useful in every app - that's why you can turn off all the widgets in the viewer, including this one - but it's certainly at least as likely to be useful as the imagery layer picker. Also, it's my understanding that the Viewer widget is supposed to pretty much be our Cesium Viewer app, in widget form, so it doesn't make sense to me to have it on by default in Cesium Viewer, but not in the Viewer widget. Incorporating it with the data source browser in the future makes sense to me. Another idea is to demote it to just a button in the Viewer widget. Hit the button and the input box appears below the row of buttons. I'm not sure if I like that better, but it's in line with my theory that geocoding should be de-emphasized in Cesium relative to other mapping apps. |
This shouldn't hold up this pull request, but flying from the north pole to the south pole creates a strange flight. I know, I test the craziest things. CC @bagnell |
Not really my area but to help move us along... I don't like that the Chrome FPS covers it up in the upper-right, but that is not our problem. The FPS always covers things up. I do like that it is near the home button, which is pretty similar functionality. As @kring suggested, I suspect it would look better as a single line across the top when screen real estate permits - most sane cases I imagine. If it's a reasonable amount of work, this would be worth seeing. Again, not my area, but I would expect this to be in both the viewer widget and the viewer app. I thought the app was just an instance of the widget. If an app doesn't need it, they just remove it like we did for the other buttons for the Orbital app (I suppose; @mramato wrote the code). |
I'm going to make a few changes to this, I can open a PR if you want, but it's basically just making the focus behavior work like our other widgets. |
Fix CHANGES Move `padding-left` to wide and hover classes so that collapsed version is the right size Add `hasFocus` binding and document listeners so that the text box disappears in all expected situations. Cleanup knockout property declarations.
Using the `hasFocus` binding with a knockout-es5 property seems to cause issues. Instead, bind directly to a low-level observable.
Okay, I fixed a bunch of stuff; give it a try and let me know what you think. @shunter For some reason the GeocoderViewModel spec fails when run under coverage but passes normally. Any ideas? |
@shunter never mind, it's working now. |
I think this is just about ready but...
|
For some reason this still doesn't work as expected on mobile. I think our touch handling in the cameara may be eating the event.
It just occurred to me that none of our other widgets active on hover (SceneModePicker, BaseLayerPicker) should be be consistent? The main problem is that hover gives us issues on mobile (to the point where I would recommend we get rid of hover completely for Geocoder and require a click). Thoughts? |
Text-entry widgets are traditionally a little different than drop-down widgets. I think the current behavior is good. |
My only real issue with the current behavior is the mobile issue. I think we can work around this by removing the hover affect for touch-enabled devices, but it's not critical for this PR. |
Another random thought, we need to expose an even for detecting when the generate flight is complete, this way a user can perform some action (such as setting the camera transform so rotation is around the geolocated position). This can be in a future PR, I just wanted to mention it here. Once this is in master, I'll write up separate Github issues for any ideas in this PR that didn't make it in. |
* @type {Boolean} | ||
* @default false | ||
*/ | ||
knockout.defineProperty(this, 'isSearchInProgress', { |
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.
Sadly, jsDoc doesn't pick this up, it's not smart enough to parse knockout.defineProperty
.
Same comment for searchText
, flightDuration
, etc.
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.
Good catch, I'll fix it.
This branch looks good. 👍 @shunter can you review & merge? Thanks! |
It looks like somewhere along the line, the magnifying glass icon lost its click handler, so clicking it does nothing. I assume this was a mistake? |
I'm looking at it now. |
I'm not sure how it ever worked, should be fixed now. |
FWIW, it worked by submitting the form. Maybe the button should be a real |
Now none of us have to get @pjcozzi anything for Christmas 😄 |
There's a lot more I could do here, but I think it's reasonable to merge it into master in its current state.
I suspect the most controversial thing here is the location of the new widget in the
Viewer
. I originally had it in the top left, but @emackey made the excellent point that we should reserve that for app-specific functionality.This branch includes all the
bingKey
changes as well, so the diff will get simpler once that branch is merged.