Google Maps and Knol (Page 2)


<-- Back to Google Maps and Knol (Page 1)

On page 1 we started playing with the Knol implementation of Google Maps, so we could see what was the same and what was different in order to hopefully be able to do a few more fancy things later on.

So you don't need to use the Knol insertion code to make Google Maps work in Knol. Here is the code you can stick right into your HTML and Knol will wrap it up for you with gobbly-gook you don't need to know, when you save the page.

<br><img src=";chdp=sites" origsrc="maps?q=Santa Cruz,+CA&amp;oe=utf-8&amp;ie=UTF8&amp;gl=us&amp;hq=&amp;hnear=Santa Cruz,+CA&amp;z=11" type="map" props="align:right;borderTitle:Google Map;height:250;objectTitle:Google Map;showBorder:true;showBorderTitle:true;width:400;wrap:true;" style="margin: 5px 0pt 5px 20px; display: inline; float: right;" width="400" height="250"><br>

I added the <br>s around it, just so we can put our text in pretty places instead of worrying about where it's gonna pop up.  Also this is text-wrapped and 400 x 250.  I wonder how it would look if you changed those?  You can see clearly here the margins, so now you know how to force-change those to other values if you wish.  I'm not too sure what "z=11" does.  Play with it and tell me!  But at least we've gotten back to simple simple HTML you can use when Knol throws a wheel.  NO IFRAMES!  Note: This works on Knol, because Knol wraps the code when you save your Knol.  It won't work natively on open-coding websites, for that just use the iframe embed code you get right from Google Maps.

The only thing I don't like about my new easy mapping code, is that my location appears at the bottom edge.  I'd really like it to be centered like the first two maps.  How do I do that?  I had removed this weird looking part of the code: ll=48.063858,-122.020047&amp;spn=0.118851,0.287704

What is that?  Latitude and Longitude?  Or does this somehow shift the map up or down or something?  Let's try just sticking it back in and see what happens to Santa Cruz, CA. Poooooop.  It doesn't do anything.  Hmmm now what?

Going back to Google Maps and pulling up Santa Cruz, I get a map with it centered.  Reviewing the embed code there I see that the II and spn numbers are different.  Can I just pull those numbers into my code here?  For my first test, I'll remove the II numbers completely and stick in these new spn numbers.  Didn't work. Google Map

Now let's try instead, removing the spn numbers completely and sticking in the new II numbers. Google Map
I'm not getting anywhere here, let's do something else.

The ll values for this map are

Wikipedia claims that Olympia (seen here) has co-ordinates of 47°2′33″N 122°53′35″W so it's clear that, this is to what ll refers.
Google Map
I've figured out now that z is the level of close-up.  The higher the z the closer the map.  Both this map and the one previous have a z value of 10

In this map we increase both ll.x by .1 and ll.y by .1

You can see obviously how the map has been slightly shifted by this operation.  The center of the map is slightly further North and slightly further West.
Google Map

Little weirdness isn't there?  We see a shadow map at the bottom and in the sidebar where AdSense should go!  Tiny bug in Knol.  I guess they weren't expecting anyone to be so perserve as I to fiddle with the underlying mapping code to see what else it can do.

Since I wrote that last paraphaph, the issue has vanished!  Perhaps it only shows up when AdSense is not yet activated on a particular Knol article?  I don't know.  Anyway, on to more mapping!

--> Forward to Google Maps and Knol (Page 3)