programmatically close street view - google-maps-api-3

I have a map inside an accordion component. I'd like to return the user to the map's default state each time the map is accessed. This is fine unless the user has gone into street view.
In this case I'd like to close it. Is there a programmatic way to do this?
I've looked around the documentation but have come up empty handed.

set the visible-property of the streetViewPanorama to false by calling:
map.getStreetView().setVisible(false)

Related

JavaFX - Keeping Focus on a "Default" Component

I'm looking for the most concise way to deal with focus in an application which renders a map in a canvas component. You can pan the map location using arrow keys or ASWD keys. So far, I've been giving the canvas focus at startup and handling key pressed events via canvas.setOnKeyPressed().
This works fine, but I've always known that a problem was on the horizon when other components enter the picture. Once you interact with another component, it gains focus, and you're unable to scroll around the canvas map. I can prevent this from happening with some components like Hyperlinks or Buttons (I don't need tab-navigation) with something like this for those components:
sidePanel.getChildren().forEach(node -> node.setFocusTraversable(false));
But, when we get to things like TextArea or TextField, those do need to hold focus while they're being edited. And I'll need some way to return focus back (or at least unfocus those components) without being an annoyance to the user. (I don't want to have to click the canvas for it to regain focus.)
The options I see for returning focus back to the canvas after the user is done with those fields seem to be:
Add a key handler (ex. ESC or ENTER keypress) on EACH of these components which returns focus back to the canvas.
Maybe not so concise, and a bit of a pain... also feels a bit fragile; if I miss something and the canvas loses focus, it would fail - I need a 100% reliable solution.
Extend each of these components and add similar code to return focus back to Canvas
Even nastier and requires using custom components in Scene Builder, which
is not ideal.
Add a global event handler on the Scene and transmit events to the controller which owns the canvas
I believe an event filter would accomplish this - but on the other hand if the user is simply using arrow keys to move around a TextArea, I wouldn't want the Canvas map to move!
To solve the above problem, possibly the global event handler could ignore ASWD and arrow keypresses if the focus is on certain types of components? Is this worth trying, or am I neglecting a problem this would create?
Are there any other simple options out there that I've missed - and what would you suggest as the best option here? I'd like an automatic solution that doesn't require remembering to add some workaround code every time a UI component is added.

Google Tag Manager - Help setting up tags to track play button clicks and timestamps

Was wondering if someone could help me out or provide some guidance with some things I'm looking to do with Google Tag Manager.
I'm fairly new to GTM but I've already got two basic tags set up:
Track All Page Views
Track all Link Clicks
I've got the above two working and sending data to my Google Analytics account.
What I'm having trouble with is the following:
My website has a bunch of single pages that each have an audio player on them. I would like to track when a user does the following:
Clicks the Play Button
Clicks the Download Button
On top of that, I would like to:
Track the timestamp of the song when a user clicks the Pause Button or exits the page.
Here's an example of one of the pages I would like to implement these tags on: https://www.jimmypressplay.com/mashup-last-friday-night-i-wanna
For #1 and #2, I've tried a bunch of things with no success. I've messed around with the "Click - All Elements" and "Custom Event" Trigger Types and I've set the trigger to fire when the click element matches the div/button class of the play button. I've also messed around with setting up a custom variable (by using either the "Auto-Event Variable" or "DOM element" options). But none of that seems to work (but obviously I am probably doing something wrong).
For #3, I haven't tried tackling that yet, but I've noticed in the code in the "slider slider_is-active" div class it has an element ("aria-valuenow") that keeps track of the current timestamp, so I'm guessing there should be some way to return that timestamp if I am able to set it up as a custom variable somehow.
If anyone has some free time and could take a look and point me in the right direction, that would be great! Or if I need to provide more info, let me know.
Thanks!

Fully programmatic hiding / showing of SignPosts

I'm trying to display some extra contextual help as a result of a button click elsewhere (in this case it cant be the trigger)
I'd like to be able to have users dismiss via clicking the close x, or clicking the trigger, but continue to show if users click in places other than the ACTUAL trigger.
I've tried setting *clrIfOpen="false" or to about just about any other way I can think of blocking it, but it seems like some place the click listener is just telling isopen service that its open... meaning the clrIfOpen is really only good for an initial state.
Any hacks around this?

How to programmatically zoom in highcharts?

When calling axis.setExtremes() or axis.zoom(), the associated zoom button does not become highlighted.
For example, if I programatically 'zoom' to 1-hour, I would like the '1 hour' zoom button to appear as 'pressed'.
Is there a simple way to accomplish this?
For more context: I want to make my app stately, so that if you view a graph, zoom, then navigate away from the graph and back to it again, I want to restore your 'zoom level'.
I have this basically working by listening for afterSetExtremes and storing the max/min values, and then using those to call 'zoom' on the graph when the user returns.
If there is a simpler way to accomplish this, I'd be fine with that.
Thanks for any direction!
You can also call setState on the button.
http://jsfiddle.net/W56P5/2/
chart.rangeSelector.buttons[3].setState(2);

Expression Blend, Button states, how to?

Sorry for such a rudimentary question, but I am not experienced in Blend 4 much at all.
What I need to do, and based on the little I know or have seen it seems that Blend is the place to do it, is to create a "state" for a button to appear when it is disabled. i.e., the button I'm working with is a Sign Out button...the button IsEnabled property is bound to the WebContext.User.IsAuthenticated property. So, when the app is loading I want the button's "disabled state (<-- created in Blend?) to appear...once authentication is completed, the binding to IsEnabled will change, and I want the button's "enabled state" to kick in. How to accomplish this? Thanks in advance.
Your problem looks extremely similar to an issue I was having the other day.
If you go to this thread you may be able to use that as a solution: Expression Blend Interaction: How to set Trigger to Look for IsEnabled Value of Button?
I have a Boolean value there called "IsSavedAllowedBool". You would want to replace that with whatever bool you are binding to - which looks as if it might be WebContext.User.IsAuthenticated.

Resources