TwitterTwitter: Broken my Kubuntu build - having to rebuild it from scratch again 1 day ago

2 entries from the day of:

January 31, 2008


31st
Jan 08

Google Maps


I regularly make use of the Google Maps API to add interactive maps to my websites, where a location is required to be pin-pointed. It’s used on both BMTG and Engments to good effect.

It’s my own variation of the code and actively displays a pin in the required location, along with a balloon containing the locations name and address. Here is an example of the code…

<div id="map" style="width: 700px; height: 400px; border-width: 1px; border-style: solid; border-color: #808080;"></div>
<script type="text/javascript" defer="defer">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.centerAndZoom(new GPoint(-1.218501, 52.927571), 2);
var pinEngments = new GMarker(new GPoint(-1.218501, 52.927571));
map.addOverlay(pinEngments);
var msgEngments = "<div style='width:200px;'>Round Hill Primary School.<br>Foster Avenue,<br>Beeston,<br>Nottingham.<br>NG9 1AE.</div>";
pinEngments.openInfoWindowHtml(msgEngments);
//]]>
</script>

The example code shows the location of Roundhill School from the BMTG website, although you can see some of the code is left-over from using it on the Engments site.

  • The DIV sets up a coloured border and defines the height and width of the map.
  • The “map.centerAndZoom” line supplies the co-ordinates (which you can get from Google Maps or Google Earth) of the centre of the map. The “2″ at the end is the zoom level.
  • The “var pinEngments” line is the co-ordinates of the pin (as you can see the pin is set as the location of the map).
  • The “var msgEngments” line is then some code which displays the location and address within a DIV statement.
  • The “map.addControl” lines adds the control panel which allows for the zooming, etc. This can be omitted for removal, or changed to other, smaller, controls.

And that’s it. Don’t forget to put your Google API at the beginning of the page or this won’t work.

Related posts:

  1. Google Maps revisited I blogged recently with a simple script for adding a Google map onto your site. I’ve since written an enhanced PHP script, so thought I’d...
  2. Google Maps Error - Solved! For some time I’ve been struggling with a problem with my Google Maps API - an error that will sometimes appear in Internet Explorer....
  3. Google logic I use Googles Adsense for some of my websites to generate a little revenue. For reasons that are now lost on me, I signed up...

31st
Jan 08

The New Highway Code


I’d like to take this opportunity to make a plea. To drivers. First of all an extract from the Highway Code.

Driving on the motorway - Rule 259

When you join the motorway you will normally approach it from a road on the left (a slip road) or from an adjoining motorway. You should

  • give priority to traffic already on the motorway
  • check the traffic on the motorway and match your speed to fit safely into the traffic flow in the left-hand lane

Now, I assume the same applies to slip roads onto other roads, such as A roads.

What the Highway Code DOESN’T say is

  • Drive up the slip road, with your indicator on, until you get to the end.
  • Join the main carriageway, whether clear or not. You have priority so other drivers must move out of your way

End of todays lesson.

Related posts:

  1. How Long? Recently a roundabout near me was undergoing roadworks. For 15 weeks. Over a quarter of a year. Surely you could dig the whole thing up...
  2. Eh? What? So, there I was last night, at 9:30pm, pitch black, driving along a back-country road. No houses. No street lights. A car had just passed...
  3. Clampdown on excessive speeders The government are to introduce new laws which would see “anti-social” speeders being given even more points on their licence. Now, I wouldn’t have an...