Recent ramblings... on API

 
 
 

Change the default Google Map colours with custom styles

Last year I wrote an article about how to change the default Google Map colours using CSS filters, it was very basic and unsupported in some browsers but it was the best you could do at the time. Google have now introduced version 3 of the Google Maps API which finally gives you control of each element, it allows you to define the exact colours, hue, saturation and much more.

Although it is slightly harder to get up and running with over the embedded iframe I would advise anyone looking to customise their maps to use this method instead of CSS filters.

 
 

Get the subpages of a node in Drupal 7

Recently I have been doing a lot a Drupal 7 development for a new project, this project required quite a bit a custom programming to achieve the functionality that was needed.

I wanted a function that would pull out all of the menu items when a certain page or node template is called. A lot of seasoned Drupal developers first choice would be to use a module called Views to pull out the data but because I needed editable text (for the client to access easily) and images it was not going to be an option.

 
 

Get the current menu level for in Drupal 7

As part of a big Drupal 7 development I needed the ability to find out the level a node (page) is on a menu tree, Drupal doesn't associate a node in menu trees by default so it can't be queried from the page or node variables.

this function will identify the menu position based on the active trail flag in the given menu, just add the function to your template.php file and include the machine name of the menu that you want to query as the first parameter.

 
 

Flexible themes and layouts in CodeIginter

I still love CodeIgniter, the simplicity and robust core keeps me coming back even if it has fallen out of favour with the web community recently (I'm not going to get into that right now) but there has always been a few libraries that I felt were missing, a decent Auth library for one, but also a nicer way of dealing with views, layouts and themes. I can of course understand the reasons for leaving them out as both are not an every day need but I alway seem get to a road block in my projects where I suddenly have a need for them, especially the layout library.

 
 

Change the standard Google maps colour scheme with CSS filter

We all know and love google maps, its definately the easiest way to embed an interactive map into any webpage, the standard colour scheme has never been to my liking though and it looks more dated everyday, it also completely clashes with the colour scheme of a website on some occasions.

It suddenly dawned on me that I could use the new CSS3 filter style to change the colour scheme to greyscale, that way we have the same great google map only black and white. It is a little known fact that the filter style doesn’t just work on images, it will quite happily work on almost anything including the google maps embedded iframe!