Last active
December 24, 2015 01:39
-
-
Save erikhazzard/6725004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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