1

Using AVD map in another application

Тема: Using AVD map in another application

Dear GT

I'm developing an application and I want to use AVD map tiles as map in it.
I'm using below code:

<!DOCTYPE html>
<html>
<head>
    <title>Test Offline Map</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" />
    
<style type="text/css">
    html,body {
        overflow-x: hidden; overflow-y: hidden;
        margin:0px; padding:0px;     
        font-family: Arial, Helvetica, sans-serif; font-weight: bold;
        color: #666; font-size: 13px;
        height: 100%;
    }

    body {        
        background-color: #fff;
        margin: 0; padding: 0;    
    }

    img { border: 0; margin: 0; padding: 0; }
    table, tr, td { border: 0; margin: 0; padding: 0; }

    a { color: #333; text-decoration: none; }
    a:hover { color: #000; text-decoration: none; }
</style>    
    
</head>
<body>
    <div id="map" style="width:100%;height:100%;overflow:hidden;background:#000;"></div>

    <script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"></script>
    <script>
        
    var map = L.map('map').setView([35.70,51.35], 12);
        
            L.tileLayer('http://{host}/gis_render/{x}_{y}_{z}/{userId}/tile.png', {
                maxZoom: 17, 
                zoomReverse: true,
                
                userId: 55, //id of user 'wialon'
                host: 'WIALON_URL' //here I insert the Wialon monitoring URL and I just removed it not to share it over the Internet
            }).addTo(map);

    </script>
</body>
</html>

But I receive errors like screenshot.
Please let me know what is the problem.

  • Using AVD map in another application
  • Using AVD map in another application
2

Using AVD map in another application

Re: Using AVD map in another application

hhamedk, hello,
Look like that the host value is incorrect. It is not possible to use just monitoring site URL.
Please, use following URL address for host:
render-maps.wialon.com/hst-api.wialon.com

The example you can find here -- https://sdk.wialon.com/playground/demo/gurtam_map

If you face any issues you can also create a ticket to support@gurtam.com and our specialists will handle your request.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
3

Using AVD map in another application

Re: Using AVD map in another application

zant the server is WL (not WH) so the server URL is fine based on the SDK docs.

4

Using AVD map in another application

Re: Using AVD map in another application

hhamedk hello, Thank you for the information. We've received your email and will reply shortly. Please, wait.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon