Skip to content

Instantly share code, notes, and snippets.

@erikhazzard
Last active December 24, 2015 01:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erikhazzard/6725004 to your computer and use it in GitHub Desktop.
Save erikhazzard/6725004 to your computer and use it in GitHub Desktop.
// STYLED google map
var gMapStyles = [ { featureType: "all", elementType: "all", stylers: [ { visibility: "simplified" }, { hue: "#4d00ff" }, { saturation: -64 } ] } ];
var styledBase = new OpenLayers.Layer.Google(
"Google Physical",
// NOTE: this 'styled' ID should match the one defined below
{type: 'styled'}
);
var styledMapOptions = {
name: "Styled Map"
};
// created a google maps styled map type object
var styledMapType = new google.maps.StyledMapType(gMapStyles, styledMapOptions);
//Setup the map object
map = SHELL.Map.setupMap({
//// we can pass in a string which will look up a layer defined in
//// static/coffee/config.coffee. possible values are:
//// 'osm', 'google'
//baseLayer: 'google',
//// we can also pass in a layer object
baseLayer: styledBase,
startingLocation: 'Western US'
});
// Setup the 'styled' map type here. Note the 'styled' ID matches the type
// used in the Google layer above
styledBase.mapObject.mapTypes.set('styled', styledMapType);
styledBase.mapObject.setMapTypeId('styled');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment