Autodesk 15606-011408-9300 Developer Guide - Page 175

Summary of ASP Objects, Components, and Events, Example Code

Page 175 highlights

map.htm Example Code (continued) The map is now embedded, the event observers are set up, and the onDigitizedPoint function is in place to update the Lat and Lon boxes with the coordinates from the point the user clicks. The ASP code in poi.asp, which drives the controls in the right-hand frame, sets up the controls and the functions behind them. This is where you will see the SDF Component Toolkit commands. Note the use of the ASP method server.CreateObject throughout the code; for more information about ASP, see "Summary of ASP Objects, Components, and Events" on page 110. poi.asp Example Code Points of Interest

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208

SDF Component Toolkit Applications
|
175
The map is now embedded, the event observers are set up, and the
onDigitizedPoint
function is in place to update the
Lat
and
Lon
boxes
with the coordinates from the point the user clicks. The ASP code in
poi.asp
, which drives the controls in the right-hand frame, sets up the
controls and the functions behind them. This is where you will see the SDF
Component Toolkit commands. Note the use of the ASP method
server.CreateObject
throughout the code; for more information about
ASP, see
Summary of ASP Objects, Components, and Events
on page 110.
<PARAM NAME="ErrorTarget" VALUE="">
<PARAM NAME="ObjectLinkTarget" VALUE="">
<PARAM NAME="ReportTarget" VALUE="">
<PARAM NAME="URLList" VALUE="Off">
<PARAM NAME="URLListTarget" VALUE="">
<PARAM NAME="AutoLinkLayers" VALUE="">
<PARAM NAME="AutoLinkTarget" VALUE="">
<PARAM NAME="AutoLinkDelay" VALUE="20">
<!-- in actual source, EMBED tag is on a single line -->
<EMBED SRC="http://yourserver.com/maps/poi.mwf?URL=
http://yourserver.com/maps/poi.mwf&Lat=0&Lon=0&MaScale=0
&Width=0&Units=M&ToolBar=On&StatusBar=On&LayersViewWidth=150
&DefaultTarget=&ErrorTarget=&ObjectLinkTarget=&ReportTarget=
&URLList=Off&URLListTarget=&AutoLinkLayers=&AutoLinkTarget=
&AutoLinkDelay=20" NAME="map" WIDTH="100%" HEIGHT="100%">
</OBJECT>
</BODY>
</HTML>
poi.asp
Example Code
<%@ LANGUAGE="JavaScript" %>
<HTML>
<HEAD>
<TITLE>Points of Interest</TITLE>
</HEAD>
<BODY BGCOLOR="#C0C0C0">
<%
// First, set up the variables
var op = Request.Form("op");// Operation being performed, hidden form field
var pointName = "";// Value of Name field on the form
var pointLat = "";// Value of the Lat field on the form
var pointLon = "";// Value of the Lon field on the form
var msgText = "";// Message text to display at bottom of page
var actionOp = "";// Action to perform after successful operation
var zoomToLat = 0.0;// Lat to zoom to, used for Find operation.
var zoomToLon = 0.0;// Lon to zoom to, used for Find operation.
map.htm
Example Code (
continued
)