Minor fixes

Fixed bug in switchLegend
Removed references to Google Maps (no longer supported)
Removed some redundant code
Renamed some variables