Blueviewer Map Loading analysis (C #)

Source: Internet
Author: User
Tags range client
Load Blueviewer is an example of ArcIMS two development based on. NET link, which contains some of the most basic features of Webgis. About the structure of arcims and its introduction can refer to my other essay " arcims Architecture ". For a description of the. NET link Connector, refer to the arcims connector--. NET link usage ". Mars wrote an article on the Brief analysis of ArcIMS , and made a simple analysis of the blueviewer.

Using. NET link for arcims Two development is not complicated, but many just contact GIS friends face a large number of JavaScript and arcxml, coupled with the Webgis operating mechanism do not understand, or feel not. This essay will analyze the Blueviewer map loading display mechanism, see the whole code running process, the code language uses C #.

The use of HTML, Arcexplorer, Javaviewer client development, need to use JavaScript on the client to write and encapsulate the Arcxml, although the Arcxml transmission process has become relatively simple, but the endurance of people is absolutely a great test, It is therefore generally recommended to use a variety of arcims connectors for two development, Blueviewer is an example of two development based on. NET link.

The main function of the connector is to arcxml the request to the ArcIMS application server according to the request of the client, and to extract the result of the ArcIMS Application Server (general picture) and send it to the client to respond to the user's request. In the client, the user of map operation and map display or by JavaScript to control, but relative to the client to write Arcxml, its workload is to reduce a lot, development method more in line with OOP, where. NET link is relatively not good at object-oriented aspect, But using asp.net for development,. NET Link is the second choice.

The following is an analysis of the process of the program launch map display
----------------------------------------

There are five hidden fields in the Default.aspx, Hvminx, Hvminy, Hvmaxx, Hvmaxy, Hvmappage, the first four objects describe the current map display range, and the last one to return the URL displayed by the map. The first step in starting a program is to initialize these values, which are described in detail in Default.aspx.cs.

protected void Page_Load (object sender, System.EventArgs e)
{
if (!) ( IsPostBack))
{
Session.add ("Valid_user", true);
Hvmappage.value = "makemap.aspx";
}
if ((request.querystring["xmin"] = = NULL | request.querystring["ymin"] = = NULL |
request.querystring["Xmax"] = = NULL | request.querystring["Ymax"] = = null))
{
Hvminx.value = system.configuration.configurationsettings.appsettings["Default_extent_xmin"];
Hvminy.value = system.configuration.configurationsettings.appsettings["Default_extent_ymin"];
Hvmaxx.value = system.configuration.configurationsettings.appsettings["Default_extent_xmax"];
Hvmaxy.value = system.configuration.configurationsettings.appsettings["Default_extent_ymax"];
}
Else
{
Hvminx.value = request.querystring["Xmin"];
Hvminy.value = request.querystring["Ymin"];
Hvmaxx.value = request.querystring["Xmax"];
Hvmaxy.value = request.querystring["Ymax"];
}
}
In Default.aspx, the onload invokes the Main.js () method. In startup (), the Posloadingimage (), Posborder (), Posbordernavigation (), Postools () Four methods are called successively, representing the "Loading" icon when the image is loaded, respectively. Enlarge and reduce the position of the picture frame and azimuth moving icon (A), the position of the entire tool status bar below (B, depending on the position of the moving icon). Handletoolclick () is then used to determine whether the current mouse operation is zoomed in (itoolmode==1) or moving the layer (itoolmode==2) to initialize the display of the current M_txtycoord coordinates through M_txtxcoord and x/y (C)。



M_imgmapcanvas.onload = Hidewaitimage;
This code shows that before the server responds to user action, the client's state cleanup work, hidewaitimage the main role is to clear the User zoom box, hide the "Loading" icon.

So far, the program has done all the work before sending Arcxml to the ArcIMS application server, including the program interface display, the client's response to the user interface operation, followed by the user's request to send to the system server side (Web application server, ArcIMS application servers and arcims space servers collectively) respond to user requests. Because this is described here is the process of starting the program, does not involve the user of the actual operation of the map, but the user's operation of the map is nothing more than a bunch of JavaScript code, on the following program response process does not have much impact. Whether the program starts, or the user requests service for the map, the Submit () method is used to send the request and return the system server-side response.

function Submit () {

var surl = m_hvmappage.value+ "? Xmin= "+
M_mapviewer.getextent (). GetLeft () +
"&ymin=" +m_mapviewer.getextent () Getbottom () +
"&xmax=" +m_mapviewer.getextent () GetRight () +
"&ymax=" +m_mapviewer.getextent () GetTop () +
"&width=" +m_mapviewer.gettagwidth () +
"&height=" +m_mapviewer.gettagheight ();

Updatezoomlevel (M_mapviewer.getlevel ());
Showwaitimage ();

if (navigator.userAgent.indexOf (' NETSCAPE6/6 ') >-1) {
M_ltimerid = SetInterval ("HideWaitImageForNetscape6 ();", 100);
}

M_IMGMAPCANVAS.SRC = sURL;

Persistextent ();

}
In the Page_Load () of Default.aspx, Hvmappage.value has been assigned "makemap.aspx", the Makemap.aspx page is invoked and its Page_Load () procedure is started. In this process, according to the user request package Arcxml send, and the system server side of the response, the specific process can refer to thearcims connector--. NET link usage》。 The page returns the URL of the picture that the user needs, defines the current map display range, assigns the parameters to submit (), and saves the map range in the Hvminx, Hvminy, Hvmaxx, Hvmaxy four hidden fields by Persistextent () method.

In this case, the program completes the entire startup process, and its interface, as shown in the image above, is essentially the same when the user requests service for the operation, except that the JavaScript operation is different. Familiarity with JavaScript and XML, understanding of the ArcIMS architecture and service request process, is not complicated for. NET Link two-time development. In the era of Ajax rampant, the client request service and response to client requests in the process of using AJAX to achieve, you can get rid of frame frame constraints, improve the logic structure of code, enhance the Webgis user experience.

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.