Тема: 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.