Тема: Issue with the Gurtam Maps application
We wanted to use the Gurtam Maps app code, which is in GIT, but at the moment of executing, it sends us this error code:
hst-api.wialon.com/gis_render/36_20_11/12243390/tile.png:1 GET https://hst-api.wialon.com/gis_render/36_20_11/12243390/tile.png 401
The fragment that we detected that initializes the map is the following:
/**
* Initialize map (Leaflet)
*
* Added handler on click and some one, setting of map
*/
var _initMap = function(){
// create Gurtam Maps layer
app.sections = [];
var gurtam = L.tileLayer.webGis(wialon.core.Session.getInstance().getBaseGisUrl('render'), {
attribution: "Gurtam Maps",
minZoom: 4,
userId: wialon.core.Session.getInstance().getCurrUser().getId()
});
// create map object
MAP = L.map("map", {
center: [53.505,28.49],
zoom: 6,
layers: [gurtam],
doubleClickZoom: false,
dragging: true
});
maps = MAP;
// create map object
ROUTE = L.polyline([], {color: 'red'}).addTo(MAP);
MAP.on('mouseup',function(e){
MAP.removeEventListener('mousemove');
});
MAP.on("click", function (evt) {
var $input;
/* jshint eqeqeq: false*/
if(_activeTab == 'tab-search'){
$input = $('.search-point.selected');
$('input.address-input').removeClass('selected');
}else{
$input = $('input.address-input.selected');
}
_searchBlock();
// var $input = $('input.address-input.selected');
if($input && $input.length){
show_marker(evt.latlng, false, $input, true, function(){
$('.add-point').trigger('click', true);
_searchBlock();
});
}
});
MAP.on("dblclick", function (evt) {
var $input, cb = function(){};
/* jshint eqeqeq:false */
if(_activeTab == 'tab-search'){
$input = $('.search-point');
if($input.length){
show_marker(evt.latlng, false, $input, true, function(){
$('.add-point').trigger('click', true);
});
}
}else if(POINTS.length >= 2 && !$('.find-address').val() && POINTS.length < MAX_POINTS){
var notFillInputs = _.filter(POINTS, function(point){ return !point.lat || !point.lon; });
if(notFillInputs.length){
var id = notFillInputs[0].id;
if(id)
$input = $('.point[data-point-index='+id+']').find('input');
}else{
$input = $('.find-address');
cb = function(){
$('.add-point').trigger('click', true);
};
}
_searchBlock();
if($input && $input.length){
show_marker(evt.latlng, false, $input, true, cb);
}
}else{
app.notify.add($.localise.tr('You have reached the limit of points.'), true, 'error');
}
});
};
We do not know what could be happening. Could you help us identify the problem?
We wait comments