1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8" />
5
    <title>Wialon Playground - Gurtam map</title>
6
    <script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script>
7
    <script type="text/javascript" src="https://hst-api.wialon.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body>
10
11
<!-- load map -->
12
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.2/leaflet.css" />
13
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.2/leaflet.js"></script>
14
15
<div id="map"></div>
16
17
</body>
18
</html>
HTML
4
 
1
#map{
2
    width:500px;
3
    height:400px;
4
}
CSS
62
 
1
function initMap() {
2
    L.TileLayer.WebGis = L.TileLayer.extend({
3
4
        initialize: function (url, options) {
5
            options = L.setOptions(this, options);
6
            if (options.detectRetina && L.Browser.retina && options.maxZoom > 0) {
7
                options.tileSize = Math.floor(options.tileSize / 2);
8
                options.zoomOffset++;
9
                if (options.minZoom > 0) {
10
                    options.minZoom--;
11
                }
12
                this.options.maxZoom--;
13
            }
14
            if (options.bounds) {
15
                options.bounds = L.latLngBounds(options.bounds);
16
            }
17
            this._url = url + "/gis_render/{x}_{y}_{z}/" + options.userId + "/tile.png";
JS
Result
Source code of example Close ✕
1
 
1
/*source*/