Google Maps without any labels/country names
I wanted to get a blank version of Google Maps without any of the country names on for a visualisation I’m working on but I’d been led to believe that this wasn’t actually possible.
In actual fact we do have control over whether the labels are shown via the 'styles' option which we can call on the map.
In my case the code looks like this:
var map = new google.maps.Map(document.getElementById("map_canvas"), {
zoom: 3,
center: new google.maps.LatLng(31.492121, 14.919434),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var emptyStyles = [
{
featureType: "all",
elementType: "labels",
stylers: [ { visibility: "off" } ]
}
];
map.setOptions({styles: emptyStyles});
And this is the result:
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.