notifications on tile layer add/remove

merge-requests/1/head
Julien Veyssier 2017-03-18 01:04:19 -03:00
parent 71b0715058
commit 0700102c57
2 changed files with 13 additions and 0 deletions

View File

@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- save/restore current tile layer
- integration in "Files" and "File sharing" context menu for .gpx files
[#11](https://gitlab.com/eneiluj/gpxedit-oc/issues/11) @rugk
- notifications on tile layer add/remove
### Changed

View File

@ -967,8 +967,14 @@ function deleteTileServer(li){
}
gpxedit.activeLayers.removeLayer(gpxedit.baseLayers[sname]);
delete gpxedit.baseLayers[sname];
OC.Notification.showTemporary(t('gpxedit', 'Tile server "{ts}" has been deleted', {ts: sname}));
}
else{
OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" deletion', {ts: sname}));
}
}).always(function(){
}).fail(function(){
OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" deletion', {ts: sname}));
});
}
@ -1011,8 +1017,14 @@ function addTileServer(){
{maxZoom: 18, attribution: 'custom tile server'});
gpxedit.activeLayers.addBaseLayer(newlayer, sname);
gpxedit.baseLayers[sname] = newlayer;
OC.Notification.showTemporary(t('gpxedit', 'Tile server "{ts}" has been added', {ts: sname}));
}
else{
OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" addition', {ts: sname}));
}
}).always(function(){
}).fail(function(){
OC.Notification.showTemporary(t('gpxedit', 'Failure on tile server "{ts}" addition', {ts: sname}));
});
}