Simple Guide to put a Google Location Map on Your Website

Sunday, February 10, 2008

Why draw or pay for a location map for your client when you can quite simply and easily give them a google location map that looks stunning and works great.

The google maps API has absolutely loads of options e.g. multiple markers, journeys etc but all I'm demonstrating is a simple map, with an address marker.

You have to put the following into the start tag of your <body> marker..

onload="load()"

 ..so it might look a bit like this..

<body onload="load()">

..all this does is load the google map.

You then need to paste the below code into your main page content area (or where you want the map to appear). Note will you have to change a couple of variables before your map will appear - listed below.

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=YOURKEYHERE" type="text/javascript">
</script>

<script type="text/javascript">
 
var WINDOW_HTML = '<div style="width: 200px; padding-right: 10px"><strong>My Clients Company Name</strong><br>Address1<br>Address 2<br>Postcode etc.</div>'; 
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
      map.addControl(new GSmallMapControl());

      map.setCenter(new GLatLng(51.36445,0.3698), 13);
      var marker = new GMarker(new GLatLng(51.36445,0.3698));
      map.addOverlay(marker);
      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(WINDOW_HTML);
      });
      marker.openInfoWindowHtml(WINDOW_HTML);
      }
    }
    //]]>
</script>

<div id="map" style="border: 1px solid #979797; background-color: #e5e3df; width: 540px; height: 360px; margin: auto; margin-top: 2em; margin-bottom: 2em">
<div style="padding: 1em; color: gray">Loading...</div>
</div>

1) get your API Key by visiting http://code.google.com/apis/maps/signup.html all you have to do is tick a box and enter the URL of your website to get your key. You will need to paste your key OVER the YOURKEYHERE part of the above code.

2) Change the WINDOW_HTML value to the address (and maybe phone number) of your location (or anything you wish for that matter) - you can use html. 

3) You see that there are two numerical values following the GLatLng(lat, and long) -in the code above. You need to do is replace these with the co-ordinates of the place you wish to center on the map. How do I get these? I hear you ask. The way I get these is go to www.multimap.com, type in the postcode and then scroll to the bottom of the page for the "lat" and "long" numbers.

4) You can set the height, width and border of your map by editing the last <div> of the above code. 

A few tips on achieving a higher ranking in the mighty Google (maybe)

Sunday, January 13, 2008

It seems no-one can guarantee high google rankings (excluding adwords etc) but here are a few tips I picked up that can possibly help.

  1. Each page will need to have an individual title tag. – This is the single most important aspect and the quickest way to get penalized in Google.
     
  2. Each page will need to have an individual description tag. – This is very important and is another way of getting penalized in Google and MSN
     
  3. Each page will need to have an individual keywords tag. – Not hugely important now but has been in the past and may well become important soon.
     
  4. Each page needs a document structure that comprises of a series of H1, H2, and H3 tags. – This emphasises the key terms in a way that Google expects.
     
  5. Each page needs to have individual alt tag information. – Important as it is a good way to get diversity of keywords.
     
  6. Google site map, this will need code adding to pages.
     
  7. I've found it may also help if the key words that you want your site to be found by are also in the url of the page, I've looked into this somewhat and have found that the folder structure or file name can be used e.g. www.wesdesign.co.uk/how-to-create-a-database/ would probably fair well when someone is searching for "how to create a database".
     
  8. A resources page to enable linking strategy to be implemented. – Link popularity is a key part of Goggles ranking mechanism, this page will need regular editing as proposals are received for linking.
     
  9. In addition it is advisable to create a mechanism for natural inbound linking to take place, we would look to add this mechanism to an internal dedicated page and reference it from the homepage if possible. This would provide the code and the text for other webmasters who may link to you.

To summarise, it seems that as long as you focus on promoting your site with some kind of linking strategy and you have well-structured content you're well on your way! On the same note, Google is forever changing the way their search engine works to enable the most accurate information to become closer to the top as developers catch on.

Feed Shark