I am currently in the initial stages of developing a maps web application and I want to incorporate maps from tilehosting.com along with the leaflet library (leafletjs.com).
Overall, it seems to be working fine, but I'm struggling with hiding the default country and city labels. Despite extensive searching on Google, I haven't been able to find a solution that works for me. It appears to be a simple task, yet I seem to be missing something.
Does anyone know how to accomplish this? Could someone provide a sample code snippet?
You can view an example of the code here:
<html>
<head>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e323b3f38323b2a1e6f706d706f">[email protected]</a>/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ef2fbfff8f2fbeadeafb0adb0af">[email protected]</a>/dist/leaflet.js" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" crossorigin=""></script>
<script src="https://cdn.klokantech.com/mapbox-gl-js/v0.43.0/mapbox-gl.js"></script>
<script src="https://www.dxmaps.com/js/leaflet-mapbox-gl.js"></script>
<link rel="stylesheet" href="https://cdn.klokantech.com/mapbox-gl-js/v0.43.0/mapbox-gl.css" />
<style>
#map {position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
</style>
</head>
<body>
<div id="map"></div>
<p><a href="http://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a> <a href="http://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap contributors</a></p>
<script>
var map = L.map('map').setView([47.3739, 8.5456], 2);
var gl = L.mapboxGL({
attribution: '<a href="http://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a> © <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
accessToken: 'not-needed',
style: 'https://free.tilehosting.com/styles/basic/style.json?key=XXXXXXSAMPLEXXXXXXXX'
}).addTo(map);
</script>
</body>
</html>