forked from ptv-logistics/Leaflet.NonTiledLayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet-x.js
41 lines (35 loc) · 1006 Bytes
/
leaflet-x.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// PTV XServer support for leaflet
var X, originalX;
if (typeof exports !== undefined + '') {
X = exports;
} else {
originalX = window.X;
X = {};
X.noConflict = function () {
window.X = originalX;
return this;
};
window.X = X;
}
X.version = '0.7.1';
X.backgroundLayer = function (xMapWmsUrl, mapprovider) {
return new L.TileLayer.WMS(xMapWmsUrl + "/WMS", {
maxZoom: 19,
minZoom: 0,
opacity: 1.0,
noWrap: true,
layers: 'xmap-ajaxbg',
format: 'image/gif',
transparent: false,
attribution: '<a href="http://www.ptvgroup.com">PTV</a>, ' + mapprovider
});
};
X.labelLayer = function (xMapWmsUrl, mapprovider, token) {
return new L.NonTiledLayer.WMS(xMapWmsUrl + "/WMS?xtok=" + token, {
opacity: 1.0,
layers: 'xmap-ajaxfg',
format: 'image/gif',
transparent: true,
attribution: '<a href="http://www.ptvgroup.com">PTV</a>, ' + mapprovider
});
};