Skip to content

Commit 271d7d3

Browse files
authored
Merge pull request #150 from MapWindow/revert-146-nextfullstorm-patch-1
Revert "Add support to tiles from local filesystem"
2 parents 465e19d + be0b218 commit 271d7d3

1 file changed

Lines changed: 3 additions & 33 deletions

File tree

src/Tiles/Providers/BaseProvider.cpp

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CString BaseProvider::_proxyUsername = "";
2828
CString BaseProvider::_proxyPassword = "";
2929
CString BaseProvider::_proxyDomain = "";
3030
CCriticalSection BaseProvider::_clientLock;
31-
const CString filePrefix = "file:///";
3231

3332
// ************************************************************
3433
// GetTileImage()
@@ -91,34 +90,6 @@ CMemoryBitmap* BaseProvider::GetTileHttpData(CString url, CString shortUrl, bool
9190
return bmp;
9291
}
9392

94-
// ************************************************************
95-
// GetTileFileData()
96-
// ************************************************************
97-
CMemoryBitmap* BaseProvider::GetTileFileData(CString url, CString shortUrl, bool recursive)
98-
{
99-
url.Delete(0, filePrefix.GetLength());
100-
url.Replace("|", ":");
101-
url.Replace("/", "\\");
102-
103-
std::ifstream fl = std::ifstream(url.GetBuffer(), std::ofstream::binary);
104-
if (!fl)
105-
return nullptr;
106-
107-
fl.seekg(0, std::ios::end);
108-
int sz = fl.tellg();
109-
if (sz == 0)
110-
return nullptr;
111-
112-
std::vector<char> buf(sz);
113-
114-
fl.seekg(0, std::ios::beg);
115-
fl.read(buf.data(), buf.size());
116-
if (!fl)
117-
return nullptr;
118-
119-
return ReadBitmap(buf.data(), buf.size());
120-
}
121-
12293
// ************************************************************
12394
// DownloadBitmap()
12495
// ************************************************************
@@ -129,10 +100,9 @@ CMemoryBitmap* BaseProvider::DownloadBitmap(CPoint& pos, int zoom)
129100

130101
shortUrl.Format(R"(\zoom=%d\x=%d\y=%d)", zoom, pos.x, pos.y);
131102

132-
if (url.Find(filePrefix) == 0)
133-
return GetTileFileData(url, shortUrl);
134-
else
135-
return GetTileHttpData(url, shortUrl);
103+
CMemoryBitmap* bmp = GetTileHttpData(url, shortUrl);
104+
105+
return bmp;
136106
}
137107

138108
// ************************************************************

0 commit comments

Comments
 (0)