Archive for category Uncategorized

Getting started with Google Geo (Maps, Mapplets & Earth) APIs

There is a great quantity of quality resources to help get you started on making your first geo mashups. This page links to all those great resources from one easy location.


Google Maps API


YouTube videos

View a full list of Maps API videos here


Google Maps API Intermediate (44:11) Google Maps API Advanced (50:17)




Google Street View API

The Street View API allows you to leverage Google’s unique Streetview imagery and controls within your mashups. Streetview is currently available for selected locations in the US, Australia, and Japan.


Google Mapplets API

Mapplets are a combination of the Maps API and Gadgets API, and provide a great platform for making your maps mashups discoverable and permanent via the mapplets directory.


Google Earth API


Google Earth


, , , , , , , ,

No Comments

User-friendly 404 pages

If a user types in or follows a URL that does not exist on a website they are usually taken to a 404 (page not found) page.  Returning a standard 404 page to your user tends to provide a less-than-optimal user experience and may cause you to lose them altogether. 

A solution is now at hand.  Create a custom 404 page and embed a Webmaster Tools 404 widget into it.  The 404 widget helps your visitors find what they’re looking for by providing suggestions based on the incorrect URL.  It also provides a link to the parent subdirectory, a sitemap webpage, and a site search query suggestions and search box.

No Comments

Using the Google Static Maps API to include maps in your emails

The Google Maps API is a great way to utilise Google’s Maps platform on your own website. The standard Maps API, however, does not work in e-mails as it is reliant on JavaScript which most (if not all) e-mail clients block.



Luckily there is a solution thanks to the Google Static Maps API. The Static Maps API generates an image file that can be embedded into your HTML content (like below). Because it is an image, and there is no JavaScript involved, mail clients will display such a map. You can specify the location of the map, the size of the image, the zoom level, the type of map, and the placement of optional markers at locations on the map using the API. For example:



Singapore MRT stations



Sydney - Pitt St Mall to Hyde Park



Getting started is easy!

  1. Sign up for a Google Maps API key
  2. Use the Google Static Map Wizard to create your first static map
  3. Read the Google Maps Static API documentation



This method is great for also providing map content in other mediums that don’t support JavaScript – such as mobile content.

No Comments

Python: Inserting characters into a string

Disclaimer: I’m a Python newbie … if you know of a more efficient way let me know!

I needed to take a sequence of 4 digits (eg 1145) and modify it to look like clock-time (eg “11:45″). After a bit of online (what else?) research I decided to take the approach of converting the integer to a string and then to a list (of characters). I then insert the extra character (ie the “:”) into the list at the right position. Finally, join the list elements together to form a new string.


time_int = 1145
time_str = str(time_int)
time_list = list(time_str)
time_list.insert(2, ':') #insert the ':' character into the list before position 2
time_str = "".join(time_list)

, ,

No Comments

Python: removing repeated values in a list

CODE:
  1. list = ['one', 'two', 'three', 'one', 'one', 'four', 'two']
  2. #convert the list into a set.  An element can only exist once within a set
  3. set = set(list)
  4. #convert the set back into a list type
  5. list = list(set)
  6. print list

Are those variable names confusing? Let's look at that example again:

CODE:
  1. fruits = ['apple', 'bananas', 'cantaloupes', 'apple', 'apple', 'durian', 'bananas']
  2. #convert the list into a set.  An element can only exist once within a set
  3. fruits_unique = set(fruits)
  4. #convert the set back into a list type
  5. fruits = list(fruits_unique)
  6. print fruits

, ,

No Comments