Last active
September 20, 2022 15:26
-
-
Save blech/6091492 to your computer and use it in GitHub Desktop.
Kim Asendorf Maps: the code
This file contains hidden or 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
// cheekily stolen from http://maps.kimasendorf.com/ | |
var featureType = ["all", "water", "landscape", "landscape.man_made", "landscape.natural", "landscape.natural.landcover", "landscape.natural.terrain", "administrative", "administrative.country", "administrative.province", "administrative.locality", "administrative.neighborhood", "administrative.land_parcel", "poi", /*"poi.attraction", "poi.business", "poi.government", "poi.medical", "poi.park", "poi.place_of_worship", "poi.school", "poi.sports_complex",*/ "road", "road.highway", "road.highway.controlled_access", "road.arterial", "road.local", "transit", "transit.line", "transit.station"/*, "transit.station.airport", "transit.station.bus", "transit.station.rail"*/]; | |
var elementType = ["all", "geometry", "geometry.fill", "geometry.stroke", /*"labels", "labels.icon", "labels.text", "labels.text.fill", "labels.text.stroke"*/]; | |
var visibility = ["on", "simplified", "off"]; | |
var asdfMapStyle = []; | |
// NEW GOOGLE MAPS STYLE | |
google.maps.visualRefresh = true; | |
for (var i=0; i<featureType.length; i++) { | |
for (var j=0; j<1/*elementType.length*/; j++) { | |
var vis = visibility[Math.floor(Math.random() * visibility.length)]; | |
var randElem = 1 + Math.floor(Math.random() * (elementType.length-1)); | |
if(i==0 && j==0) { | |
vis = "off"; | |
randElem = 0; | |
} | |
var stylers = (vis != "off") ? [ | |
{ "color": randomHexColor() }, | |
{ "visibility": vis } | |
] : [ | |
{ "visibility": vis } | |
]; | |
var type = { | |
"featureType": featureType[i], | |
"elementType": elementType[randElem], | |
"stylers": stylers | |
}; | |
asdfMapStyle.push(type); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment