aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/MapImageService
diff options
context:
space:
mode:
authorMelanie Thielker2014-03-18 02:16:00 +0100
committerMelanie2014-03-18 00:50:00 +0000
commita53272c5fbc4d4db8cc4ece1ec3d4497ac5595d2 (patch)
tree5bf1ce52eab95772437e2fece7bee84c958b6c3b /OpenSim/Services/MapImageService
parentFix a bug in previous commit 01520bb where I accidentally saved OtherCleanTim... (diff)
downloadopensim-SC-a53272c5fbc4d4db8cc4ece1ec3d4497ac5595d2.zip
opensim-SC-a53272c5fbc4d4db8cc4ece1ec3d4497ac5595d2.tar.gz
opensim-SC-a53272c5fbc4d4db8cc4ece1ec3d4497ac5595d2.tar.bz2
opensim-SC-a53272c5fbc4d4db8cc4ece1ec3d4497ac5595d2.tar.xz
Add delete maptile ability to MapImageService - yet untested
Diffstat (limited to 'OpenSim/Services/MapImageService')
-rw-r--r--OpenSim/Services/MapImageService/MapImageService.cs33
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs
index 9ba5dab..31e147b 100644
--- a/OpenSim/Services/MapImageService/MapImageService.cs
+++ b/OpenSim/Services/MapImageService/MapImageService.cs
@@ -112,9 +112,38 @@ namespace OpenSim.Services.MapImageService
112 reason = e.Message; 112 reason = e.Message;
113 return false; 113 return false;
114 } 114 }
115 }
116
117 return UpdateMultiResolutionFiles(x, y, out reason);
118 }
119
120 public bool RemoveMapTile(int x, int y, out string reason)
121 {
122 reason = String.Empty;
123 string fileName = GetFileName(1, x, y);
124
125 lock (m_Sync)
126 {
127 try
128 {
129 File.Delete(fileName);
130 }
131 catch (Exception e)
132 {
133 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e);
134 reason = e.Message;
135 return false;
136 }
137 }
115 138
116 // Also save in png format? 139 return UpdateMultiResolutionFiles(x, y, out reason);
140 }
117 141
142 private bool UpdateMultiResolutionFiles(int x, int y, out string reason)
143 {
144 reason = String.Empty;
145 lock (m_Sync)
146 {
118 // Stitch seven more aggregate tiles together 147 // Stitch seven more aggregate tiles together
119 for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) 148 for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++)
120 { 149 {
@@ -126,7 +155,7 @@ namespace OpenSim.Services.MapImageService
126 155
127 if (!CreateTile(zoomLevel, x1, y1)) 156 if (!CreateTile(zoomLevel, x1, y1))
128 { 157 {
129 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0} at zoom level {1}", fileName, zoomLevel); 158 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel);
130 reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); 159 reason = string.Format("Map tile at zoom level {0} failed", zoomLevel);
131 return false; 160 return false;
132 } 161 }