Creating a feature_info Request
|
23
Example of a feature_info Request
The following example requests feature information from the
Sample_World.mwf
file. The request specifies a bounding box with a lower-left
coordinate of (26.117831, 30.373481) and upper-right coordinate of
(49.340653, 68.102723), which identifies the area of interest on the map. The
request also specifies the area’s width and height, expressed in pixels, and the
feature’s
XY
location, expressed in pixels:
http://localhost:8080/liteview6.5/servlet/MapGuideLiteView?
REQUEST=feature_info
&BBOX=26.117831,30.373481,49.340653,68.102723
&WIDTH=600
&HEIGHT=400
&LAYERS=Sample_World.mwf
&X=300
&Y=200
Positioning Feature Information
The
XY
pixel position of the feature information must correspond to the
displayed map, so that your application displays feature information in an
appropriate location. You match the LAYER, BBOX, WIDTH, and HEIGHT
values of the map request and feature_info request to display feature infor-
mation correctly. In the ColdFusion sample application
map.cfm
, for
example, these values are set for
Sample_World.mwf
as follows:
<cfset mapName = "Sample_World.mwf">
<cfset defaultbbox = "-150.0,0.0,-54.0,92.0">
<cfset width = "500">
<cfset height = "480">
The following excerpt from
feature_info.cfm
shows that when the ColdFusion
sample application builds the feature_info request, it uses form variables
passed from
map.cfm
to set LAYER, BBOX, WIDTH, and HEIGHT values to
match those of the map request:
<cfset urlRequest =
"http://" & Form.server & "/servlet/MapGuideLiteView?
REQUEST=feature_info
&HEIGHT=" & Form.height
& "&WIDTH=" & Form.width
& "&LAYERS=" & Form.mapName
& "&BBOX=" & Form.bbox
& "&X=" & Form.MAP.X
& "&Y=" & Form.MAP.Y>
Note
The
Form.server
variable must include the web-server name and context
path. For a default
Autodesk MapGuide
LiteView installation,
Form.server
is
Содержание 15606-011408-9330 - MAPGUIDE R6.3 SITE LIC-UPG R6
Страница 1: ...April 2004 Autodesk MapGuide LiteView Developer s Guide ...
Страница 12: ...8 Chapter 1 Introduction ...
Страница 38: ...34 Chapter 2 Understanding Requests ...
Страница 90: ...86 Chapter 4 Configuring and Using the Sample Applications ...