• It will probably go out of the plugin options but would there be any chance of being able to configure a button in some way to be able to switch between map providers? My idea would be to configure a button that can alternate a street map with the aerial view of images, just like Google maps has.

Viewing 1 replies (of 1 total)
  • Plugin Author Camille V

    (@socrapop)

    Dear nikosillo,

    Indeed, it is not possible with the plugin options.
    If you have some developers knowledge, it could be done but it is too much work for me to do it. But I can explain:

    You could retrieve the tileLayer set on the map that way in javascript.
    Let’s assume you only have one map on your page, you could do that:

    var tileLayers = null;
    cttm_map[0].eachLayer(function(layer) {
        if( layer instanceof L.TileLayer )
            tileLayers = layer;
    });

    Then, on click of a button, you could hide this layer (remove it from the map) and add another tileLayer to the map with your other Tile provider.
    Here is the documentation for tileLayers: https://leafletjs.com/SlavaUkraini/reference.html#tilelayer
    Here is Travelers’ map developer documentation, explaining how to interact with the map: https://camilles-travels.com/get-started-with-travelers-map-wordpress-plugin/#Interact-with-the-maps-objects
    Another useful link, someone wanted the same as you here (not on Travelers Map but with Leaflet) and got a nice answer: https://stackoverflow.com/a/24675773

    I hope this help if you have some developers knowledge, else you will have to hire someone for this ??

Viewing 1 replies (of 1 total)
  • The topic ‘Switch to another map view’ is closed to new replies.