The arcgistiledmapservicelayer layer in ArcGIS API for Silverlight inherits from tiledmapservicelayer. If you want to implement your own cache map layer, inherit it and reload the gettileurl method. ArcGIS API for Silverlight internally calculates the current access scaling level, slice two-dimensional number row, Col. These parameters are exposed to the gettileurl method. In this method, set the URL to access the Google static map.
Public class googlemaplayer: tiledmapservicelayer
{
Private const double cornercoordinate = 20037508.3427892;
Public override void initialize ()
{
This. fullextent = new ESRI. ArcGIS. Client. Geometry. Envelope (-20037508.3427892,-20037508.3427892, 20037508.3427892, 20037508.3427892)
{
Spatialreference = new spatialreference (0, 102100)
};
// This layer's spatial reference
This. spatialreference = new spatialreference (102100 );
// Set up tile information. Each tile is 256x256px, 19 levels.
This. tileinfo = new tileinfo ()
{
Height = 256,
Length = 256,
Origin = new mappoint (-cornercoordinate, cornercoordinate) {spatialreference = new ESRI. ArcGIS. Client. Geometry. spatialreference (102100 )},
Lods = new d3[ 19]
};
// Set the resolutions for each level. Each level is half the resolution of the previous one.
Double resolution = cornercoordinate * 2/256;
For (INT I = 0; I <tileinfo. lods. length; I ++)
{
Tileinfo. lods [I] = new LD () {resolution = resolution };
Resolution/= 2;
}
// Call base initialize to raise the initialization event
Base. initialize ();
}
Public override string gettileurl (INT level, int row, int col)
{
String baseurl = "plaintext ";
Return string. Format (baseurl, Col, row, level );
}
}
You can also download the test results at http://download.csdn.net/detail/leesmn/3636647.