1

Using WebGIS (AVD) map of WL via SDK

Тема: Using WebGIS (AVD) map of WL via SDK

Hi GT

We are developing new application for a customer and clients of this customer (I mean operators of WL) have limited access to internet so we can't use online maps for them. We are looking for a way to use WebGIS (AVD map) of WL as offline map for thwm. Would you please help us how we can use Wialon SDK to load AVD map in custom applications?

2

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

Any response from Gurtam Team?

3

Using WebGIS (AVD) map of WL via SDK

(22/05/2019 21:18:48 отредактировано hhamedk)

Re: Using WebGIS (AVD) map of WL via SDK

GT!!!!
There is no solution for my problem?

shmi, chdi, rual

4

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

hhamedk
Your question is not about Wialon, it's about offline maps. In theory you can download and cache all tiles for all zoom levels in your region and then show it on mobile. But development is on your side, we have no box solution for it.

5

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

shmi wrote:

Your question is not about Wialon, it's about offline maps. In theory you can download and cache all tiles for all zoom levels in your region and then show it on mobile. But development is on your side, we have no box solution for it.

Thank you for your response first of all. When I say "new application" I mean a system which contains web and mobile applications. We have solved offline maps problem for mobile application. We can also setup a map server for web application and use it. But, as our web application's server and WL are in same local network we believe we can use WL WebGIS. We just need the correct API request for loading tiles of AVD map stored on WL. As you know better now, our question is exactly about WL.

6

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

Here is standard method to get tiles via SDK - https://sdk.wialon.com/wiki/en/local/re … gis_render

Wialon Local Expert
7

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

sela, is there any way to request tiles via JavaScript API?

8

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

hhamedk пишет:

way to request tiles via JavaScript API?

No, there is no such method in JS API

Wialon Local Expert
9

Using WebGIS (AVD) map of WL via SDK

(23/06/2019 07:26:13 отредактировано hhamedk)

Re: Using WebGIS (AVD) map of WL via SDK

sela, I'm trying to load tiles using below code:

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/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="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>
    <script>
        
    var tilesUrl = 'ttps://{host}/gis_render/{x}_{y}_{z}/<uid>/tile.png',
        tilesLayer = new L.TileLayer(tilesUrl);

        map = new L.Map('map');
        map.addLayer(tilesLayer);
        map.setView(new L.LatLng(35.70,51.35), 12);

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

Replacing host and uid parameters with the correct values but I can't receive tiles. Would you please explain my mistake?

10

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

Hello, Hamed!

it seems like it's missed 'h' at  tilesUrl = 'ttps://{host}/gis_render/{x}_{y}_{z}/<uid>/tile.png'
Also please note you can use https for request only if you monitoring site (host) works throuhg HTTPS connection (has SSL certificates)

Diana Cheley
Wialon Hosting Expert
Gurtam
11

Using WebGIS (AVD) map of WL via SDK

(24/06/2019 18:26:34 отредактировано hhamedk)

Re: Using WebGIS (AVD) map of WL via SDK

chdi wrote:

it seems like it's missed 'h' at  tilesUrl = 'ttps://{host}/gis_render/{x}_{y}_{z}/<uid>/tile.png'
Also please note you can use https for request only if you monitoring site (host) works throuhg HTTPS connection (has SSL certificates)

You're right, I just made a mistake while I was posting the sample code. But even with correct code (correct URL) we can not receive tiles. We receive png files and API status code is 200 but all tiles are empty tiles. I guess there is difference between the way we request tiles by {x}_{y}_{z} parameters and the way Wialon accept these parameters. Please check and help us.

12

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

Hamed,
tiles coordinate are calculated by the same method as described here Google Custom Maps Types
As you use Leaflet library please look example here how we get tiles for Wialon Hosting. You can change this example for your WL.

Diana Cheley
Wialon Hosting Expert
Gurtam
13

Using WebGIS (AVD) map of WL via SDK

Re: Using WebGIS (AVD) map of WL via SDK

chdi, please check your messages.