Posted by David at 12:15pm. Viewed 3 times.
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:
- 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...
- 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....
- 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...
Posted by David at 12:03pm. Viewed 3 times.
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:
- 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...
- 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...
- 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...
Posted by David at 9:13am. Viewed 0 times.
I took my camera away to my sister-in-law’s at the weekend. I got a good opportunity take plenty of “kids on trampoline” shots as well as my Niece Fran having horse-riding lessons.
At the moment I haven’t got far in the manual so I haven’t progressed much from the “intelligent auto” option. That’s okay for “normal” shots but can’t really keep up with the moving ones… I must get around to reading about manual adjustment for those kinds of photos.
Meantime, here’s one my favourites - my nephew Ed on the trampoline.
Posted by David at 1:38pm. Viewed 0 times.
Finally… it’s taken some time but I’ve completed adding tags to all the blogs, categorised them, sorted out the images and videos (from their transfer from Blogger).
And, yes, I have my camera. Not had much of a chance to try it out yet, but I’ll probably get a good chance to try it this weekend, so keep an eye out for a review soon….
Related posts:
- Site update! Ok, I may have said I was working on a mysterious new project but at the moment I’m tidying up a couple of sites -...
Posted by David at 1:09pm. Viewed 0 times.
I’m very excited.
After much research, I’ve bought myself a new camera. My current camera - a Konica Minolta - is a good few years old and was my first “proper” digital camera. It’s getting a little worn now and it’s a little sluggish.
So, first things first, what I needed. What photos do I take? Your standard family and holiday snaps plus rehearsal and show photos for BMTG. What features do I therefore need? A decent pixel count and zoom, good low-light capability, good video recording and few problems with red-eye. I also want a viewfinder (don’t get on with staring at LCD screens) and image stabiliser. Ideally I’d like it to use SD cards and AA batteries.
I don’t want much
And, after much research, I settled on the Panasonic Lumix DMC-FZ8. I found an online price of £180 (not at one of the top retailers, but on a site that still had a good reputation). On Friday I visited 3 retail park electrical stores - Currys, Comet and Empire Direct. All sold the same camera for £200. With just a 10% difference I was sure it shouldn’t have been hard to get it for that. Only that day was news of the bad Christmas retailers had and the general economic down-turn. Nobody would turn around £180, would they?
All 3 did. None of the stores were interested. The price on display was the only one they’d accept.
However, something else happened. At Comet they had the next one up in the Lumix range - the FZ18. I tried that out - it has a higher pixel count, zoom, it has face recognition and a bag of other extras. Back at home I found it online for £240 (£280 in Comet). And, ironically, it was at Dixons.
Order made and it should turn up this week. I’ve also ordered a case (from eBay - the “official” Panasonic case is £35 in comparison to this £8 version), memory card (4GB SDHC Class 6 from Crucial) and spare battery (from global-batteries).
A review, I’m sure, is to come…
Related posts:
- Happy Birthday Chez! The lady to the right is Cheryl. She was 40 yesterday. No, I’m not making that up, she really is. She’s a member of Beeston...
- VAT rate change. Should we expect anything different? Many people thought that retailers WOULDN’T drop their prices to accomodate the drop in VAT rate from Monday. Today, I received an email from a...
- Who’s a Happy Developer? I don’t know what my hosting company has done recently but my access to phpMyAdmin has been a lot, lot quicker. Which is good. I...