Enlarge reduction: VAR x1, y2; // start point coordinate VAR Y1, X2; // diagonal point coordinate // start pull box. Trigger Function Startzoombox (E) by mouse click to move
ZLEFT = x1; // You draw the position of the left side Ztop = Y1; // You draw the position of the box zbottom = Y1; // You draw the position of the next position Zright = x1 // You draw the right side Location Boxit (x1, y1, x2, y2); // draw red box, DHTML implementation zooming = true; // means being enlarged}}}} Return False;} // pull box, mobile mouse function mousestuff () {x2 = mousex; // Get the current mouse coordinate Y2 = mousey; // Get the current mouse coordinate
IF (x1> x2) {// Judgment the start point terminal X coordinate size, re-to Zright ZLEFT value Zright = x1; zleft = x2;} else {zleft = x1; zright = x2;} if (Y1> Y2) {/ / Judgment start point end y zbottom ztop value zbottom = Y1; ztop = Y2;} else {ztop = Y1; zbottom = y2;} // If the start point is not a point, picture frame IF ((x1! = X2) && (Y1! = Y2)) {Boxit (ZLEFT, ZTOP, ZRIGHT, ZBOTTOM);}}
/ / Stop the pull box, the mouse release trigger event function fixzoombox (e) {zooming = false; // indicates that the enlargement is completed
// When we pull the box too small, when the width is smaller than the line, it is enlarged. IF ((ZRight Var Templeft = lastlet; var temptop = lasttop; var tempnettom = lastbottom; savelastextent (); // Get the actual distance XDistance of the lateral direction of each pixel represents the current map ratio, the lateral distance. // is actually the latitude and longitude pixelx = xdistance / iWidth of each pixel; // 拉 拉 框 离 离 离 离 离 离 离 离 离;;; ? // Screen coordinates Left corner of the coordinate original // Geographic coordinates We correspond to the left corner of the coordinate original var. = IHEIGHT - ZTOP; // Gets the actual distance YDistance of the vertical direction of each pixel represents the current map ratio, the longitudinal distance. Pixely = YDISTANCE / IHEIGHT; / / Everyone carefully looks at the following code, gets our operation, up and down left and right (distance) latitude and longitude / / result upper side longitude = long-range from each pixel * / pull the side of the map and the bottom of the map (Screen Dist) Operation Previous Side Side // Here ETOP et al, geographic coordinate ztop, etc. = IHEIGHT - ZBOTTOM; PIXELY = Ydistance / Iheight; Ebottom = Pixely * They EBOTTOM; // Get four latitude and longitude values of Etop Eright ELEFT EBOTM, request IMS servers, returns the appropriate map. SendMapxml ();} returnography;} Eagle eye implementation: Eagle eye implementation method: According to the ARCIMS code description, the implementation of MapInfo, Mapx, Mo, etc. is easy to grasp the logic. Before starting, you first have to be familiar with Arcims, how to record the map. Grab a full picture, form a GIF file, as an eagle eye view. VAR fullft = 116; // When the full picture, the longitude of the leftmost representative of the map is different when you use the coordinates of other coordinate systems. General, we are familiar with the latitude and longitude. Var fullovright = 117; // When the full picture, the rightmost representative of the map is the long-term pattern, the map is the most representative of the Map, the map is the most below the map. longitude // Click the eagle eye, the entrance parameter is the coordinate OvmapClick (x, y) {var ovwidth = 150; // We'm var ovheight = 100; // Eagle eye diagram Height unit PX, is a screen unit // The following two lines of code are obtained, why should two? Maybe we show the image returned by the server. / / The longitude distance of the screen width of each PX unit represents the latitude distance VAR OVWIDTH; / / per PX unit's screen width represents the latitude distance var = fullovheight / ovhemrehen; var ovx = x; var ovy = ovheight - Y; // Note that the screen and geographic coordinate origin are different. It is mentioned in other articles. // The following two lines of code We got the location representative of the mouse click position. (Latitude and longitude) var ovmapx = ovx * ovxincre fullft; var ovmapy = = = = = = = = = = = = a f,,,,, 带 带 带 带 带 带 带 带 带 带 带 带 带 带 带 带 带 带,,,,,,,,,....,...,,..,, SAVELASTEXTENT (); // The following code represents the central point of the map, but the ROOM value is unchanged. ARCIMS is implemented below. In MapXtreme, a function is OK. // Familiar with Arcims, the following code may understand. ELEFT = OVMAPX - XHALF; Eright = OvMapx Xhalf; ETOP = OvMapy YHALF; Ebottom = OvMapy - YHALF; SendMapXML (); }