00001
00052 #ifndef INC_GRE_LRBINGMAPS_H
00053 #define INC_GRE_LRBINGMAPS_H
00054
00055 #ifndef INC_GRE_LRIMAGE_H
00056 #include <gre/lrimage.h>
00057 #endif
00058
00059 #ifndef INC_SPATMOD_IMAGESOURCEBINGMAPS_H
00060 #include <spatmod/imagesourcebingmaps.h>
00061 #endif
00062
00063 #ifndef INC_SPATMOD_IMAGERESAMPLEMETHOD_H
00064 #include <spatmod/imageresamplemethod.h>
00065 #endif
00066
00067 namespace GRE {
00068
00069
00071 class LAYER_BINGMAPS : public GRE::LAYER_IMAGE {
00072 public:
00073
00074
00075 class DISPPARM : public LAYER::DISPPARM {
00076 public:
00077 DISPPARM ();
00078
00079 DISPPARM (
00080 const DISPPARM& rhs
00081 );
00082
00083 virtual ~DISPPARM ();
00084
00085 DISPPARM& operator= (
00086 const DISPPARM& rhs
00087 ) { if (this != &rhs) { Copy(rhs); } return (*this); }
00088
00089 const SPATMOD::IMAGE::SOURCE_BINGMAPS::MAPSTYLE& GetMapStyle (
00090 ) const { return (m_MapStyle); }
00091
00092 SPATMOD::IMAGE::RESAMPLEMETHOD GetResampleMethod (
00093 ) const { return (m_ResampleMethod); }
00094
00095 bool GetShowDatatipTileInfo (
00096 ) const { return (m_bShowDatatipTileInfo); }
00097
00098 bool GetShowDatatipImageValue (
00099 ) const { return (m_bShowDatatipImageValue); }
00100
00101 bool GetShowDatatipDate (
00102 ) const { return (m_bShowDatatipDate); }
00103
00104 bool GetShowLabels (
00105 ) const { return (m_bShowLabels); }
00106
00108 bool IsValidated (
00109 ) const { return (m_IsValidated); }
00110
00111 void SetMapStyle (
00112 const SPATMOD::IMAGE::SOURCE_BINGMAPS::MAPSTYLE& MapStyle
00113 ) { m_MapStyle = MapStyle; }
00114
00115 void SetResampleMethod (
00116 SPATMOD::IMAGE::RESAMPLEMETHOD ResampleMethod
00117 ) { m_ResampleMethod = ResampleMethod; }
00118
00119 void SetShowDatatipTileInfo (
00120 bool ShowDatatipTileInfo
00121 ) { m_bShowDatatipTileInfo = ShowDatatipTileInfo; }
00122
00123 void SetShowDatatipImageValue (
00124 bool ShowDatatipImageValue
00125 ) { m_bShowDatatipImageValue = ShowDatatipImageValue; }
00126
00127 void SetShowDatatipDate (
00128 bool ShowDatatipDate
00129 ) { m_bShowDatatipDate = ShowDatatipDate; }
00130
00131 void SetShowLabels (
00132 bool ShowLabels
00133 ) { m_bShowLabels = ShowLabels; }
00134
00135 private:
00136 #ifndef GENERATING_DOXYGEN_OUTPUT
00137 bool m_IsValidated;
00138 bool m_bShowDatatipTileInfo;
00139 bool m_bShowDatatipImageValue;
00140 bool m_bShowDatatipDate;
00141 bool m_bShowLabels;
00142 SPATMOD::IMAGE::SOURCE_BINGMAPS::MAPSTYLE m_MapStyle;
00143 SPATMOD::IMAGE::RESAMPLEMETHOD m_ResampleMethod;
00144
00145 void Copy (const DISPPARM&);
00146
00147
00148 virtual const SERIALIZERITEM* SerialGetItemDef (SERIALIZER& serializer) const;
00149 virtual ERRVALUE SerialRead (SERIALIZER& serializer);
00150 virtual ERRVALUE SerialWrite (SERIALIZER& serializer, const char *tagname = 0) const;
00151
00152
00153 virtual ERRVALUE v_Validate ();
00154
00155 #endif // GENERATING_DOXYGEN_OUTPUT
00156 };
00157
00158 #ifdef USE_MGUI
00160 static ERRVALUE DlgShowTermsOfUse (
00161 MDLGPARENT dlgparent,
00162 bool bForceToShow = false
00163 );
00164
00166 static ERRVALUE DataTipReverseGeocode (
00167 MISTRING& string,
00168 const DPOINT2D& point,
00169 GRE::VIEW *view
00170 );
00171 #endif
00172
00174 static void RegisterType (
00175 );
00176
00178 explicit LAYER_BINGMAPS (
00179 GRE::GROUP *group,
00180 CREATEFLAGS createflags = CREATEFLAG_None,
00181 GRE::LISTPOS listpos = GRE::LISTPOS_Last,
00182 LAYER *reflayer = 0
00183 );
00184
00186 explicit LAYER_BINGMAPS (
00187 GRE::GROUP *group,
00188 SPATMOD::IMAGE::SOURCE_BINGMAPS::MAPSTYLE MapStyle,
00189 CREATEFLAGS createflags = CREATEFLAG_None,
00190 GRE::LISTPOS listpos = GRE::LISTPOS_Last,
00191 LAYER *reflayer = 0
00192 );
00193
00194 virtual ~LAYER_BINGMAPS ();
00195
00198 const DISPPARM& GetDispParm (
00199 ) const {
00200 return (m_dispparm);
00201 }
00202
00204 void SetDispParm (
00205 const DISPPARM& dispparm,
00206 bool bUpdate = true
00207 );
00208
00209 protected:
00210 DISPPARM m_dispparm;
00211
00212 private:
00213 #ifndef GENERATING_DOXYGEN_OUTPUT
00214
00215 typedef LAYER_IMAGE BASECLASS;
00216
00217 class DLG;
00218 #ifdef USE_MGUI
00219 DLG *m_pDlgControlPanel;
00220 #endif
00221
00222 SPATMOD::IMAGE::SOURCE_BINGMAPS* m_source;
00223 SIMPLE_ARRAY<INT32> m_ZoomLevelArray;
00224 bool m_HasError;
00225
00226 ERRVALUE Draw2D (LAYERDC& layerdc);
00227 static ERRVALUE DoRequest (const DPOINT2D& pt, MISTRINGLIST& strings);
00228
00229 #ifdef USE_MGUI
00230 void OnMenuTool (MGUI::ID, bool);
00231 #endif
00232
00233 static void GRECB_Layer (const GRE::MSG *msg, void *vpCommonParm);
00234
00235
00236 #ifdef USE_MGUI
00237 virtual int v_ControlPanel (MDLGPARENT dlgparent, UINT32 flags = 0);
00238 virtual void v_MenuAddLayerItems (MGUI::MENU& menu);
00239 #endif
00240 virtual bool v_CanRender () const;
00241 virtual LAYER* v_Copy (GRE::GROUP *group) const;
00242 bool v_DataTipHasEnabled () const;
00243 virtual void v_DataTipGetObjectNamesString (const DPOINT2D& point, MISTRING& string, int indent, GRE::VIEW *view) const;
00244 int v_DataTipGetString (const DPOINT2D& point, MISTRING& string, SPATMOD::IMAGE::STAGE_ARRAY& images, GRE::VIEW *view);
00245 virtual ERRVALUE v_Draw (LAYERDC& layerdc);
00246 virtual ERRVALUE v_DrawOverlay (LAYERDC& layerdc);
00247 virtual double v_GetScaleMaxDetail (const DPOINT2D& point, const SPATREF::COORDREFSYS& crs, double DisplayPixelSizeMM) const;
00248 virtual const char* v_SerialGetTagName () const;
00249 virtual void v_SetDftName (bool ReplaceExisting);
00250 virtual ERRVALUE v_UpdateExtents (bool forceupdate);
00251
00252 LAYER_BINGMAPS (const LAYER_BINGMAPS&);
00253 LAYER_BINGMAPS& operator= (const LAYER_BINGMAPS&);
00254
00255 #endif // GENERATING_DOXYGEN_OUTPUT
00256 };
00257
00258
00259
00260 }
00261
00262 #endif // INC_GRE_LRBINGMAPS_H