-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathWmsHelper.cpp
More file actions
33 lines (28 loc) · 863 Bytes
/
Copy pathWmsHelper.cpp
File metadata and controls
33 lines (28 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "stdafx.h"
#include "WmsHelper.h"
// ****************************************************
// Cast()
// ****************************************************
CWmsLayer* WmsHelper::Cast(CComPtr<IWmsLayer> p)
{
return (CWmsLayer*)&(*p);
}
// ****************************************************
// GetServerBounds()
// ****************************************************
bool WmsHelper::GetServerBounds(IWmsLayer* layer, Extent& extent)
{
WmsCustomProvider* provider = WmsHelper::Cast(layer)->get_InnerProvider();
if (provider)
{
CustomProjection* p = provider->get_CustomProjection();
if (p)
{
// this bounds will be update during each loading of the layer based on map projection;
// if no loading was done, the bounds will be invalid (all values set to zero)
extent = p->get_MapBounds();
return true;
}
}
return false;
}