Skip to content

Instantly share code, notes, and snippets.

@cyberhobo
Created June 6, 2014 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberhobo/5ab7eb866650ad92088c to your computer and use it in GitHub Desktop.
Save cyberhobo/5ab7eb866650ad92088c to your computer and use it in GitHub Desktop.
WordPress Geo Mashup custom javascript for Google Maps API V3 map styles example
/**
* An example of applying custom styles to a Geo Mashup Google V3 map.
*
* There's a wizard for making your own style arrays at https://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html
**/
GeoMashup.addAction( 'loadedMap', function( properties, map ) {
var google_map = map.getMap();
var custom_styles = [
{
featureType: "landscape.natural",
stylers: [
{ visibility: "on" },
{ hue: "#ffbb00" },
{ lightness: 26 }
]
},{
featureType: "water",
stylers: [
{ visibility: "on" },
{ hue: "#00bbff" }
]
},{
featureType: "landscape",
stylers: [
{ visibility: "on" }
]
},{
featureType: "landscape.man_made",
stylers: [
{ visibility: "off" }
]
},{
featureType: "road",
stylers: [
{ visibility: "off" }
]
},{
featureType: "administrative",
stylers: [
{ visibility: "off" }
]
},{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
},{
"featureType": "transit",
"stylers": [
{ "visibility": "off" }
]
},{
featureType: "administrative.locality",
stylers: [
{ visibility: "on" },
{ hue: "#0019ff" },
{ lightness: -1 },
{ saturation: -46 }
]
}
];
var map_type = new google.maps.StyledMapType( custom_styles, { name: 'custom' } );
google_map.mapTypes.set( 'custom', map_type );
google_map.setMapTypeId( 'custom' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment