Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/DGCustomization/src/DGMap.BaseLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ DG.Map.addInitHook(function() {
var apiKey = this.options.key || DG.config.key;

this.isErrorWasShown = false;
function handleTileError() {
var errorMessage = DG.DomUtil.create('div', 'dg-error-message');
if (!this.isErrorWasShown) {
errorMessage.innerHTML = 'Your RasterJS API key is invalid. Please contact api@2gis.com to get RasterJS API key.';
// function handleTileError() {
// var errorMessage = DG.DomUtil.create('div', 'dg-error-message');
// if (!this.isErrorWasShown) {
// errorMessage.innerHTML = 'Your RasterJS API key is invalid. Please contact api@2gis.com to get RasterJS API key.';

var mapContainer = document.getElementById('map');
// var mapContainer = document.getElementById('map');

if (mapContainer) {
mapContainer.appendChild(errorMessage);
} else {
console.warn('Map container with id "map" not found.');
}
// if (mapContainer) {
// mapContainer.appendChild(errorMessage);
// } else {
// console.warn('Map container with id "map" not found.');
// }

this.isErrorWasShown = true;
}
}
// this.isErrorWasShown = true;
// }
// }

var tileUrl = DG.config.secureProtocol + (DG.Browser.retina ? DG.config.retinaTileServer : DG.config.tileServer);
var arabicTileUrl = DG.config.secureProtocol +
Expand Down Expand Up @@ -85,7 +85,7 @@ DG.Map.addInitHook(function() {
}
}

this.baseLayer.on('tileerror', handleTileError);
// this.baseLayer.on('tileerror', handleTileError);

updateTileUrl.call(this);

Expand Down
Loading