Closed Maryam69 closed 8 years ago
The WKID value should be the WKID of your UTM projection. The corner coordinate should be the coordinate of the upper left coordinate of where your tile cache begins. Without knowing how you generated the tile cache and what parameters you used, I can't give you more specific information. However that information should be available in your tile cache or in the tool that generated the tiles.
thanks a lot dear Morten. So I explain my code with details as following. I initialized WKID = 102100 and cornerCoordinate = 20037508.3427892. then I created my tile class with these values:
this.TileInfo = new TileInfo()
{
Height = 256,
Width = 256,
// Origin = new MapPoint(-111.09373110000001,41.0014594) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(WKID) },
Origin = new MapPoint(-cornerCoordinate, cornerCoordinate) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(WKID) },
Lods = new Lod[20]
};
then I determined my resolutions for a array of tiles whose length is equal to 20 (TileInfo.Lods.Length=20). double resolution = cornerCoordinate * 2 / 256;//180.0000 * 2 / 256;//
for (int i = 0; i < TileInfo.Lods.Length; i++)
{
TileInfo.Lods[i] = new Lod() { Resolution = resolution };
resolution /= 2;
}
then I crea
```ted google tile url as follow:
public class Google : BaseLayer { public override string MakeURL(int Col, int Row, int Level) { string urrrrl = null; // if (Level < 11) // { string language = "fa"; int srv = (int)Style; string Server = "google.com"; string sec1 = string.Empty; // after &x=... string sec2 = string.Empty; // after &zoom=... GetSecureWords(Col, Row, out sec1, out sec2); urrrrl = string.Format(baseUrl[srv], UrlFormatServer[srv], GetServerNum(Col, Row, 4), UrlFormatRequest[srv], Version[srv], language, Col, sec1, Row, Level, sec2, Server); return urrrrl; }
public int GetServerNum(int col, int row, int max)
{
return (int)(col + 2 * row) % max;
}
internal void GetSecureWords(int col, int row, out string sec1, out string sec2)
{
sec1 = string.Empty; // after &x=...
sec2 = string.Empty; // after &zoom=...
int seclen = (int)((col * 3) + row) % 8;
sec2 = SecureWord.Substring(0, seclen);
if (row >= 10000 && row < 100000)
{
sec1 = Sec1;
}
}
public string SecureWord = "Galileo";
readonly string Sec1 = "&s=";
/// <summary>Base URL used in GetTileUrl.</summary>
private string[] baseUrl =
{
"http://{0}{1}.{10}/{2}/lyrs={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}", // google map
"http://{0}{1}.{10}/{2}/v={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}", // google terrian
"http://{0}{1}.{10}/{2}/v={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}", // google sattelite
"http://{0}{1}.{10}/{2}/lyrs={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}", // google hybrid
"http://{0}{1}.{10}/{2}/lyrs={3}&hl={4}&x={5}{6}&y={7}&z={8}&s={9}", // google RoadOnly // &src=app
};
string[] Version =
{
"m@170000000", // google map
"p@170000000", // google terrian
"s@170000000", // google sattelite
"y@170000000", // google hybrid
"h@199000000", // google roadOnly
};
string[] UrlFormatServer =
{
"mt", // google map
"mt", // google terrian
"mt", // google sattelite
"mt", // google hybrid
"mts", // google roadOnly
};
string[] UrlFormatRequest =
{
"vt", // google map
"vt", // google terrian
"vt", // google sattelite
"vt", // google hybrid
"vt", // google roadOnly
};
public int GetServerNum1(int col, int row, int max)
{
return (int)(col + 2 * row) % max;
}
private string[] baseUrl1 =
{
"http://{3}/{4}/{5}/{6}/{0}/{1}/{2}.png",
};
public override int Style
{
set;
get;
}
public override string ToString()
{
return "Google";
}
}
after that I load google tile in Esri.ArcGIS.Client.Map component. I successfully load google tiles through these codes. Unfortunately, I do not know the accurate values for WKID and cornerCoordinate for UTM projection.
To sum up, I try each suitable value for WKID or cornerCoordinate But all of my coordinate points set on equator orbit.
If you need more information, I will give you it.
I will appreciate you to guide me.
sincerely
Mary
Sorry but I'm not able help with Google Maps tiles as this a violation of Google's Terms and conditions.
Dear Morten thanks a lot for your contribution. Is it possible for you to explain me more about corner coordinate parameter. How do I determine that? Is there any formulation to calculate this parameter? thanks in advance Mary
Dear all Hi I look at this link arcgis-toolkit-sl-wpf/WebTiledLayer.cs at master · Esri/arcgis-toolkit-sl-wpf · GitHub
that is a remarkable link to get beneficial information for loading tile layer. But as mentioned in this link, the values of cornerCoordinate and WKID are set only for mecator projection. I do not handle this code for UTM projection. how to change these parameters to use them in Utm Projection. please, guide me. Best regards Mary