1

Using Leaflet, it is possible to consume google maps tiles with the code below:

    var googleStreets = L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&',{
        maxZoom: 20,
        subdomains:['mt0','mt1','mt2','mt3']
    });

Is it possible to consume the same service but without labels? Does google provide a tiling service for this purpose?

I can easily do that with cartodb basemaps because they provide different services for this reason:

    var basemapCartoNoLabels = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', {
        attribution: '©OpenStreetMap, ©CartoDB'
    }).addTo(map);

    var basemapCartoOnlyLabels = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', {
        attribution: '©OpenStreetMap, ©CartoDB',
        pane: 'labels'
    }).addTo(map);

My goal is to show the following layers: - google streets - my geometry json layer - labels on top of everything

1 Answer 1

2

Due to google's terms&conditions, it's not possible to access the tiles without using their API. For this reason, things like https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant exist.

It should be possible to request tiles without labels by using the "custom styling" functionality, but I'm not sure that will allow requesting labels-only tiles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.