Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

WordPress Geo Mashup custom javascript for Google Maps API V3 map styles example

View custom-googlev3.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
/**
* 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
Something went wrong with that request. Please try again.