function plotColourMap( Lat, Lon, Err, Str, Max)

%
% Plots data with the backdrop of a Google Satellite image. The data is
% coloured based on a "Err" field passed into the function. Lat, Lon,
% Err, Str are all required parameters, Max is optional
%
% Lat - latitude in degrees
% Lon - longitude in degrees
% Err - Error - used to set the colour of the data
% Str - String for the title of the plot
% Max - Optional, forces the "Err" data to have no values above "Max",
%       this prevents data with just a couple of outliers to be better
%       visulaized
%
Err = abs(Err);
if(nargin == 5)
  i = find(Err > Max);
  Err(i) = Max;
end

current = colormap();
colormap('jet');

scatter(Lon,Lat,[],Err,'filled');

plot_google_map('maptype','satellite');
C = colorbar;
%C.Label.String = Str;

xlabel('Longitude [deg]');
ylabel('Latitude [deg]');
title(Str)

colormap(current);

