Multi-source online and offline Data Reading (3D Graph slicing)

Source: Internet
Author: User

The reading examples of the map World Service have produced results in the past two years. Here, we provide code to supplement the integrity of the full series of topics and provide parameters only. Apart from the differences between image obtaining functions and other functions, the other methods for the previous two topics are consistent.

Public class
Ngcctiledmaplayer:
Tiledmapservicelayer

{

// ***************** Modify the address based on the actual address of the map world
{Baseurl} parameter *************//

// Privateconst string baseurl = "http://map.sxch.gov.cn: 7001/geoglobe/dataserver? T = china400 &";

Privateconst
Stringbaseurl1 = "http: // tile ";

// Privateconst string baseurl2 = ".tianditu.com/dataserver? T = a0512_emap &";

Privateconst
Stringbaseurl2 = ".tianditu.com/dataserver? T = b0627_emap1112 &";

System. randomra =
New system. Random ();

Privateconst
Int wkid = 4326;

 

Public
Override voidinitialize ()

{

// The full graph range of the layer

This. fullextent =
New ESRI. ArcGIS. Client. Geometry. Envelope (-180,-90,180, 90)

{

Spatialreference = new ESRI. ArcGIS. Client. Geometry. spatialreference (wkid)

};

// Layer Space reference

This. spatialreference =
New ESRI. ArcGIS. Client. Geometry. spatialreference (wkid );

// Set the slice information.
The size of each slice is 256x256px, 14 levels

This. tileinfo =
New tileinfo ()

{

Height = 256,

Length = 256,

Origin = new ESRI. ArcGIS. Client. Geometry. mappoint (-180, 90) {spatialreference =
New ESRI. ArcGIS. Client. Geometry. spatialreference (wkid )},

Lods = new ESRI. ArcGIS. Client. layd [20]

};

// Set the resolution of each level. Each level of resolution is half of the previous level.

Doubleresolution = 0.70391441567318025*1.99775 ;//****************
Modify adjustment coefficient based on the actual address of the map
*************//

For (INT I = 0; I <tileinfo. lods. length; I ++)

{

Tileinfo. lods [I] = new
Levels () {resolution = resolution };

Resolution/= 2;

}

// Call the initialization event

Base. initialize ();

}

/// Return the URL of the specified slice

Public
Override stringgettileurl (INT level,
Introw, int col)

{

Returnbaseurl1 + RA. Next (1, 7). tostring () + baseurl2 +
"L =" + level. tostring () +
"& X =" + col. tostring () + "& Y =" + row. tostring ();

// Returnbaseurl + "L =" + level. tostring () + "& X =" + col. tostring () + "& Y =" + row. tostring ();

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.