Inserting an iframe or Dynamic content into an info window? - google-maps

I have a google map which is hooked up to a fusion table. Its pretty basic, lists street address, phone, and branch #.
I recently got a request though to add current weather to the info window that appears when a user clicks on a map marker.
Initially I thought I could just iframe this in, but it appears that google strips that HTML out of the info window when I add it in. I guess only basic html is allowed.
Does anyone know a way to throw dynamic content into that info window box or a way to get around google stripping out the iframe code?

The only iFrames I can get to work in fusion table map windows or cards are youtube embeds. Other iframes appear to get srtipped out as you say. It would be a good feature to be able to have universal iframe content instead of just google products.

Related

Google Chrome Extension Top Sites Images

So using the Google Chrome Top Sites api has values for the url and the title, but when you load the default google chrome page it also has an image of those sites, is there any way to get that sort of image for an extension? If not how does google get that image and how can you get an image of the the user's top viewed website?
Since that it isn't possible to get a screenshot of a page without loading it inside a tab, Chrome is simply getting those screenshots while you're browsing your favourite sites. You can tell this easily because sometimes sites and images do not coincide (e.g. sometimes my facebook.com top site has the image of my profile page, but links to the home).
Then, if you want your screenshots of the Top Sites, you'll have to start without screenshots, and create them while the user browses the web by using the chrome.tabs API to check when a tab loads one of the Top Sites (listening to the event onUpdated), and get a screenshot of that tab using captureVisibleTab.
NOTES: make sure that you've requested the permission for "<all_urls>" in your manifest, which is required for captureVisibleTab to work. Additionally, you may find this question and its answer helpful.
It's unfortunately not possible*. Chrome stores those thumbnails internally in URIs not accessible from an extension.
There is an existing feature request: https://code.google.com/p/chromium/issues/detail?id=11854
If you look at the comments, one of the main use cases is to access site thumbnails to replicate the New Tab page.
Do star the feature request above to raise its priority if you want this functionality implemented.
* By that I mean that it's not possilbe to access Chrome's own internal store of thumbnails.
Furthermore, as Marco suggested the way to replicate that would be tab capture, but you can't do it "in the background" for privacy reasons - a user must make an explicit gesture (e.g. click the extension's button, press a shortcut, etc.) to perform capture.
Marco's answer is valid now, captureVisibleTab should be accessible upon events. But yes, as of now Chrome forces you to have very broad permissions and maintaining your own thumbnail store.

Website jumping down on page load with embedded iframe google form

When someone navigates to a particular page with a google web form on it, the browser automatically jumps down to the google web form near the bottom of the page.
Website URL
Any ideas on how to keep it at the top of the page?
Thanks!
Jeff
Its due to the a field in the form getting focus, if you can stop that it wont jump down.
I've had a look at google forms and it doesn't look like there is a way to configure it not to set focus, you could try some custom javascript to stop it.
I can see from the URL shared that the original user's issue is now resolved, but fyi for others seeking a solution, if the Google Form is embedded via an iFrame, or you're using a custom HTML form to post answers to a Google form via the target of an iFrame, and this jumping occurs, changing the src='' of the iFrame to src='about:blank' worked a treat to eliminate any jumping of the page.

Google Maps API v3 - how to save map into cookie/localstorage

I'm building a page which loads a google map, with street view on another div on the side and I would like to save that data so if the user closes his browser window and then comes back that it will bring it up again without the need to call the Google Map API again.
I've tried saving the div contents and replace it with the current one incase the user visited already.
I tried with cookies but couldn't save much information due for size limit of 4kb and I've tried localStorage (HTML5) but it didn't work as expected.
Any ideas?
Thanks

How to acomplish the Google Phone stay on top effect html?

Google phone opens up a small widget on the right of Gmail and stays there. Even when navigating to other emails or composing at email (similar effect is achieved I believe by Facebook chat).
Are they using frames? I hope not.
I need to keep some images open while the user navigates other parts of the application so using the approach of google to place my image holders would be ideal.
I'm not familiar with google phone, but maybe an iframe is what you are after:
http://www.w3schools.com/tags/tag_iframe.asp
It's an inline reference to another document.

Scroll Google Maps in iframe

I've embedded Google Maps via an iframe in my website. I can't use the API at this point which is why I'm using the iframe.
Is there a way to scroll the iframe so that the upper part of the Google Maps page (search bar, etc.) are no longer visible to the user?
If the page was hosted in the same domain, you could use the scrollTop and scrollLeft dhtml properties on the iframe.document.body. However this is unlikely if you are hosting google maps from a remote server. You will be unable to modify the child frame contents via script.
Even if you could, this would always be a fragile solution. If the structure of the Google Maps changed at all, you would have to update your scrollTop/Left mechansim. Users will still be able to click in the frame and drag up to get the frame to scroll up, or even use the arrow keys.
Trying to fix the scroll position, then blocking the user from scrolling will likely be more trouble than it is worth.
ScrollTop Doc:
http://msdn.microsoft.com/en-us/library/ms534618(v=VS.85).aspx
You should probably try to eliminate whatever hurdles exist to using the API.