20 Mar 2009

How to embed Google Maps in Google Sites

This may seem very obvious, but anyone who's been there knows that copying and pasting the HTML code does not work. The official gadget doesn't work either - you need an API key for that. In fact, I spent a good 1.5 hours wading knee deep in iframes and parameters before realising that the crux of the problem was superfluous ampersand codes. Ah the irony of it all. Being the kindly soul I am, I'm obliged to write up this tutorial in case anyone is tearing their hair out over this matter. Not that I've done so, mind you. (Close though.)

Right. Chop chop.

1. In the Google map you want to embed, click on "link" (in the top right corner), then copy the contents of the box labelled "Paste HTML to embed in website".

2. Paste the chunk of code into Notepad or some other text editor, and locate the URL that comes after "src=". Discard the rest. Then do a search (Ctrl+f) for "amp;", and remove every single instance of "amp;" in the code.

3. In the Google Sites page editor, click on "Insert" > "More" > "Add gadget by URL". Here's the URL:
http://hosting.gmodules.com/ig/gadgets/file/108621208120033273647/my_gadgets_gs.xml

(Updated 21.7.09. The old link from philippe.chappuis.googlepages.com doesn't work anymore)

4. Once you click "Add" the setup panel should come up. Grab the modified code from step 2 and paste it into the "File" field. Adjust settings as needed, click "OK", and voilĂ  - there you have it!

All we're doing here is employing a gadget that does the work of an iframe. (The gadget in question comes from [this page].) But for some stupid reason the iframe codes given out by Google Maps have ampersand codes in place of "&" which renders them quite useless. Ampersand codes are used in HTML to make sure symbols display properly - beats me why they would turn up here.

More on ampersand codes:
HTML Ampersand Character Codes

Slightly tangential - a useful list of parameters I came across earlier:
Google Map Parameters

1 Mar 2009

More than just dreams

I'm currently in the process of sorting out my stew of problems, which means a lot of aimless probing, trying to make sense of it all. It just so happens that I've stumbled across a likely culprit for a good number of issues.

Did I mention I suffer from procrastination, sleep problems and occasional depression (residue of two especially intensive outbreaks)? Well there's another thing that figures in this whole mess - dreams.

Dreams, not nightmares. Dreams so substantial and vivid that it's as if you're living an alternative life. Dreams in which you encounter new experiences, solve complicated problems, and gain memories related to earlier dreams. Dreams that operate on a plane of their own, with their own logic and physics and geography. If I saw a pink umbrella with polka dots on sale, I could make a mental note of it, then relocate it in another dream, some other time - it might still be there, or they might have changed their stock to green striped ones.

Never have I met anyone else in the same situation - but that's probably because people don't usually talk about this kind of stuff. The parallel worlds in The Lives of Christopher Chant (by Diana Wynne Jones) come close, though I obviously don't find sand in my bed after a trek through dream dunes!

The thing is, very few everyday experiences make it into my dreams. This does not necessarily make them unpleasant, only highly different, so much that it makes the transition from one state of mind to another very difficult. I guess this partially explains my reluctance to fall asleep or wake up.

Well I should be off now, to monitor velociraptor behaviour perhaps. Or plan the counterattack at dawn. Or observe the next hourglass storm. You never know ;)