- Home >
- Documentation >
- Map Types >
- styledmaptype
styledmaptype
This function allows to add a google.maps.StyledMapType.
Usage
Parameters
- id {string} the id of the style to in the map.mapTypes.set method
- styles {array of google.maps.MapTypeStyle}
- options {google.maps.StyledMapTypeOptions}
Example
This example add 2 styles on the map.
$("#test").gmap3( { map:{ options:{ center:[41.850033, -87.650052], zoom:12, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, "style1", "style2"] } } }, styledmaptype:{ id: "style1", options:{ name: "Style 1" }, styles: [ { featureType: "road.highway", elementType: "geometry", stylers: [ { hue: "#ff0022" }, { saturation: 60 }, { lightness: -20 } ] } ] } }, { styledmaptype:{ id: "style2", options:{ name: "Style 2" }, styles: [ { featureType: "road.highway", elementType: "geometry", stylers: [ { hue: "#ff0022" }, { saturation: 60 }, { lightness: -20 } ] },{ featureType: "road.arterial", elementType: "all", stylers: [ { hue: "#2200ff" }, { lightness: -40 }, { visibility: "simplified" }, { saturation: 30 } ] },{ featureType: "road.local", elementType: "all", stylers: [ { hue: "#f6ff00" }, { saturation: 50 }, { gamma: 0.7 }, { visibility: "simplified" } ] } ] } } );