Creating Report Scripts with ColdFusion
|
107
The
<CFQUERY>
element contains a single SQL Insert statement, which is
used to add the form data to the map resource database.
The SQL Insert statement adds data to a database resource, in this case the Inci-
dents table in the assessor DSN. The parenthetical values
lat
,
lon
,
description
, and
reported_by
are the names of the database fields we want
to supply values for. The parenthetical values
#FORM.rpt_lat#
,
#FORM.rpt_lon#
,
#FORM.rpt_info#
, and
#FORM.rpt_by#
represent the
information we want to place into the URL parameters passed by
showform.cfm
.
The first line of the
<SCRIPT>
element displays an alert telling users to reload
the map to see their changes. The second line closes the form window,
leaving only the original map window.
Creating an HTML Page to Display the Map
To create an HTML page to display our map, we’ll use
parcel_map.htm
, modi-
fying only the
<H1>
and the short paragraph of descriptive text:
<HTML>
<HEAD>
<TITLE>ColdFusion Example</TITLE>
</HEAD>
<BODY>
<!-- Only the next two lines are different -->
<H1>Modifying a Database via the Map</H1>
<P>This example uses <b>ColdFusion</b> to update a database map
resource</P>
<!-- embedded map -->
<OBJECT ID="map" WIDTH=600 HEIGHT=250
CLASSID="CLSID:62789780-B744-11D0-986B-00609731A21D">
<PARAM NAME="URL"
VALUE="http://www.yourserver.com/maps/StarterApp.mwf?ReportTarget=
Right>
<EMBED
SRC="http://www.yourserver.com/maps/StarterApp.mwf?ReportTarget=Ri
ght NAME="map" WIDTH=600 HEIGHT=250>
</OBJECT>
</BODY>
</HTML>
Creating a Custom Menu Item
There a few problems with this design. One is that it requires users to select
View
➤
Reports from the popup menu, then select Incidents (CF) from the
list, then clear the JavaScript
alert
box that tells them to select a point, and
then digitize the point. Another problem is that because our report isn’t asso-
ciated with a layer, users can add items to the Incidents map layer even when
that layer isn’t visible.
Summary of Contents for 15606-011408-9300 - MAP R6.3 UPG
Page 1: ...15306 010000 5060 October 2001 Autodesk MapGuide Release 6 Developer s Guide ...
Page 6: ...vi ...
Page 16: ...16 ...
Page 30: ...30 ...
Page 84: ...84 ...
Page 134: ...134 ...
Page 202: ...202 ...